Make cmd palette 'go back' button return to previously selected action#13504
Make cmd palette 'go back' button return to previously selected action#135042 commits merged intomicrosoft:mainfrom
Conversation
DHowett
left a comment
There was a problem hiding this comment.
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! |
zadjii-msft
left a comment
There was a problem hiding this comment.
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); |
|
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