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

VS Code submenu contribution to editor/title and view/title not working correctly #12706

Closed
jcortell68 opened this issue Jul 12, 2023 · 0 comments · Fixed by #12814
Closed

VS Code submenu contribution to editor/title and view/title not working correctly #12706

jcortell68 opened this issue Jul 12, 2023 · 0 comments · Fixed by #12814
Assignees
Labels
vscode issues related to VSCode compatibility
Milestone

Comments

@jcortell68
Copy link
Contributor

jcortell68 commented Jul 12, 2023

Bug Description:

I was testing support for contributing a submenu via a VS Code extension. It works as expected in all the locations I tried but two:

  • "editor/title"
  • "view/title"

The buggy behavior is identical in both. The following will refer to only "editor/title" for simplicity, though.

The submenu appears in "invisible" fashion. The submenu's icon (a pen) should appear in the editor title toolbar, as shown here in an equivalent VS Code sample:
image

In Theia, the submenu does in fact end up in the editor title toolbar, but without its icon (and without its label). And so it's effectively invisible. I.e., you can't see that it's there. If you hover the mouse over that area, you will see a tooltip pop up with the submenu's name. This hints that your mouse is over something you can't see. And sure enough, if you left click there, you will end up seeing the submenu.

image

But even with this "workaround" you still end up with undesirable behavior. Instead of being presented with the three submenu items (Larry, Curly and Moe), you see the submenu title and icon, and you have to click yet again to get to the submenu items.

This all works intuitively in VS Code. In Theia, the implementation is off.

Note that this might seem similar to issue 12686, since it's related to the same menu insertion point ("editor/title") and it's also involves an "invisible" menu contribution. But this is a different case and I don't think fixing one will fix the other. In that other ticket, the problem is that if a menu item lacks an icon, it's shown invisibly instead of with its title. That does not apply here. Here, the submenu is given an icon (in package.json) but it does not appear in the UI. And then as mentioned above, even if it did, there's a second issue at hand...the additional click that would be necessary to get to the submenu items.

Finally, note that the example below contributes the submenu to other locations as well and the behavior seems to be good there. I.e., if you right click in the editor body, you see this

image

Steps to Reproduce:

git clone -b menu_bug_5 https://github.com/jcortell68/theiasandbox
cd theiasandbox
yarn
yarn start:electron

In the launched Theia, initiate the Hello World command via the Command Palette, to ensure the VS Code extension is activated and the Tree View is populated. Not technically needed to see the problem reported here.

Additional Information

  • Operating System: Windows
  • Theia Version: 1.39
@jcortell68 jcortell68 changed the title VS Code submenu contribution to editor/title not working correctly VS Code submenu contribution to editor/title and view/title not working correctly Jul 13, 2023
@jfaltermeier jfaltermeier self-assigned this Jul 26, 2023
jfaltermeier added a commit that referenced this issue Jul 27, 2023
* add option RenderContextMenuOptions to ask renderer to no render a
menu with single submenu but to render the children instead
* add helper method to menu-model-registry to remove the parent nodes
from a menu node as described above
* adjust renderers and callers accordingly
jfaltermeier added a commit that referenced this issue Jul 27, 2023
@vince-fugnitto vince-fugnitto added the vscode issues related to VSCode compatibility label Jul 27, 2023
jfaltermeier added a commit that referenced this issue Aug 8, 2023
* add option RenderContextMenuOptions to ask renderer to no render a
menu with single submenu but to render the children instead
* add helper method to menu-model-registry to remove the parent nodes
from a menu node as described above
* adjust renderers and callers accordingly
jfaltermeier added a commit that referenced this issue Aug 8, 2023
jfaltermeier added a commit that referenced this issue Aug 8, 2023
* introduce option in RenderContextMenuOptions to ask renderer to not
render a menu with single submenu. Instead render only the children
* add helper method to menu-model-registry to remove the parent nodes
from a menu node as described above
* adjust renderers and callers accordingly
jfaltermeier added a commit that referenced this issue Aug 8, 2023
jfaltermeier added a commit that referenced this issue Aug 17, 2023
* introduce option in RenderContextMenuOptions to ask renderer to not
render a menu with single submenu. Instead render only the children
* add helper method to menu-model-registry to remove the parent nodes
from a menu node as described above
* adjust renderers and callers accordingly
jfaltermeier added a commit that referenced this issue Aug 17, 2023
jfaltermeier added a commit that referenced this issue Aug 17, 2023
* introduce option in RenderContextMenuOptions to ask renderer to not
render a menu with single submenu. Instead render only the children
* add helper method to menu-model-registry to remove the parent nodes
from a menu node as described above
* adjust renderers and callers accordingly
jfaltermeier added a commit that referenced this issue Aug 17, 2023
martin-fleck-at pushed a commit that referenced this issue Aug 21, 2023
#12814)

* introduce option in RenderContextMenuOptions to ask renderer to not
render a menu with single submenu. Instead render only the children
* add helper method to menu-model-registry to remove the parent nodes
from a menu node as described above
* adjust renderers and callers accordingly
@vince-fugnitto vince-fugnitto added this to the 1.41.0 milestone Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants