Repository navigation
[Shortcut Guide] Add page-local search - #49639
Niels Laute (niels9001) merged 6 commits into
Conversation
Add title-bar filtering for the selected shortcut page, grouped no-results handling, and keyboard search interactions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8ffa76b-3cf0-4a67-9adb-a13c5dd9f125
There was a problem hiding this comment.
Pull request overview
Adds a page-local search experience to the Shortcut Guide overlay so users can filter shortcuts on the currently selected application page, including keyboard affordances (Ctrl+F, Escape-to-clear) and a no-results UI.
Changes:
- Introduces a title-bar
AutoSuggestBoxsearch field in the main pane, persists query across app-page switches, and integrates Escape/Ctrl+F behavior. - Implements per-page filtering in
ShortcutsPage(preserving existing section/grouping behavior) and shows a live-region “no results” state. - Adds a
ShortcutSearchMatcherhelper and unit tests, plus localized UIA name resources and dev-doc updates.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/ShortcutGuide/ShortcutGuide.UnitTests/SearchTests/ShortcutSearchMatcherTests.cs | Adds unit coverage for query matching across names/descriptions/modifiers/key labels. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/Strings/en-us/Resources.resw | Adds localized UIA name for the search box. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuideXAML/Pages/ShortcutsPage.xaml.cs | Implements filtering + no-results state for the selected app page. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuideXAML/Pages/ShortcutsPage.xaml | Adds an on-page no-results TextBlock live region. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuideXAML/OverlayWindow.xaml.cs | Updates Escape handling to clear search before closing the overlay. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuideXAML/Controls/MainPaneControl.xaml.cs | Wires search query changes into the current ShortcutsPage, adds Ctrl+F focus behavior, resets query on open/close. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuideXAML/Controls/MainPaneControl.xaml | Adds the title-bar AutoSuggestBox search UI and keyboard accelerator. |
| src/modules/ShortcutGuide/ShortcutGuide.Ui/Helpers/ShortcutSearchMatcher.cs | Adds the search matching logic used by page filtering. |
| doc/devdocs/modules/shortcut_guide.md | Documents the new search behavior and shortcuts. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a96c2c2-6954-4784-8257-e0de0fac15a7
Noraa Junker (noraa-junker)
left a comment
There was a problem hiding this comment.
LGTM
Apply the repository XamlStyler configuration to the search UI changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1f00def4-e790-4071-96c6-a81c9c2adba5
Treat whitespace-only queries as inactive, announce no-results updates, and ignore repeated Escape key-down events. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 76e284a6-9a03-4105-bae6-4ed7fc92042d
Muyuan Li (MuyuanMS)
left a comment
There was a problem hiding this comment.
These are two coordinated fixes. Please use Add suggestion to batch and commit the inline suggestions together, then make the two companion edits included in this review body. The companion files are outside the current PR diff, so GitHub cannot provide an Apply suggestion button for those two lines.
Reference the shared search project
Severity: high
The matcher above uses the repository's shared fuzzy-search implementation. In ShortcutGuide.Ui.csproj, add <ProjectReference Include="..\..\..\common\Common.Search\Common.Search.csproj" /> beside the existing Common.UI references. This file is outside the current PR diff, so GitHub cannot attach an Apply suggestion button.
Focus search after the overlay becomes visible
Severity: medium
In App.xaml.cs, immediately after OverlayWindow.MainPaneControl.Visibility = Visibility.Visible;, call OverlayWindow.MainPaneControl.FocusSearch();. Waiting until the pane is visible ensures programmatic focus succeeds. This file is outside the current PR diff, so GitHub cannot attach an Apply suggestion button.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## Summary of the Pull Request Adds an accessible search box to the Shortcut Guide title bar that filters shortcuts on the currently selected application page. The query matches shortcut names, descriptions, modifier names, and displayed key labels while preserving the existing pinned, recommended, category, and taskbar grouping. ## PR Checklist - [x] Closes: #48791 - [x] **Communication:** The UX and behavior were discussed before implementation - [x] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [x] **Dev docs:** Added/updated - [ ] **New binaries:** Not applicable - [ ] **Documentation updated:** Not applicable ## Detailed Description of the Pull Request / Additional comments - Adds a localized title-bar `AutoSuggestBox` with a find icon and UI Automation identity. - Filters only the selected app page using case-insensitive matching across names, descriptions, modifiers, virtual-key display names, and rendered special-key aliases. - Keeps only sections containing matches and shows a polite live-region no-results state with correct pane spacing. - Preserves the query when switching app pages, but clears it when Shortcut Guide closes. - Adds `Ctrl+F` to focus search; the first `Escape` clears a query and the next closes the overlay. - Keeps query text local to the UI with no logging or telemetry. Related issues: #48860 requests several broader navigation/readability changes; #49459 requests direct physical-key interception rather than text search. ## Screenshots ### Filter Windows shortcuts by displayed key label <img src="https://raw.githubusercontent.com/niels9001/PowerToys/pr-assets-shortcut-guide-search/.github/pr-assets/shortcut-guide-search/windows-alt-filter.png" width="667" alt="Shortcut Guide Windows page filtered by Alt" /> ### Keep the query while switching to the PowerToys page <img src="https://raw.githubusercontent.com/niels9001/PowerToys/pr-assets-shortcut-guide-search/.github/pr-assets/shortcut-guide-search/powertoys-opa-filter.png" width="660" alt="Shortcut Guide PowerToys page filtered by opa" /> ## Validation Steps Performed - Built `ShortcutGuide.Ui` for ARM64 Debug with the repository build scripts. - Built `ShortcutGuide.UnitTests` for ARM64 Debug and passed all 23 tests (16 search cases plus 7 existing tests) with `vstest.console.exe`. - Verified via UIA and guarded keyboard input that name/key-label filtering updates immediately, empty sections disappear, and no matches show the localized live-region state. - Verified the query persists when switching Windows to PowerToys, `Ctrl+F` focuses search, first `Escape` clears, second `Escape` closes, and reopening starts with an empty query. - Rebuilt after the final no-results accessibility and 16px top-margin adjustment. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8ffa76b-3cf0-4a67-9adb-a13c5dd9f125 Copilot-Session: 4a96c2c2-6954-4784-8257-e0de0fac15a7 Copilot-Session: 1f00def4-e790-4071-96c6-a81c9c2adba5 Copilot-Session: 76e284a6-9a03-4105-bae6-4ed7fc92042d Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
Summary of the Pull Request
Adds an accessible search box to the Shortcut Guide title bar that filters shortcuts on the currently selected application page.
The query matches shortcut names, descriptions, modifier names, and displayed key labels while preserving the existing pinned, recommended, category, and taskbar grouping.
PR Checklist
Detailed Description of the Pull Request / Additional comments
AutoSuggestBoxwith a find icon and UI Automation identity.Ctrl+Fto focus search; the firstEscapeclears a query and the next closes the overlay.Related issues: #48860 requests several broader navigation/readability changes; #49459 requests direct physical-key interception rather than text search.
Screenshots
Filter Windows shortcuts by displayed key label
Keep the query while switching to the PowerToys page
Validation Steps Performed
ShortcutGuide.Uifor ARM64 Debug with the repository build scripts.ShortcutGuide.UnitTestsfor ARM64 Debug and passed all 23 tests (16 search cases plus 7 existing tests) withvstest.console.exe.Ctrl+Ffocuses search, firstEscapeclears, secondEscapecloses, and reopening starts with an empty query.