-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Make cmd palette 'go back' button return to previously selected action #13504
Conversation
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.
I love it, thank you!
It feels pretty economical to search for the last active entry in the list of entries, and to rebuild the nested list like this. It would be good follow-up work to deduplicate the code that generates _currentNestedCommands
from a Command
, but I'm not going to ask you to do that now... unless you want bonus points[1]
[1] points don't matter, but i like to pretend they do
Thank you for the review. I agree that it would be better to deduplicate that fragment. I'll make sure to change it! |
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.
This is great, thanks for whipping this up!
const auto lastSelectedIndex = static_cast<int32_t>(std::distance(begin(_filteredActions), lastSelectedIt)); | ||
_scrollToIndex(lastSelectedIt != end(_filteredActions) ? lastSelectedIndex : 0); |
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.
this is clever, I love it
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
The behaviour of the 'go back' button in the command palette was changed to return to the previously selected element rather than the root.
Instead of returning to the root, the go back button now returns to the previously selected item in the filtered action list. The previously selected item is selected by default and the view is scoped to the item.
Validation Steps Performed
Manually tested by going back and forth between nested actions in the command palette.
Closes #13457