-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Submenu contribution to editor/title and view/title not working #12706 #12814
Conversation
@jonah-iden You mentioned yesterday that you miss some menus, is this maybe related? |
@JonasHelming thanks for the info, but the not notebook specific menus im missing are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me in general and as far as I can see, all the menus are showing their content as they do in VS Code, even if the location within the context menu sometimes varies a bit. So great work, Johannes!
The only issue I could detect was with the icon. For some reason, it does not show up for me. I looked a bit into this and the image resource is properly hosted and loaded so it seems more of a CSS thing. The CSS is applied in plugin-shared-style.ts
and I noticed that if I change the display
property from the default inline
to something else, the icon shows up. However, I'm not sure if this might have some side effects on other icons. Could you please have another look?
Thanks, I can reproduce it when I merge the current master into my branch. I think you mentioned that you've rebased before testing. Looks like #12827 causes the issue for my previous fix. The |
b93df92
to
d670fa8
Compare
* 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
d670fa8
to
e29f163
Compare
I've rebased and added a dedicated css entry that sets I also noticed an issue with the |
* fix icon * also skip virtual nodes
e29f163
to
647e0d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Johannes, thank you for the quick update! Everything looks good to me now, I just have a minor nitpick regarding private methods in classes that may be re-used by adopters. Please let me know what you think.
* review comments
Thanks for the review. I've made the methods protected, although I would prefer them to be private. I understand why you prefer it the other way, but those methods are only existing, because we use them as helper methods from one the the actual API methods to make the code nicer. If this implementation has to change at some point, we still have the burden of having those additional API methods that can't be removed/adapted without a major API break. So I'm not a fan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Johannes, everything looks good to me now!
What it does
The menu registered at the registry is correctly registered (Context menu > Sub Menu > Child Entries).
In this case the renderer should skip rendering the sub menu however.
The sub menu is represented by the toolbar button and its tooltip already.
So we just want to see the child entries in the context menu.
This PR introduces a helper method to adjust an existing menu-model to be rendered without a single root-submenu. Renderers may use this helper as required.
fixes #12706
How to test
See the reproducer on #12706
Review checklist
Reminder for reviewers