Skip to content

Commit 28640a7

Browse files
authored
Opening secondary sidebar in new workspaces should skip web (fix microsoft#253363) (microsoft#253466)
1 parent 181bf86 commit 28640a7

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export class ThemeMainService extends Disposable implements IThemeMainService {
343343
} else if (auxiliaryBarVisible === false) {
344344
auxiliaryBarWidth = 0;
345345
} else {
346-
if (auxiliaryBarDefaultVisibility === 'visible' || auxiliaryBarDefaultVisibility === 'visibleInWorkspace' || auxiliaryBarDefaultVisibility === 'visibleInNewWorkspace') {
346+
if (auxiliaryBarDefaultVisibility === 'visible' || auxiliaryBarDefaultVisibility === 'visibleInWorkspace') {
347347
auxiliaryBarWidth = override.layoutInfo.auxiliaryBarWidth || partSplash.layoutInfo.auxiliaryBarWidth || ThemeMainService.DEFAULT_BAR_WIDTH;
348348
} else {
349349
auxiliaryBarWidth = 0;

src/vs/workbench/browser/layout.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
633633
private initLayoutState(lifecycleService: ILifecycleService, fileService: IFileService, coreExperimentationService: ICoreExperimentationService): void {
634634
this._mainContainerDimension = getClientArea(this.parent, DEFAULT_WINDOW_DIMENSIONS); // running with fallback to ensure no error is thrown (https://github.com/microsoft/vscode/issues/240242)
635635

636-
this.stateModel = new LayoutStateModel(this.storageService, this.configurationService, this.contextService, coreExperimentationService);
636+
this.stateModel = new LayoutStateModel(this.storageService, this.configurationService, this.contextService, coreExperimentationService, this.environmentService);
637637
this.stateModel.load({
638638
mainContainerDimension: this._mainContainerDimension,
639639
resetLayout: Boolean(this.layoutOptions?.resetLayout)
@@ -2804,7 +2804,8 @@ class LayoutStateModel extends Disposable {
28042804
private readonly storageService: IStorageService,
28052805
private readonly configurationService: IConfigurationService,
28062806
private readonly contextService: IWorkspaceContextService,
2807-
private readonly coreExperimentationService: ICoreExperimentationService
2807+
private readonly coreExperimentationService: ICoreExperimentationService,
2808+
private readonly environmentService: IBrowserWorkbenchEnvironmentService
28082809
) {
28092810
super();
28102811

@@ -2867,13 +2868,16 @@ class LayoutStateModel extends Disposable {
28672868
LayoutStateKeys.SIDEBAR_HIDDEN.defaultValue = workbenchState === WorkbenchState.EMPTY;
28682869
LayoutStateKeys.AUXILIARYBAR_SIZE.defaultValue = Math.min(300, mainContainerDimension.width / 4);
28692870
LayoutStateKeys.AUXILIARYBAR_HIDDEN.defaultValue = (() => {
2871+
const configuration = this.configurationService.inspect(WorkbenchLayoutSettings.AUXILIARYBAR_DEFAULT_VISIBILITY);
2872+
if (configuration.defaultValue !== 'hidden' && isWeb && !this.environmentService.remoteAuthority) {
2873+
return true; // TODO@bpasero revisit this when Chat is available in serverless web
2874+
}
2875+
28702876
switch (this.configurationService.getValue(WorkbenchLayoutSettings.AUXILIARYBAR_DEFAULT_VISIBILITY)) {
28712877
case 'visible':
28722878
return false;
28732879
case 'visibleInWorkspace':
28742880
return workbenchState === WorkbenchState.EMPTY;
2875-
case 'visibleInNewWorkspace':
2876-
return workbenchState === WorkbenchState.EMPTY || !this.storageService.isNew(StorageScope.WORKSPACE);
28772881
default:
28782882
return true;
28792883
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,14 +536,13 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
536536
},
537537
'workbench.secondarySideBar.defaultVisibility': {
538538
'type': 'string',
539-
'enum': ['hidden', 'visibleInWorkspace', 'visibleInNewWorkspace', 'visible'],
539+
'enum': ['hidden', 'visibleInWorkspace', 'visible'],
540540
'default': 'hidden',
541541
'tags': ['onExp'],
542542
'description': localize('secondarySideBarDefaultVisibility', "Controls the default visibility of the secondary side bar in workspaces or empty windows opened for the first time."),
543543
'enumDescriptions': [
544544
localize('workbench.secondarySideBar.defaultVisibility.hidden', "The secondary side bar is hidden by default."),
545545
localize('workbench.secondarySideBar.defaultVisibility.visibleInWorkspace', "The secondary side bar is visible by default if a workspace is opened."),
546-
localize('workbench.secondarySideBar.defaultVisibility.visibleInNewWorkspace', "The secondary side bar is visible by default if a new workspace is opened."),
547546
localize('workbench.secondarySideBar.defaultVisibility.visible', "The secondary side bar is visible by default.")
548547
]
549548
},

0 commit comments

Comments
 (0)