Make SUI previews readable by screen readers#18418
Merged
Conversation
9 tasks
carlos-zamora
added a commit
that referenced
this pull request
Jan 20, 2025
DHowett
reviewed
Jan 21, 2025
| { | ||
| // the accessible name was not defined, so try to | ||
| // extract the value directly from the CurrentValue property | ||
| if (const auto currentValText{ currentVal.try_as<hstring>() }) |
DHowett
reviewed
Jan 21, 2025
|
|
||
| void SettingContainer::_OnCurrentValueChanged(const Windows::UI::Xaml::DependencyObject& d, const Windows::UI::Xaml::DependencyPropertyChangedEventArgs& /*e*/) | ||
| { | ||
| const auto& obj{ d.try_as<Editor::SettingContainer>() }; |
Member
There was a problem hiding this comment.
Suggested change
| const auto& obj{ d.try_as<Editor::SettingContainer>() }; | |
| const auto obj{ d.try_as<Editor::SettingContainer>() }; |
not necessary; decays to const auto anyway
DHowett
reviewed
Jan 21, 2025
|
|
||
| winrt::hstring LaunchViewModel::LaunchSizeCurrentValue() const | ||
| { | ||
| return winrt::hstring{ fmt::format(FMT_COMPILE(L"{} × {}"), InitialCols(), InitialRows()) }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Fixes a few accessibility bugs in the SettingContainer previews. Main changes include:
SettingContainerwas considered a separate UIA element from the inner expander. It's been marked asAccessibilityView=Rawto "remove" it from the UIA tree.CurrentValueAccessibleNameproperty to theSettingContainerto expose the current value to the screen reader forSettingContainers that have expanders. Non-expanderSetttingContainers already worked fine.CurrentValueAccessibleNameto various settings throughout the settings UI for full coverage. Added aCurrentValuefor the ones that were missing it.IconReferences and Relevant Issues
Paddingwas not updated since #18300 is handling that. This'll just automatically make it accessible.Font axes and features weren't updated to show previews, but I'm happy to do it if given a suggestion.
Part of #18318
Detailed Description of the Pull Request / Additional comments
SettingContainerupdates:AccessibilityView = RawforSettingContainers with expanders. This is because the expander itself is the one we care about. No need to have another layer of UIA objects saying it's a group.CurrentValueAccessibleNamepropertyAutomationProperties.NameCurrentValuechanges.Expander, if one exists."<Header>: <CurrentValueAccessibleName>". IfCurrentValueAccessibleNameisn't provided, we try to use theCurrentValueif it's a string.Icon's value is now read out by a screen reader instead of staying silent. It'll read the icon path.Icon.TabTitlenow displays/reads "None" if no tab title is set.ColorSchemeis now read out by a screen reader.Foreground,Background,SelectionBackground, andCursorColor) are now read out by a screen reader. Format is "#".BackgroundImageAlignmentis now displayed and read out by a screen reader.LaunchSizeis now displayed and read out by a screen reader. Format is "Width x Height".Validation Steps Performed
Tabbed through the settings UI with a screen reader. Each of these settings now reads out a preview.