Files
PowerToys/src/settings-ui/Settings.UI/SettingsXAML/Views/NewPlusPage.xaml

206 lines
13 KiB
Plaintext
Raw Normal View History

<helper:NavigablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.NewPlusPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Setting search (#41285) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: #xxx - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Localized search: <img width="1576" height="480" alt="image" src="https://github.com/user-attachments/assets/dd6e5e9f-419b-40b1-b796-f0799481ecfc" /> ## AI summary This pull request introduces infrastructure and code to support search functionality for PowerToys settings, including a new search index specification, a dedicated search library, and updates to the solution configuration. The main changes are the addition of a spec describing how settings should be indexed and navigated, the creation of a new `Common.Search` project with a fuzz search implementation, and updates to the solution file to include these new components. **Settings Search Feature Implementation** * Documentation: * Added a detailed specification (`settings-search.md`) describing the structure of PowerToys settings pages, how to index settings, navigation logic, runtime search, result grouping, build-time indexing strategy, and corner cases. * New Search Library: * Added the new `Common.Search` project to the solution, including its project file and implementation of a fuzz search service (`FuzzSearchService<T>`), match options, match results, and search precision scoring. [[1]](diffhunk://#diff-ddc06fa41e4e723e54181b0cb85cdd00f57f75725d51ceefa242d4d651a9a363R1-R8) [[2]](diffhunk://#diff-1a2ca29fc33bcccf338a7843a040ca2c31ba821e8cab7064fab0dbb1224d454cR1-R39) [[3]](diffhunk://#diff-242764d948b795f39653a84d9b6bfcdc52730100deab2e3a0995be95bb8e7868R1-R10) [[4]](diffhunk://#diff-61e525491ed916ebd65dabb66dd4f5dc720320d7e295ef1e0bd6d506ea0f7df6R1-R67) [[5]](diffhunk://#diff-a775f6de2e8d42982829b4161668f49dedbbd9dcbb05ce20003de7e62275c57aR1-R12) * Solution Configuration: * Updated `PowerToys.sln` to include `Common.Search` and `Settings.UI.XamlIndexBuilder` projects, and configured their build settings for various platforms and mapped project dependencies. [[1]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R714-R716) [[2]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2704-R2727) [[3]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2889) [[4]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R3157-R3158) **Spell-check Dictionary Updates** * Added new terms related to navigation and settings UI components (such as `Navigatable`, `NavigatablePage`, `settingscard`, `Tru`, `tweakable`) to the spell-check dictionary to support the new search and indexing features. [[1]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1020-R1021) [[2]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1498) [[3]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1755-R1761) --------- Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-08-25 21:23:07 +08:00
xmlns:helper="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns:local="clr-namespace:Microsoft.PowerToys.Settings.UI.ViewModels"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"
xmlns:ui="using:CommunityToolkit.WinUI"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<controls:SettingsPageControl x:Uid="NewPlus" ModuleImageSource="ms-appx:///Assets/Settings/Modules/NewPlus.png">
<controls:SettingsPageControl.ModuleContent>
<StackPanel
ChildrenTransitions="{StaticResource SettingsCardsAnimations}"
Orientation="Vertical"
Spacing="2">
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
<controls:GPOInfoControl ShowWarning="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}">
<tkcontrols:SettingsCard
Name="NewPlusEnableToggle"
x:Uid="NewPlus_Enable_Toggle"
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/NewPlus.png}">
Fix accessibility: Associate controls with labels for screen readers (#42439) ## Problem Input controls (ComboBoxes, ToggleSwitches, NumberBoxes) within SettingsCards throughout the PowerToys Settings UI were not programmatically associated with their visible labels. This caused screen readers to announce only the control type (e.g., "combo box", "toggle switch") without any context about the control's purpose, making the settings inaccessible to screen reader users. This violates WCAG 2.2 Success Criterion 1.3.1 (Info and Relationships) - Level A requirement. **User Impact**: Screen reader users navigating PowerToys settings would hear only "edit text" or "combo box" with no description, making it difficult or impossible to configure settings independently. ## Solution Added `AutomationProperties.Name` bindings to controls, linking them to their parent SettingsCard's `Header` property. This establishes the programmatic relationship between labels and controls required by assistive technologies. ### Pattern Applied For controls inside SettingsCards with a `Name` attribute: ```xaml <tkcontrols:SettingsCard Name="LanguageHeader" x:Uid="LanguageHeader"> <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" AutomationProperties.Name="{Binding ElementName=LanguageHeader, Path=Header}" DisplayMemberPath="Language" ItemsSource="{Binding Languages, Mode=TwoWay}" SelectedIndex="{Binding LanguagesIndex, Mode=TwoWay}" /> </tkcontrols:SettingsCard> ``` For data templates where headers are data-bound: ```xaml <DataTemplate x:Key="ComboBoxTemplate" x:DataType="viewModels:PluginAdditionalOptionViewModel"> <tkcontrols:SettingsCard Header="{x:Bind Path=DisplayLabel}"> <ComboBox AutomationProperties.Name="{x:Bind Path=DisplayLabel}" ItemsSource="{x:Bind Path=ComboBoxItems}" /> </tkcontrols:SettingsCard> </DataTemplate> ``` ## Changes Made ### GeneralPage.xaml (7 controls) - Language selection ComboBox - Color mode/theme ComboBox - Run at startup ToggleSwitch - Show system tray icon ToggleSwitch - Enable experimentation ToggleSwitch - Enable data diagnostics ToggleSwitch - Enable view diagnostic data ToggleSwitch ### PowerLauncherPage.xaml (4 data templates) - ComboBoxTemplate - for plugin settings - NumberBoxTemplate - for plugin numeric settings - CheckBoxComboBoxTemplate - for conditional ComboBox settings - CheckBoxNumberBoxTemplate - for conditional NumberBox settings ### PowerRenamePage.xaml (6 controls) - Enable PowerRename ToggleSwitch - Context menu mode ComboBox - Enable auto-complete ToggleSwitch - Max display list number NumberBox - Restore flags on launch ToggleSwitch - Use Boost library ToggleSwitch ### NewPlusPage.xaml (4 controls) - Enable New+ ToggleSwitch - Hide file extension ToggleSwitch - Hide starting digits ToggleSwitch - Replace variables ToggleSwitch ## Testing Screen readers (Windows Narrator) now properly announce controls with context: - **Before**: "Combo box" - **After**: "Language, Combo box" No functional changes to application behavior. The fix only affects how controls are announced to assistive technologies. ## Notes This fix follows the existing pattern already used in ColorPickerPage.xaml. Similar issues exist in approximately 23 other Settings pages which can be addressed in future PRs using this established pattern. The pages fixed in this PR represent commonly-accessed settings and demonstrate the solution approach for comprehensive coverage. Closes #<issue_number> ## References - WCAG 2.2 SC 1.3.1: https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships - UIA Name Property: https://learn.microsoft.com/en-us/windows/apps/design/accessibility/accessible-text-requirements#name_property_alternative_and_description <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Controls Inside Sections Are Not Associated with Their Labels.</issue_title> > <issue_description>### Microsoft PowerToys version > > v0.94.2 > > ### Installation method > > PowerToys auto-update > > ### Area(s) with issue? > > New+ > > ### Steps to reproduce > > **Repro Steps:** > > 1. Open the Power Toys. > 2. Now navigate to the home present in the left navigation pane. > 3. Now turn on the narrator using CTRL + Win + Enter. > 4. Now navigate to the controls present inside the different sections. > 5. Observe the issue. > > ### ✔️ Expected Behavior > > Each control should be programmatically associated with its corresponding label so screen readers can accurately convey the purpose of the control to users. > > ### ❌ Actual Behavior > > Input controls (e.g., checkboxes, text fields, dropdowns) located within different sections of the UI are not programmatically associated with their visible labels. > > ### Additional Information > > **User Impact:** > Screen reader users may hear only the control type (e.g., “edit text”) with no context or description of what it is for. This makes it difficult or impossible for them to fill out forms or interact with the UI correctly, leading to confusion and frustration. > > **WCAG Reference:** > https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships > > **Attachments:** > > https://github.com/user-attachments/assets/d25b9237-bee7-41d5-b564-df15df19b0d4 > > ### Other Software > > _No response_</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> Fixes microsoft/PowerToys#42419 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/PowerToys/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:50:49 +08:00
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=NewPlusEnableToggle, Path=Header}"
IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
<controls:SettingsGroup x:Uid="NewPlus_Templates" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsCard
Setting search (#41285) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: #xxx - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Localized search: <img width="1576" height="480" alt="image" src="https://github.com/user-attachments/assets/dd6e5e9f-419b-40b1-b796-f0799481ecfc" /> ## AI summary This pull request introduces infrastructure and code to support search functionality for PowerToys settings, including a new search index specification, a dedicated search library, and updates to the solution configuration. The main changes are the addition of a spec describing how settings should be indexed and navigated, the creation of a new `Common.Search` project with a fuzz search implementation, and updates to the solution file to include these new components. **Settings Search Feature Implementation** * Documentation: * Added a detailed specification (`settings-search.md`) describing the structure of PowerToys settings pages, how to index settings, navigation logic, runtime search, result grouping, build-time indexing strategy, and corner cases. * New Search Library: * Added the new `Common.Search` project to the solution, including its project file and implementation of a fuzz search service (`FuzzSearchService<T>`), match options, match results, and search precision scoring. [[1]](diffhunk://#diff-ddc06fa41e4e723e54181b0cb85cdd00f57f75725d51ceefa242d4d651a9a363R1-R8) [[2]](diffhunk://#diff-1a2ca29fc33bcccf338a7843a040ca2c31ba821e8cab7064fab0dbb1224d454cR1-R39) [[3]](diffhunk://#diff-242764d948b795f39653a84d9b6bfcdc52730100deab2e3a0995be95bb8e7868R1-R10) [[4]](diffhunk://#diff-61e525491ed916ebd65dabb66dd4f5dc720320d7e295ef1e0bd6d506ea0f7df6R1-R67) [[5]](diffhunk://#diff-a775f6de2e8d42982829b4161668f49dedbbd9dcbb05ce20003de7e62275c57aR1-R12) * Solution Configuration: * Updated `PowerToys.sln` to include `Common.Search` and `Settings.UI.XamlIndexBuilder` projects, and configured their build settings for various platforms and mapped project dependencies. [[1]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R714-R716) [[2]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2704-R2727) [[3]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2889) [[4]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R3157-R3158) **Spell-check Dictionary Updates** * Added new terms related to navigation and settings UI components (such as `Navigatable`, `NavigatablePage`, `settingscard`, `Tru`, `tweakable`) to the spell-check dictionary to support the new search and indexing features. [[1]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1020-R1021) [[2]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1498) [[3]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1755-R1761) --------- Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-08-25 21:23:07 +08:00
Name="NewPlusTemplatesLocation"
x:Uid="NewPlus_Templates_Location"
ActionIcon="{ui:FontIcon Glyph=&#xE8A7;}"
Command="{x:Bind ViewModel.OpenCurrentNewTemplateFolder}"
HeaderIcon="{ui:FontIcon Glyph=&#xF12B;}"
IsClickEnabled="True">
<Button
x:Uid="NewPlus_Templates_Location_Change"
Command="{x:Bind ViewModel.PickAnotherNewTemplateFolder}"
Style="{ThemeResource AccentButtonStyle}" />
<tkcontrols:SettingsCard.Description>
<StackPanel>
<TextBlock Text="{x:Bind ViewModel.TemplateLocation, Mode=OneWay}" />
<HyperlinkButton x:Uid="NewPlus_Templates_Location_Learn_More" NavigateUri="https://aka.ms/PowerToysOverview_NewPlus_TemplatesLocation" />
</StackPanel>
</tkcontrols:SettingsCard.Description>
</tkcontrols:SettingsCard>
<InfoBar
x:Uid="NewPlus_TemplatesNotBackupAndRestoreWarning"
IsClosable="False"
IsOpen="{x:Bind ViewModel.IsEnabled, Mode=OneWay}"
IsTabStop="{x:Bind ViewModel.IsEnabled, Mode=OneWay}"
Severity="Informational" />
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="NewPlus_Display_Options" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
<controls:GPOInfoControl ShowWarning="{x:Bind ViewModel.IsHideFileExtSettingGPOConfigured, Mode=OneWay}">
<tkcontrols:SettingsCard
Name="NewPlusHideFileExtensionToggle"
x:Uid="NewPlus_Hide_File_Extension_Toggle"
IsEnabled="{x:Bind ViewModel.IsHideFileExtSettingsCardEnabled, Mode=OneWay}">
Fix accessibility: Associate controls with labels for screen readers (#42439) ## Problem Input controls (ComboBoxes, ToggleSwitches, NumberBoxes) within SettingsCards throughout the PowerToys Settings UI were not programmatically associated with their visible labels. This caused screen readers to announce only the control type (e.g., "combo box", "toggle switch") without any context about the control's purpose, making the settings inaccessible to screen reader users. This violates WCAG 2.2 Success Criterion 1.3.1 (Info and Relationships) - Level A requirement. **User Impact**: Screen reader users navigating PowerToys settings would hear only "edit text" or "combo box" with no description, making it difficult or impossible to configure settings independently. ## Solution Added `AutomationProperties.Name` bindings to controls, linking them to their parent SettingsCard's `Header` property. This establishes the programmatic relationship between labels and controls required by assistive technologies. ### Pattern Applied For controls inside SettingsCards with a `Name` attribute: ```xaml <tkcontrols:SettingsCard Name="LanguageHeader" x:Uid="LanguageHeader"> <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" AutomationProperties.Name="{Binding ElementName=LanguageHeader, Path=Header}" DisplayMemberPath="Language" ItemsSource="{Binding Languages, Mode=TwoWay}" SelectedIndex="{Binding LanguagesIndex, Mode=TwoWay}" /> </tkcontrols:SettingsCard> ``` For data templates where headers are data-bound: ```xaml <DataTemplate x:Key="ComboBoxTemplate" x:DataType="viewModels:PluginAdditionalOptionViewModel"> <tkcontrols:SettingsCard Header="{x:Bind Path=DisplayLabel}"> <ComboBox AutomationProperties.Name="{x:Bind Path=DisplayLabel}" ItemsSource="{x:Bind Path=ComboBoxItems}" /> </tkcontrols:SettingsCard> </DataTemplate> ``` ## Changes Made ### GeneralPage.xaml (7 controls) - Language selection ComboBox - Color mode/theme ComboBox - Run at startup ToggleSwitch - Show system tray icon ToggleSwitch - Enable experimentation ToggleSwitch - Enable data diagnostics ToggleSwitch - Enable view diagnostic data ToggleSwitch ### PowerLauncherPage.xaml (4 data templates) - ComboBoxTemplate - for plugin settings - NumberBoxTemplate - for plugin numeric settings - CheckBoxComboBoxTemplate - for conditional ComboBox settings - CheckBoxNumberBoxTemplate - for conditional NumberBox settings ### PowerRenamePage.xaml (6 controls) - Enable PowerRename ToggleSwitch - Context menu mode ComboBox - Enable auto-complete ToggleSwitch - Max display list number NumberBox - Restore flags on launch ToggleSwitch - Use Boost library ToggleSwitch ### NewPlusPage.xaml (4 controls) - Enable New+ ToggleSwitch - Hide file extension ToggleSwitch - Hide starting digits ToggleSwitch - Replace variables ToggleSwitch ## Testing Screen readers (Windows Narrator) now properly announce controls with context: - **Before**: "Combo box" - **After**: "Language, Combo box" No functional changes to application behavior. The fix only affects how controls are announced to assistive technologies. ## Notes This fix follows the existing pattern already used in ColorPickerPage.xaml. Similar issues exist in approximately 23 other Settings pages which can be addressed in future PRs using this established pattern. The pages fixed in this PR represent commonly-accessed settings and demonstrate the solution approach for comprehensive coverage. Closes #<issue_number> ## References - WCAG 2.2 SC 1.3.1: https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships - UIA Name Property: https://learn.microsoft.com/en-us/windows/apps/design/accessibility/accessible-text-requirements#name_property_alternative_and_description <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Controls Inside Sections Are Not Associated with Their Labels.</issue_title> > <issue_description>### Microsoft PowerToys version > > v0.94.2 > > ### Installation method > > PowerToys auto-update > > ### Area(s) with issue? > > New+ > > ### Steps to reproduce > > **Repro Steps:** > > 1. Open the Power Toys. > 2. Now navigate to the home present in the left navigation pane. > 3. Now turn on the narrator using CTRL + Win + Enter. > 4. Now navigate to the controls present inside the different sections. > 5. Observe the issue. > > ### ✔️ Expected Behavior > > Each control should be programmatically associated with its corresponding label so screen readers can accurately convey the purpose of the control to users. > > ### ❌ Actual Behavior > > Input controls (e.g., checkboxes, text fields, dropdowns) located within different sections of the UI are not programmatically associated with their visible labels. > > ### Additional Information > > **User Impact:** > Screen reader users may hear only the control type (e.g., “edit text”) with no context or description of what it is for. This makes it difficult or impossible for them to fill out forms or interact with the UI correctly, leading to confusion and frustration. > > **WCAG Reference:** > https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships > > **Attachments:** > > https://github.com/user-attachments/assets/d25b9237-bee7-41d5-b564-df15df19b0d4 > > ### Other Software > > _No response_</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> Fixes microsoft/PowerToys#42419 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/PowerToys/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:50:49 +08:00
<ToggleSwitch
x:Uid="HideFileExtensionToggle"
AutomationProperties.Name="{Binding ElementName=NewPlusHideFileExtensionToggle, Path=Header}"
IsOn="{x:Bind ViewModel.HideFileExtension, Mode=TwoWay}" />
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
Setting search (#41285) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: #xxx - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Localized search: <img width="1576" height="480" alt="image" src="https://github.com/user-attachments/assets/dd6e5e9f-419b-40b1-b796-f0799481ecfc" /> ## AI summary This pull request introduces infrastructure and code to support search functionality for PowerToys settings, including a new search index specification, a dedicated search library, and updates to the solution configuration. The main changes are the addition of a spec describing how settings should be indexed and navigated, the creation of a new `Common.Search` project with a fuzz search implementation, and updates to the solution file to include these new components. **Settings Search Feature Implementation** * Documentation: * Added a detailed specification (`settings-search.md`) describing the structure of PowerToys settings pages, how to index settings, navigation logic, runtime search, result grouping, build-time indexing strategy, and corner cases. * New Search Library: * Added the new `Common.Search` project to the solution, including its project file and implementation of a fuzz search service (`FuzzSearchService<T>`), match options, match results, and search precision scoring. [[1]](diffhunk://#diff-ddc06fa41e4e723e54181b0cb85cdd00f57f75725d51ceefa242d4d651a9a363R1-R8) [[2]](diffhunk://#diff-1a2ca29fc33bcccf338a7843a040ca2c31ba821e8cab7064fab0dbb1224d454cR1-R39) [[3]](diffhunk://#diff-242764d948b795f39653a84d9b6bfcdc52730100deab2e3a0995be95bb8e7868R1-R10) [[4]](diffhunk://#diff-61e525491ed916ebd65dabb66dd4f5dc720320d7e295ef1e0bd6d506ea0f7df6R1-R67) [[5]](diffhunk://#diff-a775f6de2e8d42982829b4161668f49dedbbd9dcbb05ce20003de7e62275c57aR1-R12) * Solution Configuration: * Updated `PowerToys.sln` to include `Common.Search` and `Settings.UI.XamlIndexBuilder` projects, and configured their build settings for various platforms and mapped project dependencies. [[1]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R714-R716) [[2]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2704-R2727) [[3]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2889) [[4]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R3157-R3158) **Spell-check Dictionary Updates** * Added new terms related to navigation and settings UI components (such as `Navigatable`, `NavigatablePage`, `settingscard`, `Tru`, `tweakable`) to the spell-check dictionary to support the new search and indexing features. [[1]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1020-R1021) [[2]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1498) [[3]](diffhunk://#diff-5dcab162c1b233a49973ae010f2b88c7ec4844382abd705e6154685e62bd5c4dR1755-R1761) --------- Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-08-25 21:23:07 +08:00
<tkcontrols:SettingsCard Name="NewPlusHideStartingDigitsToggle" x:Uid="NewPlus_Hide_Starting_Digits_Toggle">
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
Fix accessibility: Associate controls with labels for screen readers (#42439) ## Problem Input controls (ComboBoxes, ToggleSwitches, NumberBoxes) within SettingsCards throughout the PowerToys Settings UI were not programmatically associated with their visible labels. This caused screen readers to announce only the control type (e.g., "combo box", "toggle switch") without any context about the control's purpose, making the settings inaccessible to screen reader users. This violates WCAG 2.2 Success Criterion 1.3.1 (Info and Relationships) - Level A requirement. **User Impact**: Screen reader users navigating PowerToys settings would hear only "edit text" or "combo box" with no description, making it difficult or impossible to configure settings independently. ## Solution Added `AutomationProperties.Name` bindings to controls, linking them to their parent SettingsCard's `Header` property. This establishes the programmatic relationship between labels and controls required by assistive technologies. ### Pattern Applied For controls inside SettingsCards with a `Name` attribute: ```xaml <tkcontrols:SettingsCard Name="LanguageHeader" x:Uid="LanguageHeader"> <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" AutomationProperties.Name="{Binding ElementName=LanguageHeader, Path=Header}" DisplayMemberPath="Language" ItemsSource="{Binding Languages, Mode=TwoWay}" SelectedIndex="{Binding LanguagesIndex, Mode=TwoWay}" /> </tkcontrols:SettingsCard> ``` For data templates where headers are data-bound: ```xaml <DataTemplate x:Key="ComboBoxTemplate" x:DataType="viewModels:PluginAdditionalOptionViewModel"> <tkcontrols:SettingsCard Header="{x:Bind Path=DisplayLabel}"> <ComboBox AutomationProperties.Name="{x:Bind Path=DisplayLabel}" ItemsSource="{x:Bind Path=ComboBoxItems}" /> </tkcontrols:SettingsCard> </DataTemplate> ``` ## Changes Made ### GeneralPage.xaml (7 controls) - Language selection ComboBox - Color mode/theme ComboBox - Run at startup ToggleSwitch - Show system tray icon ToggleSwitch - Enable experimentation ToggleSwitch - Enable data diagnostics ToggleSwitch - Enable view diagnostic data ToggleSwitch ### PowerLauncherPage.xaml (4 data templates) - ComboBoxTemplate - for plugin settings - NumberBoxTemplate - for plugin numeric settings - CheckBoxComboBoxTemplate - for conditional ComboBox settings - CheckBoxNumberBoxTemplate - for conditional NumberBox settings ### PowerRenamePage.xaml (6 controls) - Enable PowerRename ToggleSwitch - Context menu mode ComboBox - Enable auto-complete ToggleSwitch - Max display list number NumberBox - Restore flags on launch ToggleSwitch - Use Boost library ToggleSwitch ### NewPlusPage.xaml (4 controls) - Enable New+ ToggleSwitch - Hide file extension ToggleSwitch - Hide starting digits ToggleSwitch - Replace variables ToggleSwitch ## Testing Screen readers (Windows Narrator) now properly announce controls with context: - **Before**: "Combo box" - **After**: "Language, Combo box" No functional changes to application behavior. The fix only affects how controls are announced to assistive technologies. ## Notes This fix follows the existing pattern already used in ColorPickerPage.xaml. Similar issues exist in approximately 23 other Settings pages which can be addressed in future PRs using this established pattern. The pages fixed in this PR represent commonly-accessed settings and demonstrate the solution approach for comprehensive coverage. Closes #<issue_number> ## References - WCAG 2.2 SC 1.3.1: https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships - UIA Name Property: https://learn.microsoft.com/en-us/windows/apps/design/accessibility/accessible-text-requirements#name_property_alternative_and_description <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Controls Inside Sections Are Not Associated with Their Labels.</issue_title> > <issue_description>### Microsoft PowerToys version > > v0.94.2 > > ### Installation method > > PowerToys auto-update > > ### Area(s) with issue? > > New+ > > ### Steps to reproduce > > **Repro Steps:** > > 1. Open the Power Toys. > 2. Now navigate to the home present in the left navigation pane. > 3. Now turn on the narrator using CTRL + Win + Enter. > 4. Now navigate to the controls present inside the different sections. > 5. Observe the issue. > > ### ✔️ Expected Behavior > > Each control should be programmatically associated with its corresponding label so screen readers can accurately convey the purpose of the control to users. > > ### ❌ Actual Behavior > > Input controls (e.g., checkboxes, text fields, dropdowns) located within different sections of the UI are not programmatically associated with their visible labels. > > ### Additional Information > > **User Impact:** > Screen reader users may hear only the control type (e.g., “edit text”) with no context or description of what it is for. This makes it difficult or impossible for them to fill out forms or interact with the UI correctly, leading to confusion and frustration. > > **WCAG Reference:** > https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships > > **Attachments:** > > https://github.com/user-attachments/assets/d25b9237-bee7-41d5-b564-df15df19b0d4 > > ### Other Software > > _No response_</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> Fixes microsoft/PowerToys#42419 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/PowerToys/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:50:49 +08:00
<ToggleSwitch
x:Uid="HideStartingDigitsToggle"
AutomationProperties.Name="{Binding ElementName=NewPlusHideStartingDigitsToggle, Path=Header}"
IsOn="{x:Bind ViewModel.HideStartingDigits, Mode=TwoWay}" />
<tkcontrols:SettingsCard.Description>
<TextBlock x:Uid="NewPlus_Hide_Starting_Digits_Description" />
</tkcontrols:SettingsCard.Description>
</tkcontrols:SettingsCard>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="NewPlus_behavior" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
<controls:GPOInfoControl ShowWarning="{x:Bind ViewModel.IsReplaceVariablesSettingGPOConfigured, Mode=OneWay}">
<tkcontrols:SettingsCard
Name="NewPlusBehaviourReplaceVariablesToggle"
x:Uid="NewPlus_Behaviour_Replace_Variables_Toggle"
IsEnabled="{x:Bind ViewModel.IsReplaceVariablesSettingsCardEnabled, Mode=OneWay}">
<StackPanel Orientation="Horizontal" Spacing="4">
Fix accessibility: Associate controls with labels for screen readers (#42439) ## Problem Input controls (ComboBoxes, ToggleSwitches, NumberBoxes) within SettingsCards throughout the PowerToys Settings UI were not programmatically associated with their visible labels. This caused screen readers to announce only the control type (e.g., "combo box", "toggle switch") without any context about the control's purpose, making the settings inaccessible to screen reader users. This violates WCAG 2.2 Success Criterion 1.3.1 (Info and Relationships) - Level A requirement. **User Impact**: Screen reader users navigating PowerToys settings would hear only "edit text" or "combo box" with no description, making it difficult or impossible to configure settings independently. ## Solution Added `AutomationProperties.Name` bindings to controls, linking them to their parent SettingsCard's `Header` property. This establishes the programmatic relationship between labels and controls required by assistive technologies. ### Pattern Applied For controls inside SettingsCards with a `Name` attribute: ```xaml <tkcontrols:SettingsCard Name="LanguageHeader" x:Uid="LanguageHeader"> <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" AutomationProperties.Name="{Binding ElementName=LanguageHeader, Path=Header}" DisplayMemberPath="Language" ItemsSource="{Binding Languages, Mode=TwoWay}" SelectedIndex="{Binding LanguagesIndex, Mode=TwoWay}" /> </tkcontrols:SettingsCard> ``` For data templates where headers are data-bound: ```xaml <DataTemplate x:Key="ComboBoxTemplate" x:DataType="viewModels:PluginAdditionalOptionViewModel"> <tkcontrols:SettingsCard Header="{x:Bind Path=DisplayLabel}"> <ComboBox AutomationProperties.Name="{x:Bind Path=DisplayLabel}" ItemsSource="{x:Bind Path=ComboBoxItems}" /> </tkcontrols:SettingsCard> </DataTemplate> ``` ## Changes Made ### GeneralPage.xaml (7 controls) - Language selection ComboBox - Color mode/theme ComboBox - Run at startup ToggleSwitch - Show system tray icon ToggleSwitch - Enable experimentation ToggleSwitch - Enable data diagnostics ToggleSwitch - Enable view diagnostic data ToggleSwitch ### PowerLauncherPage.xaml (4 data templates) - ComboBoxTemplate - for plugin settings - NumberBoxTemplate - for plugin numeric settings - CheckBoxComboBoxTemplate - for conditional ComboBox settings - CheckBoxNumberBoxTemplate - for conditional NumberBox settings ### PowerRenamePage.xaml (6 controls) - Enable PowerRename ToggleSwitch - Context menu mode ComboBox - Enable auto-complete ToggleSwitch - Max display list number NumberBox - Restore flags on launch ToggleSwitch - Use Boost library ToggleSwitch ### NewPlusPage.xaml (4 controls) - Enable New+ ToggleSwitch - Hide file extension ToggleSwitch - Hide starting digits ToggleSwitch - Replace variables ToggleSwitch ## Testing Screen readers (Windows Narrator) now properly announce controls with context: - **Before**: "Combo box" - **After**: "Language, Combo box" No functional changes to application behavior. The fix only affects how controls are announced to assistive technologies. ## Notes This fix follows the existing pattern already used in ColorPickerPage.xaml. Similar issues exist in approximately 23 other Settings pages which can be addressed in future PRs using this established pattern. The pages fixed in this PR represent commonly-accessed settings and demonstrate the solution approach for comprehensive coverage. Closes #<issue_number> ## References - WCAG 2.2 SC 1.3.1: https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships - UIA Name Property: https://learn.microsoft.com/en-us/windows/apps/design/accessibility/accessible-text-requirements#name_property_alternative_and_description <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Controls Inside Sections Are Not Associated with Their Labels.</issue_title> > <issue_description>### Microsoft PowerToys version > > v0.94.2 > > ### Installation method > > PowerToys auto-update > > ### Area(s) with issue? > > New+ > > ### Steps to reproduce > > **Repro Steps:** > > 1. Open the Power Toys. > 2. Now navigate to the home present in the left navigation pane. > 3. Now turn on the narrator using CTRL + Win + Enter. > 4. Now navigate to the controls present inside the different sections. > 5. Observe the issue. > > ### ✔️ Expected Behavior > > Each control should be programmatically associated with its corresponding label so screen readers can accurately convey the purpose of the control to users. > > ### ❌ Actual Behavior > > Input controls (e.g., checkboxes, text fields, dropdowns) located within different sections of the UI are not programmatically associated with their visible labels. > > ### Additional Information > > **User Impact:** > Screen reader users may hear only the control type (e.g., “edit text”) with no context or description of what it is for. This makes it difficult or impossible for them to fill out forms or interact with the UI correctly, leading to confusion and frustration. > > **WCAG Reference:** > https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships > > **Attachments:** > > https://github.com/user-attachments/assets/d25b9237-bee7-41d5-b564-df15df19b0d4 > > ### Other Software > > _No response_</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> Fixes microsoft/PowerToys#42419 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/PowerToys/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:50:49 +08:00
<ToggleSwitch
x:Uid="ReplaceVariablesToggle"
AutomationProperties.Name="{Binding ElementName=NewPlusBehaviourReplaceVariablesToggle, Path=Header}"
IsOn="{x:Bind ViewModel.ReplaceVariables, Mode=TwoWay}" />
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
<Button
x:Uid="FileCreationButton"
Width="28"
Height="40"
Margin="0,0,-4,0"
Padding="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Transparent"
BorderBrush="Transparent"
Content="&#xE946;"
FontFamily="{ThemeResource SymbolThemeFontFamily}">
<Button.Flyout>
<Flyout x:Name="VariableExamplesFlyout" ShouldConstrainToRootBounds="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="62" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="0"
Text="$YYYY" />
<TextBlock
Grid.Row="0"
Grid.Column="1"
Margin="0,0,0,5"
TextWrapping="Wrap"><Run x:Uid="NewPlus_Year_YYYY_Variable_Description" /></TextBlock>
<TextBlock
Grid.Row="1"
Grid.Column="0"
Text="$MM" />
<TextBlock
Grid.Row="1"
Grid.Column="1"
Margin="0,0,0,5"
TextWrapping="Wrap"><Run x:Uid="NewPlus_Month_MM_Variable_Description" /></TextBlock>
<TextBlock
Grid.Row="2"
Grid.Column="0"
Text="$DD" />
<TextBlock
Grid.Row="2"
Grid.Column="1"
Margin="0,0,0,5"
TextWrapping="Wrap"><Run x:Uid="NewPlus_Day_DD_Variable_Description" /></TextBlock>
<TextBlock
Grid.Row="3"
Grid.Column="0"
Text="$hh" />
<TextBlock
Grid.Row="3"
Grid.Column="1"
Margin="0,0,0,5"
TextWrapping="Wrap"><Run x:Uid="NewPlus_Hour_hh_Variable_Description" /></TextBlock>
<TextBlock
Grid.Row="4"
Grid.Column="0"
Text="$mm" />
<TextBlock
Grid.Row="4"
Grid.Column="1"
Margin="0,0,0,5"
TextWrapping="Wrap"><Run x:Uid="NewPlus_Minute_mm_Variable_Description" /></TextBlock>
<TextBlock
Grid.Row="5"
Grid.Column="0"
Text="$ss" />
<TextBlock
Grid.Row="5"
Grid.Column="1"
Margin="0,0,0,0"
TextWrapping="Wrap"><Run x:Uid="NewPlus_Second_ss_Variable_Description" /></TextBlock>
</Grid>
</Flyout>
</Button.Flyout>
</Button>
</StackPanel>
[Settings] Add GPO control (#40256) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Quality of (dev)life improvement: a dedicated control for showing the GPO-warning InfoBar. As a result, we no longer need to copy-and-paste the same InfoBar XAML all over the place, ensuring that things are consistent and easier to maintain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #40252 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com> Co-authored-by: Gordon Lam <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-09 10:48:02 +02:00
<tkcontrols:SettingsCard.Description>
<StackPanel>
<HyperlinkButton x:Uid="NewPlus_Behaviour_Replace_Variables_Learn_More" NavigateUri="https://aka.ms/PowerToysOverview_NewPlus" />
</StackPanel>
</tkcontrols:SettingsCard.Description>
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
</controls:SettingsGroup>
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink x:Uid="NewPlus_Learn_More" Link="https://aka.ms/PowerToysOverview_NewPlus" />
</controls:SettingsPageControl.PrimaryLinks>
<controls:SettingsPageControl.SecondaryLinks>
<controls:PageLink Link="https://www.linkedin.com/in/christian-gaardmark/" Text="Christian Gaardmark" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</helper:NavigablePage>