Skip to content

Fix NVDA accessibility: Theme menu items not announcing selection state #2237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 13, 2025

This PR fixes an accessibility issue where screen readers like NVDA cannot announce the currently selected theme in the Options > Theme menu.

Problem

Screen reader users were unable to determine which theme is currently selected when navigating through the Theme submenu. The selected item (Light, Dark, or System) was not being announced by NVDA, making it difficult for users to confirm their current selection or make informed changes.

Root Cause

The theme MenuItems in MainWindow.xaml were using the IsChecked binding property to display the selection state visually, but were missing the IsCheckable="True" attribute. Without this attribute, WPF doesn't properly expose the checked state to UI Automation APIs, preventing screen readers from accessing the selection information.

Solution

Added IsCheckable="True" to all three theme MenuItems:

  • Light theme MenuItem
  • Dark theme MenuItem
  • System theme MenuItem

Technical Details

The IsCheckable="True" attribute enables WPF to:

  1. Properly expose the checked/unchecked state through UI Automation APIs
  2. Allow screen readers to announce the selection state ("checked" or "unchecked")
  3. Maintain proper keyboard navigation patterns for accessibility

This change follows the same pattern already used by other checkable menu options in the same file (lines 122, 127).

Impact

  • Accessibility: Screen readers now properly announce theme selection state
  • Functionality: No changes to existing behavior - themes work exactly the same
  • Compatibility: Uses standard WPF accessibility patterns, no breaking changes

The fix is minimal and surgical, affecting only the three theme MenuItems without changing any underlying functionality.

Fixes #2236.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…o theme MenuItems

Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] NVDA does not announce selected item in Theme tab Fix NVDA accessibility: Theme menu items not announcing selection state Jun 13, 2025
@Copilot Copilot AI requested a review from brianrob June 13, 2025 18:23
Copilot finished work on behalf of brianrob June 13, 2025 18:24
<MenuItem Header="Light" x:Name="Theme_Light" IsChecked="{Binding Path=ThemeViewModel.IsLightTheme}" Command="{x:Static src:ThemeViewModel.SetLightThemeCommand}"/>
<MenuItem Header="Dark" x:Name="Theme_Dark" IsChecked="{Binding Path=ThemeViewModel.IsDarkTheme}" Command="{x:Static src:ThemeViewModel.SetDarkThemeCommand}"/>
<MenuItem Header="System" x:Name="Theme_System" IsChecked="{Binding Path=ThemeViewModel.IsSystemTheme}" Command="{x:Static src:ThemeViewModel.SetSystemThemeCommand}"/>
<MenuItem Header="Light" x:Name="Theme_Light" IsCheckable="True" IsChecked="{Binding Path=ThemeViewModel.IsLightTheme}" Command="{x:Static src:ThemeViewModel.SetLightThemeCommand}"/>
Copy link
Member

Choose a reason for hiding this comment

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

Please also add this to the _Authentication menu items and the _Experimental menu items.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added IsCheckable="True" to all four Authentication menu items that have IsChecked bindings. The Experimental menu items already had IsCheckable="true" so no changes were needed there. The fix ensures screen readers can properly announce the selection state of these checkable menu options. Commit: 14d25d5

Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 13, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of brianrob June 13, 2025 19:02
@brianrob
Copy link
Member

Copilot Post-Mortem:

  • The code delta was easy for copilot.
  • Testing is unfortunately beyond the capabilities of copilot right now because PerfView doesn't build or run on Linux.
  • It would be nice to have UI-centric test capabilities at some point.

@brianrob brianrob marked this pull request as ready for review June 13, 2025 21:21
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.

NVDA does not announce selected item in Theme tab
2 participants