-
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
#8966: Update ViewContainer
Toolbars
#8967
#8966: Update ViewContainer
Toolbars
#8967
Conversation
ViewContainer
Part ToolbarsViewContainer
Part Toolbars
ViewContainer
Part ToolbarsViewContainer
Part Toolbars
725f1f2
to
8f8170a
Compare
ViewContainer
Part ToolbarsViewContainer
Toolbars
8f8170a
to
725f1f2
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.
Approving only based on the code which LGTM.
@colin-grant-work is it possible to contribute such a toolbar item in the sample-apis? |
Yes, definitely. I can do that to make testing easier 👍 |
725f1f2
to
1187710
Compare
@marechal-p, I've finally gotten around to adding the demo for this to the sample API. I've put a new widget in the explorer area, and if you test with that commit on master, you'll see that the icons don't change until you move your cursor off of the widget, but with the new code from this branch, the icon changes when you click it or when you trigger the action via the button in the widget. One question adding that widget raises is whether there's a way to use the plugin contributions points within Theia? It seems like there isn't an easy way to say that a view should be added to e.g. the Explorer view container unless it's a plugin. |
b715c07
to
58bfb2f
Compare
Signed-off-by: Colin Grant <[email protected]>
Signed-off-by: Colin Grant <[email protected]>
58bfb2f
to
09af5d5
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.
The changes look good to me, I only have some very minor comments regarding formatting 👍
I confirmed (using the provided sample), that the toolbar item is visible when hovering the part, and that clicking either the toolbar item or the button will update the icon correctly. I also confirmed that on master
(rolling back view-container.ts
) the hovering does work for the same use-case, but clicking the toolbar item or the button will not update the toolbar.
"@theia/vsx-registry": "1.16.0", | ||
"@theia/workspace": "1.16.0" | ||
"@theia/workspace": "1.16.0", | ||
"@theia/navigator": "1.16.0", |
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.
minor: add @theia/navigator
in alphabetical order, when we perform a release lerna
will change the order anyways.
@@ -24,6 +24,7 @@ import { bindSampleFileWatching } from './file-watching/sample-file-watching-con | |||
import { bindVSXCommand } from './vsx/sample-vsx-command-contribution'; | |||
|
|||
import '../../src/browser/style/branding.css'; | |||
import { bindSampleViewContainerPart } from './view/sample-view-container-part-contribution'; |
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.
minor: add the import
with previous imports, we generally add the css import on it's own.
registry.registerCommand(CHANGE_TO_PLUS_COMMAND, | ||
{ |
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.
minor: syntax for consistency when registering commands (will auto-format correctly after save):
registry.registerCommand(CHANGE_TO_PLUS_COMMAND, | |
{ | |
registry.registerCommand(CHANGE_TO_PLUS_COMMAND, { |
Closing in favor of #9935, which improves the behavior further. |
Signed-off-by: Colin Grant [email protected]
What it does
Fixes #8966 by adding code to update a
ViewContainer
part toolbar when a change event is emitted by theTabbarToolbarRegistry
.How to test
Toolbar Part
didChange
event and should appear in aViewContainer
part (for example, one that is attached to part of the debug panel or one that is attached to the file explorer when a plugin contribution (e.g. NPM) is also present).didChange
event.ViewContainer
part toolbar.Review checklist
Reminder for reviewers