-
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
testing/profiles/context menu contribution #14028
testing/profiles/context menu contribution #14028
Conversation
fixes eclipse-theia#14013 contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
…l menu rather than inline
…es/context contributions
@rschnekenbu why is this a draft PR? |
Here's a couple of remarks:
On a more general level, our approach seems to be to have a single algorithm that can compute the tab bar for all widgets. I don't think this is a good approach: I suspect it would lead to much simpler code if widgets would control their own toolbar contents with the help of the contribution registry instead of the contribution registry controlling the widget toolbar. But that's just a general note. |
One of the problems with implementing this feature is that we use the |
- support multiple items with the same menu path, but different context - allow for items with both commands and menus - fixed menu rendering with native drop-downs - simplified typing around toolbar items Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Actually, that's not a problem: the "menuDelegate" just links a menu menu to a toolbar. The link is done via a "when" function. We can't link multiple conditions for showing the toolbar, but we can show the same menu as a submenu or a toolbar item. |
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.
Looks generally pretty good. I have just one minor suggestion, see below 👍
font-size: 8px; | ||
vertical-align: bottom; |
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.
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.
I was not trying to imitate VS Code visually, but to keep the "chevron at the bottom" look we had before while implementing the functionality of having both a command and a drop-down. Do you think the VS Code version looks better?
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.
I think looks better - also I was confused by the small size of the chevron - makes it a bit difficult to click on it, since the whole button is just a few pixel in widget.
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.
The changes look good to me. If the chevron CSS issue annoys me too much, I'll submit a PR for that myself :)
What it does
This Pull Request adds the support of the newly introduced menu contribution point 'testing/profiles/context'. This contribution point, despite being named 'context', is a contribution to the toolbar entries in the equivalent of the Test Explorer View... It was designed to get additional actions in the drop down menu of the tool bar items that runs Test, debug them or run them with Coverage.
I created a small sample extension for testing:
This kind of toolbar button with drop-down in Theia does not exist yet as far as I could see, so I implemented as:
testing.profile.context.group
value is not checked in the command.ActionMenuNode
, so the various values of the context key could be evaluated. This is the role of the third commit. However, I feel like I introduce a lot of code only to support a menu entry from VS code extensions. With this one, the test sample displays nicely the 4 available actions, but this seems like a workaround rather than a proper framework. Maybe the support of the drop down toolbar button may be a better contribution here.That is the reason why I introduced this PR with 3 different commits, representing the 3 different steps to implement from a lightweight version to a more complex one.
Fixes #14013
Contributed on behalf of STMicroelectronics
How to test
Install the provided extension sample, and go to the Test Explorer View.
Additional menu entries will come, depending on the commit selected:
Follow-ups
none yet.
Review checklist
Reminder for reviewers