Skip to content

IDE2 is misusing Placeholder menu items for the disabled menus #1533

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

Closed
3 tasks done
kittaakos opened this issue Oct 5, 2022 · 0 comments · Fixed by #1750
Closed
3 tasks done

IDE2 is misusing Placeholder menu items for the disabled menus #1533

kittaakos opened this issue Oct 5, 2022 · 0 comments · Fixed by #1750
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@kittaakos
Copy link
Contributor

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:
Screen Shot 2022-10-05 at 16 28 05
Screen Shot 2022-10-05 at 16 28 18

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:
Screen Shot 2022-10-05 at 16 28 34
Screen Shot 2022-10-05 at 16 28 40

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 the isEnabled function of the handler, and update the electron menu with the MenuManager.

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

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@kittaakos kittaakos added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 5, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants