Skip to content

Conversation

@carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Nov 4, 2025

Summary of the Pull Request

Adds search functionality to the settings UI. This is added to an AutoSuggestBox in the main NavigationView. Invoking a result navigates to the proper location in the settings UI and focuses the setting, when possible.

References and Relevant Issues

Based on microsoft/PowerToys#41285

Detailed Description of the Pull Request / Additional comments

  • tools/GenerateSettingsIndex.ps1: parses all the XAML files in the settings UI for SettingsContainers and builds a search index from them
  • XAML changes: ensures all SettingContainer objects have an x:Name so that we can navigate to them and bring them into view.
  • TerminalSettingsEditor/Utils.h: implements BringIntoViewWhenLoaded() which navigates to the relevant part of the UI. This is called in OnNavigatedTo() for each page.
  • There's a few main components to searching, all of it is in MainPage:
    • _UpdateSearchIndex: loads the search index generated by GenerateSettingsIndex.ps1; provides additional localization, if needed
    • SettingsSearchBox_TextChanged:
      • detect that text changed in the search box
      • filter the search index using _QuerySearchIndex()
      • package the results into WinRT objects to then display in the UI
    • SettingsSearchBox_QuerySubmitted: extract the search index metadata and call the correct _Navigate() function

Validation Steps Performed

Search for...

  • settings that don't change at runtime:
    • global settings
    • settings in profile.defaults
    • "add new profile" page
  • settings that may change at runtime:
    • settings in a profile
    • individual color schemes
    • actions (only the main actions page, searching for actions is a separate thing)
    • new tab menu folders
    • extensions
  • misc. corner cases:
    • terminal chat (blocked in indexing script; requires minor changes in feature branch)
    • settings in appearance objects

PR Checklist

Closes #12949

Follow-ups

These are some additional features that may be added as a part of this PR or as a follow-up:

  • fuzzy search
  • search by JSON key

- SearchMetadata is unsused, but it is designed to hold information
   so that we can navigate to a setting
- Updated all pages to...
   - have an x:Name on relevant setting containers
   - have a NavigateToXArgs used in the OnNavigatedTo() function
   - update the NavigateToXArgs to include the name of an element
      to scroll down to
   - Add BringIntoViewWhenLoaded() to HasScrollViewer<T> which
      scrolls down to the element with a given name
These components aren't fully hooked up together yet and there's a
few TODO CARLOS's throughout. Main upcoming work:
- indexing
- runtime indexing
- search box UI
- search results UI
based on https://github.com/microsoft/PowerToys/blob/079c69b8beced55211485c352f41308426930e47/doc/specs/settings-search.md
- Adds referential XAML names to components of interest.
- Adds a script that generates the build time entries to be loaded
- Invokes the script in Editor.vcxproj
@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-SettingsUI Anything specific to the SUI Product-Terminal The new Windows Terminal. labels Nov 4, 2025
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

Why do we need multiple runtimeclass NavigateTo classes? Why not use one and it has an IInspectable navigate-to argument?

@github-actions

This comment has been minimized.

@carlos-zamora
Copy link
Member Author

Why do we need multiple runtimeclass NavigateTo classes? Why not use one and it has an IInspectable navigate-to argument?

Honestly, that's a good idea now that we need one of these for every page we navigate to. I'll add a TODO CARLOS and fix it in a later commit.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@carlos-zamora carlos-zamora marked this pull request as ready for review November 18, 2025 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-SettingsUI Anything specific to the SUI Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search bar for Settings UI

4 participants