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

Dynamically registered menus are ignored by the menu renderer #13719

Open
msujew opened this issue May 16, 2024 · 1 comment · May be fixed by #13720
Open

Dynamically registered menus are ignored by the menu renderer #13719

msujew opened this issue May 16, 2024 · 1 comment · May be fixed by #13720
Labels
menus issues related to the menu

Comments

@msujew
Copy link
Member

msujew commented May 16, 2024

Bug Description:

Discussed in #13716.

Registering a menu with a delay prevents that menu from showing up in the main application menu.

The issue is that the main menu is only recreated during startup and when the menu bar visibility changes. It doesn't listen on any other events.

Steps to Reproduce:

  1. Add a delay to the registerMenus method of any MenuContribution.
  2. Notice that the newly registered menu doesn't appear correctly
  3. Adjust the window.menuBarVisibility setting.
  4. The newly registered menu is now visible.

Additional Information

  • Operating System: Windows
  • Theia Version: 1.49.0
@msujew msujew added the menus issues related to the menu label May 16, 2024
@baoqing1124
Copy link

baoqing1124 commented May 17, 2024

setTimeout(() => {
menus.registerSubmenu(subSubMenuPath, 'Sample sub menu', { order: '2' });
menus.registerMenuAction(subSubMenuPath, {
commandId: SampleCommand2.id,
order: '3'
});
const visibility = this.preferenceService.get('window.menuBarVisibility');
this.preferenceService.updateValue('window.menuBarVisibility', visibility === 'classic' ? 'visible' : 'classic')
}, 5000);

@msujew Thanks for your help, I changed window.menuBarVisibility like this and it worked for me

@msujew msujew linked a pull request May 17, 2024 that will close this issue
1 task
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants