Skip to content

Commit f16a8ea

Browse files
authored
Secondary sidebar visible by default in new workspace (fix microsoft#259496) (microsoft#261998)
1 parent 99ad9fa commit f16a8ea

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/vs/workbench/browser/layout.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,16 +2846,16 @@ class LayoutStateModel extends Disposable {
28462846
LayoutStateKeys.SIDEBAR_HIDDEN.defaultValue = workbenchState === WorkbenchState.EMPTY;
28472847
LayoutStateKeys.AUXILIARYBAR_SIZE.defaultValue = Math.min(300, mainContainerDimension.width / 4);
28482848
LayoutStateKeys.AUXILIARYBAR_HIDDEN.defaultValue = (() => {
2849-
2850-
// TODO@bpasero: lots of hacks here to not force open the auxiliary sidebar
2851-
// when no Chat view is present within:
2852-
// - revisit this when/if the default value of workbench.secondarySideBar.defaultVisibility changes
2853-
// - revisit this when Chat is available in serverless web
2854-
// - drop the need to probe for chat.setupContext
2855-
// - drop the need to probe for chat.hideAIFeatures
2856-
// - drop the need to probe for view location of workbench.panel.chat.view.copilot
28572849
const configuration = this.configurationService.inspect(WorkbenchLayoutSettings.AUXILIARYBAR_DEFAULT_VISIBILITY);
28582850
if (configuration.defaultValue !== 'hidden' && !isConfigured(configuration)) {
2851+
2852+
// TODO@bpasero: lots of hacks here to not force open the auxiliary sidebar
2853+
// when no Chat view is present within:
2854+
// - revisit this when Chat is available in serverless web
2855+
// - drop the need to probe for chat.setupContext
2856+
// - drop the need to probe for chat.hideAIFeatures
2857+
// - drop the need to probe for view location of workbench.panel.chat.view.copilot
2858+
28592859
if (isWeb && !this.environmentService.remoteAuthority) {
28602860
return true; // Chat view is not enabled
28612861
}
@@ -2872,20 +2872,23 @@ class LayoutStateModel extends Disposable {
28722872
}
28732873

28742874
// New users: Show auxiliary bar even in empty workspaces
2875-
if (this.storageService.isNew(StorageScope.APPLICATION)) {
2875+
// but not if the user explicitly hides it
2876+
if (
2877+
this.storageService.isNew(StorageScope.APPLICATION) &&
2878+
configuration.value !== 'hidden'
2879+
) {
28762880
return false;
28772881
}
28782882

28792883
// Existing users: respect visibility setting
2880-
switch (this.configurationService.getValue(WorkbenchLayoutSettings.AUXILIARYBAR_DEFAULT_VISIBILITY)) {
2881-
case 'maximized':
2882-
case 'visible':
2883-
return false;
2884+
switch (configuration.value) {
2885+
case 'hidden':
2886+
return true;
28842887
case 'visibleInWorkspace':
28852888
case 'maximizedInWorkspace':
28862889
return workbenchState === WorkbenchState.EMPTY;
28872890
default:
2888-
return true;
2891+
return false;
28892892
}
28902893
})();
28912894
LayoutStateKeys.PANEL_SIZE.defaultValue = (this.stateCache.get(LayoutStateKeys.PANEL_POSITION.name) ?? isHorizontal(LayoutStateKeys.PANEL_POSITION.defaultValue)) ? mainContainerDimension.height / 3 : mainContainerDimension.width / 4;

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,7 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
552552
'workbench.secondarySideBar.defaultVisibility': {
553553
'type': 'string',
554554
'enum': ['hidden', 'visibleInWorkspace', 'visible', 'maximizedInWorkspace', 'maximized'],
555-
'default': 'hidden',
556-
'experiment': {
557-
mode: 'startup'
558-
},
555+
'default': 'visibleInWorkspace',
559556
'description': localize('secondarySideBarDefaultVisibility', "Controls the default visibility of the secondary side bar in workspaces or empty windows opened for the first time."),
560557
'enumDescriptions': [
561558
localize('workbench.secondarySideBar.defaultVisibility.hidden', "The secondary side bar is hidden by default."),

0 commit comments

Comments
 (0)