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

Fix Header Actions double rendering #88433

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/vs/workbench/browser/parts/views/viewPaneContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,25 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
const collapsed = this.viewsModel.isCollapsed(viewDescriptor.id);
return ({ viewDescriptor, index, size, collapsed });
});

let firstPane: string;
let singleView: boolean;
if (addedViews.length) {
this.onDidAddViews(addedViews);
firstPane = this.panes[0].id;
singleView = this.panes.length === 1;
}

// Update headers after and title contributed views after available, since we read from cache in the beginning to know if the viewlet has single view or not. Ref #29609
this.extensionService.whenInstalledExtensionsRegistered().then(() => {
this.areExtensionsReady = true;

// If we are rendering a single view that matches
// the cached version, this update is not necessary
if (this.panes.length === 1 && singleView && firstPane === this.panes[0].id) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should put 2nd sub-condition at 1st place? if initially we have more than 1 panes, we need to check that first to be able to quit from whole check as fast as possible

return;
}

if (this.panes.length) {
this.updateTitleArea();
this.updateViewHeaders();
Expand Down