-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Implement search in Settings UI #19519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 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
| static const std::wstring_view globalAppearanceTag{ L"GlobalAppearance_Nav" }; | ||
|
|
||
| // Like RS_, but uses an ambient context to determine whether | ||
| // to load the English verion of a resource or the localized one. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| [Parameter(Mandatory=$false)][string]$OutputDir='D:\projects\terminal\src\cascadia\TerminalSettingsEditor\Generated Files\' | ||
| ) | ||
|
|
||
| # Prohibited UIDs (exact match, case-insensitive by default) |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| ) | ||
|
|
||
| # Prohibited UIDs (exact match, case-insensitive by default) | ||
| $ProhibitedUids = @( |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| } | ||
| elseif ($filename -eq 'Appearances.xaml') | ||
| { | ||
| # Apperances.xaml is a UserControl that is hosted in Profiles_Appearance.xaml |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| $uid = $matches[1] | ||
|
|
||
| # Skip entry if UID prohibited | ||
| if ($ProhibitedUids -contains $uid) |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| } | ||
| elseif ($pageClass -match 'Editor::Extensions') | ||
| { | ||
| # TODO CARLOS: There's actually no UIDs for extension view! But I want the page to still exist in the index at runtime for each extension. |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (3)Apperances To accept these unrecognized words as correct, you could run the following commands... in a clone of the git@github.com:microsoft/terminal.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.25/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/19054742436/attempts/1' &&
git commit -m 'Update check-spelling metadata'Warnings
|
| Count | |
|---|---|
| 1 |
See
✏️ Contributor please read this
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
- ... misspelled, then please correct them instead of using the command.
- ... names, please add them to
.github/actions/spelling/allow/names.txt. - ... APIs, you can add them to a file in
.github/actions/spelling/allow/. - ... just things you're using, please add them to an appropriate file in
.github/actions/spelling/expect/. - ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in
.github/actions/spelling/patterns/.
See the README.md in each directory for more information.
🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉
If the flagged items are 🤯 false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txtfile matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^refers to the file's path from the root of the repository, so^README\.md$would exclude README.md (on whichever branch you're using). -
well-formed pattern.
If you can write a pattern that would match it,
try adding it to thepatterns.txtfile.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.
Summary of the Pull Request
Adds search functionality to the settings UI. This is added to an
AutoSuggestBoxin the mainNavigationView. 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
x:Nameso that we can navigate to them and bring them into view.BringIntoViewWhenLoaded()which navigates to the relevant part of the UI. This is called inOnNavigatedTo()for each page.MainPage:_UpdateSearchIndex: loads the search index generated byGenerateSettingsIndex.ps1; provides additional localization, if neededSettingsSearchBox_TextChanged:_QuerySearchIndex()SettingsSearchBox_QuerySubmitted: extract the search index metadata and call the correct_Navigate()functionValidation Steps Performed
Search for...
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: