-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Port view container logic from activitybarpart to panelpart #87444
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
Conversation
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.
Approved given the provided comments are taken care of
@@ -448,6 +582,11 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService { | |||
this.storageService.store(PanelPart.PINNED_PANELS, value, StorageScope.GLOBAL); | |||
} | |||
|
|||
private getViewContainer(panelId: string): ViewContainer | undefined { | |||
const viewContainerRegistry = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry); | |||
return viewContainerRegistry.get(panelId); |
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.
Shall we have to look for the view container only in the Panel location? (even though ids are unique).
} | ||
|
||
private onPanelOpen(panel: IPanel): void { | ||
this.activePanelContextKey.set(panel.getId()); | ||
|
||
// This panel supports view containers | ||
if (panel instanceof PaneCompositePanel) { |
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 would check if view container exists/registered instead.
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 just checked activityBarPart and I think we do not need to have this check and we can do it for all panels.
this.compositeBar.activateComposite(panel.getId()); | ||
|
||
// This panel supports view containers | ||
if (panel instanceof PaneCompositePanel) { |
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.
Same as above. You can remove this check because you check for view container after
|
||
return cachedPanel?.views && cachedPanel.views.length | ||
? cachedPanel.views.every(({ when }) => !!when && !this.contextKeyService.contextMatchesRules(ContextKeyExpr.deserialize(when))) | ||
: panelId === TEST_VIEW_CONTAINER_ID /* Hide Test Panel for the first time or it had no views registered before */; |
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.
Checking with TEST_VIEW_CONTAINER_ID
is specific to Sidebar, so not sure if you need this here
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.
originally left this in if we didn't enforce unique ids across location and we chose to re-use the test container, removing.
Refs #85164
I can drop the outline contrib changes, they just make it easy to test.