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

Support for updatable/async menus and submenus #149323

Open
testforstephen opened this issue May 12, 2022 · 8 comments
Open

Support for updatable/async menus and submenus #149323

testforstephen opened this issue May 12, 2022 · 8 comments
Assignees
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality menus Menu items and widget issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Milestone

Comments

@testforstephen
Copy link

In Java extension, we often receive feedback from users that refactoring and source action features are missing even though these features exist under these menus. We're thinking if there is a way to improve feature discovery for them.

Currently, users must click on the editor's context menu "Refactoring..." and "Source Action..." to display the supported options, which is not visible to new users. To improve visibility, one suggestion is whether VS Code could automatically expand their submenus when the cursor hovers over them.

image

@testforstephen testforstephen changed the title Should automatically expand submenus when hovering over context menus "Refactor..." and "Source Action..." More visibility for context menus "Refactor..." and "Source Action..." May 12, 2022
@jrieken
Copy link
Member

jrieken commented May 13, 2022

As of today we have no support for lazy menus. Those would be required because at the time of clicking "Refactor" we don't know what refactorings are available. We need to do an async IPC call for that and therefore cannot draw submenu.

We have a custom menu that could support this and I have seen this in native macOS app but I don't know if this is doable with electron. Forwarding to menu folks

@jrieken jrieken assigned deepak1556 and sbatten and unassigned jrieken May 13, 2022
@jrieken jrieken changed the title More visibility for context menus "Refactor..." and "Source Action..." Support for updatable/async menus and submenus May 13, 2022
@jrieken
Copy link
Member

jrieken commented May 13, 2022

Being able to update a menu while it shows should be enough. We would show "Loading..." and later update the menu in-place. I assume that's the min-requirement to get this working

@sbatten
Copy link
Member

sbatten commented May 16, 2022

I don't see anything on the electron side that would let us support this https://www.electronjs.org/docs/latest/api/menu-item

@deepak1556
Copy link
Collaborator

Upstream issue electron/electron#24724

@deepak1556 deepak1556 added the feature-request Request for new features or functionality label Dec 7, 2022
@jrieken jrieken added the menus Menu items and widget issues label Dec 7, 2022
@joyceerhl
Copy link
Contributor

@sbatten could we use Electron's menu.append(menuItem) API to support asynchronously adding menu items to a context menu that's already been drawn? https://www.electronjs.org/docs/latest/api/menu#menuappendmenuitem menu.insert(pos, menuItem) also seems promising for updating items which have changed.

@deepak1556
Copy link
Collaborator

@joyceerhl the menu append calls do not update the menu while being drawn the changes get reflected in subsequent draw calls, previously linked upstream issue is incorrect, the correct one is electron/electron#528

@deepak1556 deepak1556 added upstream Issue identified as 'upstream' component related (exists outside of VS Code) electron Issues and items related to Electron upstream-issue-linked This is an upstream issue that has been reported upstream labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality menus Menu items and widget issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

6 participants
@deepak1556 @jrieken @sbatten @testforstephen @joyceerhl and others