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

[FEATURE] - Use new submenu support for editor commands #351

Closed
eamodio opened this issue Nov 10, 2020 · 5 comments · Fixed by #363
Closed

[FEATURE] - Use new submenu support for editor commands #351

eamodio opened this issue Nov 10, 2020 · 5 comments · Fixed by #363

Comments

@eamodio
Copy link

eamodio commented Nov 10, 2020

image

@alefragnani
Copy link
Owner

Hi @eamodio ,

Thanks for reporting. I was thinking about embracing this new API, right after it was made public. I just wonder how extensions, and VS Code itself, would deal with it. Would it simply update the extension to use submenus, or should give the user the possibility to choose the appearance, via settings?

Personally, I have mixed feelings. I like direct access to most used context menu items, but I don’t like looong context menus, neither multi-level (more than 2) in context menu.

Just out of curiosity, how are you dealing with GitLens, or VS Code itself. Are you simply moving it to submenus or providing settings ?

Thank you

@eamodio
Copy link
Author

eamodio commented Nov 11, 2020

I have updated GitLens (in the very soon to be released v11) to take advantage of submenus to considerably reduce the number of items shown -- and so far I've been really happy with the results (I've even used some menu options more than I have in the past). I haven't offered a choice in it (just whether the show the menu items/submenus themselves).

Yeah, its a trade off -- and I would definitely limit it to a single level of submenus (no submenus in submenus).

@alefragnani
Copy link
Owner

That's great!

Thank you for your feedback 👍

@alefragnani
Copy link
Owner

Hi @eamodio ,

I just started to work on this, but found an issue that maybe you faced while updating GitLens.

Today I have those entries in that Context Menu. These entries refers to the very main commands of the extension (available in the Command Palette), which as you can see, have keybindings attached. These keybindings are defined by the extension, btw. If the user changes these keybinding, these entries in the Context Menu are updated, as well.

But, If I move these entries to a new Bookmarks submenu, it appears too polluted which the now duplicated Bookmarks: prefix:

image

To solve this, I should contribute new commands, without the Bookmarks: prefix, and use these new commands, instead of the original ones. But now, these new Context Menu items does not show the keybindings (because in fact, they don't have). And I can't simply assign the same keybinding for this new commands, because if the user already customised the original commands, these new entries will be outdated, and new users will have to customize 2 times the same command.

The keybinding itself keeps working, because the original commands are still there, available in the Command Palette, but it feels something is missing, in the Context Menu. The user may think the commands lost/don't have a keybinding.

If I was able to define alternative title for commands, when attached in the Context Menu, I could simply remove the Bookmarks: prefix. Or, if I could make one command reuse the keybinding from another command, it could help too.

Am I missing something?

Thank you

@alefragnani alefragnani added this to the 12.1.0 milestone Nov 23, 2020
@eamodio
Copy link
Author

eamodio commented Dec 11, 2020

Sorry for the long delay in getting back to you here.

Since these menu items are now in a submenu labeled Bookmarks, you don't need the Bookmark: prefix, so you can just remove that prefix from the command title. And to keep the prefix in the command palette, add "category": "Bookmark", to each command -- that will "scope" them to that grouping in the command palette.

Hope that helps!

alefragnani added a commit that referenced this issue Dec 17, 2020
@alefragnani alefragnani modified the milestones: 12.1.0, December 2020 Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants