-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Close active menubar dropdown when the command palette is launched #7136
Close active menubar dropdown when the command palette is launched #7136
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.
Thank you for your contribution @garethwhittaker!
I verified the changes when using the command palette and it successfully dismissed any opened menu. I'm wondering however if the change should be generalized to dismiss the menu whenever any quick-open
is called, for instance when performing a file-search (ctrlcmd+p).
For reference, VS Code also dismisses any opened menu in this case:
@vince-fugnitto yes, it does not make sense to dismiss it only for quick command, but for the quick palette in general. |
Thanks for the feedback. I've made an update to the pull request extending this logic to the launch of other quick palettes that could also overlay an active menu dropdown. |
packages/core/src/browser/quick-open/prefix-quick-open-service.ts
Outdated
Show resolved
Hide resolved
packages/core/src/browser/quick-open/prefix-quick-open-service.ts
Outdated
Show resolved
Hide resolved
Fixes: #6847 Signed-off-by: Gareth Whittaker <[email protected]>
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.
code-wise it looks good to me, it would help if someone verifies that it works in browser and does not break electron
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 verified the changes in the browser
and it works correctly.
I also tested for any regressions in the electron
example and could not find any.
@garethwhittaker
I tried the behavior for VS Code and can see that VS Code prevents to open the command palette if I have a menubar dropdown. I don't mind the current PR changes - it works good for me! |
That is the behavior I noticed from VS Code ( |
@vince-fugnitto Also I did not find the preference which could manage the behavior. Anyway I don't mind the current PR behavior, as I mentioned above. |
Different operating systems? Different ways how Electron integrates menu support for them? |
Looks like it's really related to operating systems. |
What it does
Fixes: #6847
The command palette currently overlaps an active menubar dropdown when launched via one of its keybindings.
Apart from this potentially being a less than ideal UX, toggles triggered through the command palette such as View: Toggle Minimap would not have their updated state reflected in the overlapped dropdown.
Closing the menubar dropdown on command palette launch avoids this complication.
** Update (12/02/20)
An active menubar dropdown should now be closed when launching any quick palette.
How to test
Open a menubar dropdown and then launch a quick palette via one a keybindings.
The menubar dropdown should now be closed rather than overlapped by the quick palette.
Keyboard focus should be on the quick palette input.
Review checklist
Reminder for reviewers