layout - reduce scope of workbench.secondarySideBar.forceMaximized to only apply when editors are closed (#291293)

* layout - reduce scope of `workbench.secondarySideBar.forceMaximized` to only apply when editors are closed

We later need to revisit how a better layout would be for focus on sessions, but the current implementation has too many bugs.

* Update src/vs/workbench/browser/workbench.contribution.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* .

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Benjamin Pasero
2026-01-28 16:01:49 +01:00
committed by GitHub
parent 7b0aa3bfa0
commit c721687d36
2 changed files with 2 additions and 11 deletions
+1 -10
View File
@@ -354,12 +354,10 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
}
};
// Maybe maximize auxiliary bar when no editors, sidebar hidden, and panel hidden
// Maybe maximize auxiliary bar when no editors are visible
const maybeMaximizeAuxiliaryBar = () => {
if (
this.mainPartEditorService.visibleEditors.length === 0 &&
!this.isVisible(Parts.SIDEBAR_PART) &&
!this.isVisible(Parts.PANEL_PART) &&
this.configurationService.getValue(WorkbenchLayoutSettings.AUXILIARYBAR_FORCE_MAXIMIZED) === true
) {
this.setAuxiliaryBarMaximized(true);
@@ -383,13 +381,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
}));
this._register(this.editorGroupService.mainPart.onDidActivateGroup(showEditorIfHidden));
// Maybe maximize auxiliary bar when sidebar or panel hides
this._register(this.onDidChangePartVisibility(({ partId, visible }) => {
if (!visible && (partId === Parts.SIDEBAR_PART || partId === Parts.PANEL_PART)) {
maybeMaximizeAuxiliaryBar();
}
}));
// Revalidate center layout when active editor changes: diff editor quits centered mode
this._register(this.mainPartEditorService.onDidActiveEditorChange(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
});
@@ -589,7 +589,7 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
'type': 'boolean',
'default': false,
tags: ['experimental'],
'description': localize('secondarySideBarForceMaximized', "Controls whether the secondary side bar is enforced to always show maximized unless other parts or editors are showing."),
'description': localize('secondarySideBarForceMaximized', "Controls whether the secondary side bar is enforced to always show maximized on startup and when there are no open editors, in layouts that support a maximized secondary side bar."),
},
'workbench.secondarySideBar.showLabels': {
'type': 'boolean',