Skip to content

fix: Fix model picker icon theme switching and line-numbers Name length - #618

Merged
haoliuu merged 3 commits into
mainfrom
haoliu/a11y-fix-5
Jul 14, 2026
Merged

fix: Fix model picker icon theme switching and line-numbers Name length#618
haoliuu merged 3 commits into
mainfrom
haoliu/a11y-fix-5

Conversation

@haoliuu

@haoliuu haoliuu commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

1. Model picker icons don't update on runtime theme switch
The OpenAI / Custom models / Ollama icons were bound OneTime to paths computed once, so toggling the Windows theme at runtime left them stale (low-contrast in dark/light). Made ModelPickerDefinition.Icon observable + OneWay, and refresh the themed paths on ActualThemeChanged / picker open / ColorValuesChanged.

2. Line-numbers pane UIA Name > 512 chars
The line-numbers ScrollViewer had no explicit Name, so UIA concatenated every line number ("1 2 3 …"). Added AutomationProperties.Name="Line numbers" to the pane and excluded the decorative digits (AccessibilityView="Raw").

Verified with Accessibility Insights and runtime theme toggling; builds clean.

Copilot AI review requested due to automatic review settings July 13, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves runtime UI correctness and accessibility in AI Dev Gallery by ensuring model picker icons update when the app theme changes, and by preventing an excessively long UIA Name for the line-numbers pane.

Changes:

  • Made ModelPickerDefinition.Icon observable and switched the model picker icon binding to OneWay, enabling runtime updates.
  • Centralized themed icon path updates in ModelPickerDefinition.RefreshThemeAwareIcons() and invoked it on theme/resource changes and when the picker loads models.
  • Fixed the line-numbers pane’s UIA Name length by naming the ScrollViewer and marking the decorative digits as AccessibilityView="Raw".

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
AIDevGallery/MainWindow.xaml.cs Refreshes theme-aware model picker icons during resource updates triggered by theme/high-contrast changes.
AIDevGallery/Controls/SampleContainer.xaml Adds an explicit UIA name for the line-numbers scroller and hides decorative line-number text from accessibility.
AIDevGallery/Controls/ModelPicker/ModelPickerViews/ModelPickerDefinitions.cs Makes Icon raise change notifications and adds a centralized theme-aware icon refresh helper.
AIDevGallery/Controls/ModelPicker/ModelOrApiPicker.xaml.cs Refreshes themed icon paths on ActualThemeChanged and when loading models.
AIDevGallery/Controls/ModelPicker/ModelOrApiPicker.xaml Updates the icon binding to OneWay so Icon changes propagate to the UI.

@haoliuu
haoliuu merged commit e61e651 into main Jul 14, 2026
8 checks passed
@haoliuu
haoliuu deleted the haoliu/a11y-fix-5 branch July 14, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants