[PR #7977] Bold matching text in the command palette #27050

Open
opened 2026-01-31 09:19:41 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/7977

State: closed
Merged: Yes


Summary of the Pull Request

References

PR Checklist

  • Closes https://github.com/microsoft/terminal/issues/6646
  • CLA signed.
  • Tests added/passed - added UT for filter matching
  • Documentation updated - irrelevant
  • Schema updated - irrelevant
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

Please be gentle - didn't touch XAML and C++ for 8 years 👼

  • Created a ViewModel class in the Command Palette called FilteredCommand, aggregating the Command, the filter and the highlighted presentation of the command name
  • This ListView of the filtered commands is bound to the vector of FilteredCommands
  • Introduced HihglightedTextControl user control with HighlightedText view model
  • Added this control to the ListView Item's grid
  • Bound the FilteredCommand's highlighted command name to the user control

Validation Steps Performed

  • UT for matching algorithm
  • Only manual tests
  • Searching in CommandLine, SwitchTab and Nested Command modes
  • Checking for bot matching an non matching filters
  • Dogfooding 😄 like this
    SearchHighlightNoMouse
**Original Pull Request:** https://github.com/microsoft/terminal/pull/7977 **State:** closed **Merged:** Yes --- <!-- 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 <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes https://github.com/microsoft/terminal/issues/6646 * [x] CLA signed. * [x] Tests added/passed - added UT for filter matching * [ ] Documentation updated - irrelevant * [ ] Schema updated - irrelevant * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #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 Please be gentle - didn't touch XAML and C++ for 8 years 👼 * Created a ViewModel class in the Command Palette called FilteredCommand, aggregating the Command, the filter and the highlighted presentation of the command name * This ListView of the filtered commands is bound to the vector of FilteredCommands * Introduced HihglightedTextControl user control with HighlightedText view model * Added this control to the ListView Item's grid * Bound the FilteredCommand's highlighted command name to the user control <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed * UT for matching algorithm * Only manual tests * Searching in CommandLine, SwitchTab and Nested Command modes * Checking for bot matching an non matching filters * Dogfooding :smile: like this ![SearchHighlightNoMouse](https://user-images.githubusercontent.com/4639110/96619082-66cb4700-130e-11eb-9d1d-cb9877a2581d.gif)
claunia added the pull-request label 2026-01-31 09:19:41 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27050