IDE2 is misusing Placeholder menu items for the disabled menus #1533
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: enhancement
Proposed improvement
Describe the request
Every non-separator and non-group menu item in Theia is backed by a command. The menu item's enablement is defined by the handler of the command associated with the menu item. (See here). But, in Theia, there is no dynamic menu in the electron app (See here), so no matter if
isEnabled
false
, the menu item will always be enabled. (See here)The placeholder menu items were created only for IDE2 to allow adding additional "label" menus. Such as the followings:


The placeholder menu items are permanently disabled, as they're not backed by a command.
IDE2 started to misuse the placeholder label for disabled menu items. It's incorrect. To prove, make sure one of the following menu items are disabled and note that the keybinding is missing from the menu item:


Instead of using the placeholder solution and manually rebuilding the entire menu on disablement changes, IDE2 should customize the electron main menu factory, must not set the menu item enablement to
true
, rely on theisEnabled
function of the handler, and update the electron menu with theMenuManager
.Describe the current behavior
See the description. The expected bahevior is that the associated keybinding is visible for the menu even if the menu item itself is disabled
Arduino IDE version
61a11a0
Operating system
macOS
Operating system version
12.5.1
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: