Skip to content

Commit ce4da75

Browse files
authored
layout - remove workbench.secondarySideBar.opensMaximized as it was working strangely (microsoft#252747)
1 parent ba90582 commit ce4da75

File tree

3 files changed

+14
-73
lines changed

3 files changed

+14
-73
lines changed

src/vs/platform/theme/electron-main/themeMainServiceImpl.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const THEME_WINDOW_SPLASH_KEY = 'windowSplash';
3232
const THEME_WINDOW_SPLASH_OVERRIDE_KEY = 'windowSplashWorkspaceOverride';
3333

3434
const AUXILIARYBAR_DEFAULT_VISIBILITY = 'workbench.secondarySideBar.defaultVisibility';
35-
const AUXILIARYBAR_OPEN_MAXIMIZED = 'workbench.secondarySideBar.opensMaximized';
3635

3736
namespace ThemeSettings {
3837
export const DETECT_COLOR_SCHEME = 'window.autoDetectColorScheme';
@@ -354,18 +353,6 @@ export class ThemeMainService extends Disposable implements IThemeMainService {
354353
auxiliaryBarWidth = 0; // technically not true if configured 'visible', but we never store splash per empty window, so we decide on a default here
355354
}
356355

357-
const auxiliaryBarOpenMaximized = this.configurationService.getValue(AUXILIARYBAR_OPEN_MAXIMIZED);
358-
switch (auxiliaryBarOpenMaximized) {
359-
case 'always':
360-
auxiliaryBarWidth = Number.MAX_SAFE_INTEGER; // marker for a maximised auxiliary bar
361-
break;
362-
case 'never':
363-
if (auxiliaryBarWidth === Number.MAX_SAFE_INTEGER) {
364-
auxiliaryBarWidth = ThemeMainService.DEFAULT_BAR_WIDTH; // reset marker for a maximized auxiliary bar if we never restore
365-
}
366-
break;
367-
}
368-
369356
return {
370357
...partSplash,
371358
layoutInfo: {

src/vs/workbench/browser/layout.ts

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
636636
this.stateModel = new LayoutStateModel(this.storageService, this.configurationService, this.contextService, coreExperimentationService);
637637
this.stateModel.load({
638638
mainContainerDimension: this._mainContainerDimension,
639-
auxiliaryBarOpensMaximized: () => this.auxiliaryBarOpensMaximized(), // deferred as function because this depends on state
640639
resetLayout: Boolean(this.layoutOptions?.resetLayout)
641640
});
642641

@@ -2126,13 +2125,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
21262125
return true;
21272126
}
21282127

2129-
private auxiliaryBarOpensMaximized(): boolean {
2130-
const auxiliaryBarOpensMaximized = partOpensMaximizedFromString(this.configurationService.getValue<string>(WorkbenchLayoutSettings.AUXILIARY_BAR_OPENS_MAXIMIZED));
2131-
const auxiliaryBarLastIsMaximized = this.stateModel.getRuntimeValue(LayoutStateKeys.AUXILIARYBAR_WAS_LAST_MAXIMIZED);
2132-
2133-
return auxiliaryBarOpensMaximized === PartOpensMaximizedOptions.ALWAYS || (auxiliaryBarOpensMaximized === PartOpensMaximizedOptions.REMEMBER_LAST && auxiliaryBarLastIsMaximized);
2134-
}
2135-
21362128
isPanelMaximized(): boolean {
21372129
return (
21382130
this.getPanelAlignment() === 'center' || // the workbench grid currently prevents us from supporting panel
@@ -2785,7 +2777,6 @@ enum WorkbenchLayoutSettings {
27852777
ACTIVITY_BAR_VISIBLE = 'workbench.activityBar.visible',
27862778
PANEL_POSITION = 'workbench.panel.defaultLocation',
27872779
PANEL_OPENS_MAXIMIZED = 'workbench.panel.opensMaximized',
2788-
AUXILIARY_BAR_OPENS_MAXIMIZED = 'workbench.secondarySideBar.opensMaximized',
27892780
ZEN_MODE_CONFIG = 'zenMode',
27902781
EDITOR_CENTERED_LAYOUT_AUTO_RESIZE = 'workbench.editor.centeredLayoutAutoResize',
27912782
}
@@ -2797,7 +2788,6 @@ enum LegacyWorkbenchLayoutSettings {
27972788

27982789
interface ILayoutStateLoadConfiguration {
27992790
readonly mainContainerDimension: IDimension;
2800-
readonly auxiliaryBarOpensMaximized: () => boolean;
28012791
readonly resetLayout: boolean;
28022792
}
28032793

@@ -2942,7 +2932,20 @@ class LayoutStateModel extends Disposable {
29422932
)
29432933
) {
29442934
if (experiment.value.experimentGroup === StartupExperimentGroup.MaximizedChat) {
2945-
this.applyAuxiliaryBarMaximizedOverride();
2935+
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY, {
2936+
sideBarVisible: !this.getRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN),
2937+
panelVisible: !this.getRuntimeValue(LayoutStateKeys.PANEL_HIDDEN),
2938+
editorVisible: !this.getRuntimeValue(LayoutStateKeys.EDITOR_HIDDEN),
2939+
auxiliaryBarVisible: !this.getRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN)
2940+
});
2941+
2942+
this.setRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN, true);
2943+
this.setRuntimeValue(LayoutStateKeys.PANEL_HIDDEN, true);
2944+
this.setRuntimeValue(LayoutStateKeys.EDITOR_HIDDEN, true);
2945+
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, false);
2946+
2947+
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE, this.getInitializationValue(LayoutStateKeys.AUXILIARYBAR_SIZE));
2948+
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_WAS_LAST_MAXIMIZED, true);
29462949
} else if (
29472950
experiment.value.experimentGroup === StartupExperimentGroup.SplitEmptyEditorChat ||
29482951
experiment.value.experimentGroup === StartupExperimentGroup.SplitWelcomeChat
@@ -2953,27 +2956,6 @@ class LayoutStateModel extends Disposable {
29532956
}
29542957
}
29552958

2956-
// Without experimental treatment
2957-
else {
2958-
2959-
// Override runtime values for auxiliary bar maximized state
2960-
const wasAuxiliaryBarMaximized = this.getRuntimeValue(LayoutStateKeys.AUXILIARYBAR_WAS_LAST_MAXIMIZED);
2961-
const auxiliaryBarOpensMaximized = configuration.auxiliaryBarOpensMaximized();
2962-
const state = this.getRuntimeValue(LayoutStateKeys.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY);
2963-
if (wasAuxiliaryBarMaximized && !auxiliaryBarOpensMaximized) {
2964-
this.setRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN, !state.sideBarVisible);
2965-
this.setRuntimeValue(LayoutStateKeys.PANEL_HIDDEN, !state.panelVisible);
2966-
this.setRuntimeValue(LayoutStateKeys.EDITOR_HIDDEN, !state.editorVisible);
2967-
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, !state.auxiliaryBarVisible);
2968-
2969-
this.setInitializationValue(LayoutStateKeys.AUXILIARYBAR_SIZE, this.getRuntimeValue(LayoutStateKeys.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE));
2970-
2971-
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_WAS_LAST_MAXIMIZED, false);
2972-
} else if (!wasAuxiliaryBarMaximized && auxiliaryBarOpensMaximized) {
2973-
this.applyAuxiliaryBarMaximizedOverride();
2974-
}
2975-
}
2976-
29772959
// Both editor and panel should not be hidden on startup unless auxiliary bar is maximized
29782960
if (
29792961
this.getRuntimeValue(LayoutStateKeys.PANEL_HIDDEN) &&
@@ -2984,23 +2966,6 @@ class LayoutStateModel extends Disposable {
29842966
}
29852967
}
29862968

2987-
private applyAuxiliaryBarMaximizedOverride(): void {
2988-
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY, {
2989-
sideBarVisible: !this.getRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN),
2990-
panelVisible: !this.getRuntimeValue(LayoutStateKeys.PANEL_HIDDEN),
2991-
editorVisible: !this.getRuntimeValue(LayoutStateKeys.EDITOR_HIDDEN),
2992-
auxiliaryBarVisible: !this.getRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN)
2993-
});
2994-
2995-
this.setRuntimeValue(LayoutStateKeys.SIDEBAR_HIDDEN, true);
2996-
this.setRuntimeValue(LayoutStateKeys.PANEL_HIDDEN, true);
2997-
this.setRuntimeValue(LayoutStateKeys.EDITOR_HIDDEN, true);
2998-
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, false);
2999-
3000-
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE, this.getInitializationValue(LayoutStateKeys.AUXILIARYBAR_SIZE));
3001-
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_WAS_LAST_MAXIMIZED, true);
3002-
}
3003-
30042969
save(workspace: boolean, global: boolean): void {
30052970
let key: keyof typeof LayoutStateKeys;
30062971

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -534,17 +534,6 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
534534
localize('workbench.panel.opensMaximized.preserve', "Open the panel to the state that it was in, before it was closed.")
535535
]
536536
},
537-
'workbench.secondarySideBar.opensMaximized': {
538-
'type': 'string',
539-
'enum': ['always', 'never', 'preserve'],
540-
'default': 'preserve',
541-
'description': localize('auxiliaryBarOpensMaximized', "Controls whether the secondary side bar opens maximized. It can either always open maximized, never open maximized, or open to the last state it was in before being closed."),
542-
'enumDescriptions': [
543-
localize('workbench.auxiliaryBar.opensMaximized.always', "Always maximize the secondary side bar when opening it."),
544-
localize('workbench.auxiliaryBar.opensMaximized.never', "Never maximize the secondary side bar when opening it."),
545-
localize('workbench.auxiliaryBar.opensMaximized.preserve', "Open the secondary side bar to the state that it was in, before it was closed.")
546-
]
547-
},
548537
'workbench.secondarySideBar.defaultVisibility': {
549538
'type': 'string',
550539
'enum': ['hidden', 'visibleInWorkspace', 'visibleInNewWorkspace', 'visible'],

0 commit comments

Comments
 (0)