-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feat preview color scheme on mouse hover #18518
Open
eleadufresne
wants to merge
10
commits into
microsoft:main
Choose a base branch
from
eleadufresne:feat-preview-color-scheme-on-mouse-hover
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat preview color scheme on mouse hover #18518
eleadufresne
wants to merge
10
commits into
microsoft:main
from
eleadufresne:feat-preview-color-scheme-on-mouse-hover
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I previously wrongly triggered pointer routed events when the mouse hovered the ListView object instead of its individual items.
@microsoft-github-policy-service agree |
I added a 10ms delay with a DispatcherTimer to debounce pointer exit events because the preview updates were clunky when quickly moving the pointer between ListViewItems.
carlos-zamora
approved these changes
Feb 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and feels great! Just the one comment before approving. Thanks for doing this!
carlos-zamora
requested changes
Feb 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(whoops, clicked the wrong button...)
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
Updated implementation to call PreviewAction on all command palette items instead of only submenu items, following PR feedback.
carlos-zamora
approved these changes
Feb 20, 2025
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
Area-CmdPal
Command Palette issues and features
Issue-Task
It's a feature request, but it doesn't really need a major design.
Product-Terminal
The new Windows Terminal.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Allow users to preview color schemes by hovering over them with the mouse pointer in the Command Palette.
References and Relevant Issues
UP
andDOWN
arrows to trigger a preview of color schemes in the Command Palette.Detailed Description of the Pull Request / Additional comments
This works by attaching event handlers for
PointerEntered
andPointerExited
toListViewItem
containers. When the mouse pointer moves into the item's bounding area, thePreviewAction
handler is triggered to showcase the hovered color scheme. Conversely, when the mouse pointer leaves the item's area, thePreviewAction
is executed on the selected item (generally from theUP
andDOWN
arrows).Decisions I made, but I'm uncertain about:
I coded my solution so thatPreviewAction
is called on the submenu items, as this is where the color schemes are located. I felt invoking the function for each element was unnecessary, but this approach may make it less flexible for future modifications.ListViewItem
changes, but there might be a better approach.Important note:
ActionPreviewHandler
handles, such as the background opacity of the terminal.Validation Steps Performed
ESC
at any point to dismiss the command palette, and the scheme returns to the previous one.PR Checklist