Skip to content

Conversation

@benhillis
Copy link
Member

Implement keyboard focus management for SettingsExpander controls across settings pages. This resolves an accessibility issue reported internally.

Copilot AI review requested due to automatic review settings November 6, 2025 23:51
@benhillis benhillis requested a review from a team as a code owner November 6, 2025 23:51
@benhillis benhillis force-pushed the user/benhill/wslsettings_expand_item branch from 1e9f5b6 to 54bf02d Compare November 6, 2025 23:58
Copy link
Contributor

Copilot AI left a comment

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 implements automatic focus management for SettingsExpander controls across multiple settings pages and adds an Escape key handler for the OOBE window.

  • Adds new helper methods SetupSettingsExpanderFocusManagement and SetupExpanderFocusManagementByName to RuntimeHelper for managing focus when expanders are opened
  • Updates multiple settings pages (OptionalFeatures, Networking, MemAndProc, Developer, FileSystem) to automatically set focus to the first input field when a SettingsExpander is expanded
  • Adds Escape key handler to close the OOBE window
  • Removes trailing whitespace in LibWsl.cs

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/windows/wslsettings/Helpers/RuntimeHelper.cs Adds two new methods for automatic focus management on SettingsExpander controls: SetupSettingsExpanderFocusManagement and SetupExpanderFocusManagementByName
src/windows/wslsettings/Views/Settings/OptionalFeaturesPage.xaml.cs Adds OnPageLoaded handler to set up focus management for expanders (contains bug - references non-existent elements)
src/windows/wslsettings/Views/Settings/OptionalFeaturesPage.xaml Adds x:Name attributes to VMIdleTimeoutExpander and VMIdleTimeoutTextBox
src/windows/wslsettings/Views/Settings/NetworkingPage.xaml.cs Adds OnPageLoaded handler to set up focus management for IgnoredPorts and InitialAutoProxyTimeout expanders
src/windows/wslsettings/Views/Settings/NetworkingPage.xaml Adds x:Name attributes to expanders and textboxes for focus management
src/windows/wslsettings/Views/Settings/MemAndProcPage.xaml.cs Adds OnPageLoaded handler to set up focus management for 4 expanders (ProcCount, MemorySize, SwapSize, SwapFilePath)
src/windows/wslsettings/Views/Settings/MemAndProcPage.xaml Adds x:Name attributes to expanders and textboxes for focus management
src/windows/wslsettings/Views/Settings/FileSystemPage.xaml.cs Adds OnPageLoaded handler with explicit FindName and null checks for DefaultVHDSize expander focus management
src/windows/wslsettings/Views/Settings/FileSystemPage.xaml Adds x:Name attributes to DefaultVHDSizeExpander and DefaultVHDSizeTextBox
src/windows/wslsettings/Views/Settings/DeveloperPage.xaml.cs Adds OnPageLoaded handler to set up focus management for 3 kernel/distro path expanders
src/windows/wslsettings/Views/Settings/DeveloperPage.xaml Adds x:Name attributes to expanders and textboxes for focus management
src/windows/wslsettings/Views/OOBE/ShellPage.xaml.cs Adds Escape key accelerator and handler to close OOBE window
src/windows/wslsettings/LibWsl.cs Removes trailing whitespace from empty lines

@benhillis benhillis changed the title wslsettings: ensure selected setting is auto-selected wslsettings: ensure selected setting is auto-expanded and selected Nov 11, 2025
Implement keyboard focus management for SettingsExpander controls across settings pages. This resolves an accessibility issue reported internally.
@benhillis benhillis force-pushed the user/benhill/wslsettings_expand_item branch from 3b54ece to ebd2e8d Compare November 13, 2025 21:59
@benhillis benhillis merged commit 7226b05 into master Nov 18, 2025
6 checks passed
benhillis added a commit that referenced this pull request Nov 26, 2025
* wslsettings: allow OOBE window to close with escape key (#13686)

* wslsettings: allow OOBE windows to close with escape key

* fix memory leak

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Localization change from build: 133610492 (#13704)

Co-authored-by: WSL localization <noreply@microsoft.com>

* wslsettings: fix OOBE text truncation at 200% text scaling (#13693)

* wslsettings: fix OOBE text truncation at 200% text scaling

Add text scaling factor to window resize calculation and make hero image height responsive to text scaling. Increase minimum window size for better accessibility. Fix MAS 1.4.4 compliance for OOBE dialog.

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* wslsettings: add underlines to links in about page (#13703)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* .clang-format: add InsertBraces: true and minor fix to FormatSource.ps1 (#13712)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Localization change from build: 134015316 (#13731)

Co-authored-by: WSL localization <noreply@microsoft.com>

* wslsettings: ensure selected setting is auto-expanded and selected (#13689)

* wslsettings: ensure selected setting is auto-selected

Implement keyboard focus management for SettingsExpander controls across settings pages. This resolves an accessibility issue reported internally.

* add asserts

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* build: fix minor compiler errors when building with VS2026 (#13744)

* build: fix minor compiler errors when building with VS2026

* s

* use VS2022 for clang format and cross compiling

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* chore(distributions): Almalinux auto-update - 20251119 12:04:35 (#13743)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Mask systemd-networkd-wait-online.service during boot (#13611)

* deps: update a number of NuGet packages to the latest available versions (#13728)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Notice change from build: 134267142 (#13751)

Co-authored-by: WSL notice <noreply@microsoft.com>

* Add *.slnx to .gitignore (#13754)

* Fix service crash when collecting a linux crash dump when maxCrashDumpCount is set to 0 (#13755)

* Fix service crash when collecting a linux crash dump when maxCrashDumpCount is set to 0

* Move the check inside the function

* cleanup: VirtioNetworking refactoring (#13760)

* cleanup: update VirtioNetworking class to not rely on the WslCoreConfig struct

* cleanup: simplify VirtioNetworking construction

* remove old constructor and other cleanup

* more minor cleanup

* string cleanup in HandleVirtioModifyOpenPorts

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* cleanup: switch from Microsoft::WRL::ComPtr to wil::com_ptr (#13767)

* cleanup: switch from Microsoft::WRL::ComPtr to wil::com_ptr

* reformat

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* chore(distributions): Almalinux auto-update - 20251124 17:13:02 (#13780)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Notice change from build: 134527933 (#13782)

Co-authored-by: WSL notice <noreply@microsoft.com>

* cleanup: VirtioNetworking refactoring to be more portable (#13783)

* cleanup: VirtioNetworking refactoring to be more portable

* more refactoring

* make m_guestDeviceManager private

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Blue <OneBlue@users.noreply.github.com>
Co-authored-by: WSL localization <noreply@microsoft.com>
Co-authored-by: AlmaLinux Autobot <107999298+almalinuxautobot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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