Skip to content
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

Merged
merged 1 commit into from
Feb 20, 2020
Merged

Close active menubar dropdown when the command palette is launched #7136

merged 1 commit into from
Feb 20, 2020

Conversation

garethwhittaker
Copy link
Contributor

@garethwhittaker garethwhittaker commented Feb 11, 2020

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

Copy link
Member

@vince-fugnitto vince-fugnitto left a 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).

Screen Shot 2020-02-11 at 9 18 13 PM

For reference, VS Code also dismisses any opened menu in this case:

@vince-fugnitto vince-fugnitto added menus issues related to the menu quick-open issues related to the quick-open labels Feb 12, 2020
@akosyakov
Copy link
Member

@vince-fugnitto yes, it does not make sense to dismiss it only for quick command, but for the quick palette in general.

@garethwhittaker
Copy link
Contributor Author

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.

Fixes: #6847

Signed-off-by: Gareth Whittaker <garethwhittaker@hotmail.com>
Copy link
Member

@akosyakov akosyakov left a 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

Copy link
Member

@vince-fugnitto vince-fugnitto left a 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.

@RomanNikitenko
Copy link
Contributor

@garethwhittaker
I tested it for browser - it works as described in the PR description, I don't see any regressions.

@vince-fugnitto

For reference, VS Code also dismisses any opened menu in this case

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.
So when I have a open menubar dropdown and I'm trying to use keybindings to open the command palette - nothing is happening.

I don't mind the current PR changes - it works good for me!
Just to be aware - because from your comment I see that we have the different behavior for VS Code.
Sorry, if I misunderstood something.

@vince-fugnitto
Copy link
Member

@RomanNikitenko

So when I have a open menubar dropdown and I'm trying to use keybindings to open the command palette - nothing is happening.

That is the behavior I noticed from VS Code (macOS). If a menu entry is open, triggering the command palette for instance, dismisses the menu.

a

@RomanNikitenko
Copy link
Contributor

@vince-fugnitto
It's interesting, I updated the version of VS Code, but still can see the same behavior
vs_code_behavior

Also I did not find the preference which could manage the behavior.
Maybe we have the difference because I tried on Ubuntu, but you use macOS.

Anyway I don't mind the current PR behavior, as I mentioned above.
thank you for the answer!

@akosyakov
Copy link
Member

Different operating systems? Different ways how Electron integrates menu support for them?

@RomanNikitenko
Copy link
Contributor

Different operating systems? Different ways how Electron integrates menu support for them?

Looks like it's really related to operating systems.
I can see the different behavior for 2 machines on Ubuntu vs 2 machines on macOS in our office

@akosyakov akosyakov merged commit 31dbbc1 into eclipse-theia:master Feb 20, 2020
@garethwhittaker garethwhittaker deleted the command-palette-overlays-menu branch February 20, 2020 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
menus issues related to the menu quick-open issues related to the quick-open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command palette overlaps the pull-down menus
4 participants