Skip to content

Commit 523aff7

Browse files
authored
layout - more tweaks to chat initial visibility (microsoft#262145)
1 parent 8951f2c commit 523aff7

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/vs/workbench/browser/layout.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,6 +2852,7 @@ class LayoutStateModel extends Disposable {
28522852
// - revisit this when/if the default value of workbench.secondarySideBar.defaultVisibility changes
28532853
// - revisit this when Chat is available in serverless web
28542854
// - drop the need to probe for chat.setupContext
2855+
// - drop the need to probe for chat.hideAIFeatures
28552856
// - drop the need to probe for view location of workbench.panel.chat.view.copilot
28562857
const configuration = this.configurationService.inspect(WorkbenchLayoutSettings.AUXILIARYBAR_DEFAULT_VISIBILITY);
28572858
if (configuration.defaultValue !== 'hidden' && !isConfigured(configuration)) {
@@ -2860,7 +2861,7 @@ class LayoutStateModel extends Disposable {
28602861
}
28612862

28622863
const context = this.storageService.getObject<{ hidden?: boolean; disabled?: boolean; installed?: boolean }>('chat.setupContext', StorageScope.PROFILE);
2863-
if (context && ((context.installed && context.disabled) || (!context.installed && context.hidden))) {
2864+
if (context && ((context.installed && context.disabled) || (!context.installed && context.hidden) || (!context.installed && this.configurationService.getValue('chat.hideAIFeatures') === true))) {
28642865
return true; // Chat view is hidden by user choice
28652866
}
28662867

@@ -2870,6 +2871,12 @@ class LayoutStateModel extends Disposable {
28702871
}
28712872
}
28722873

2874+
// New users: Show auxiliary bar even in empty workspaces
2875+
if (this.storageService.isNew(StorageScope.APPLICATION)) {
2876+
return false;
2877+
}
2878+
2879+
// Existing users: respect visibility setting
28732880
switch (this.configurationService.getValue(WorkbenchLayoutSettings.AUXILIARYBAR_DEFAULT_VISIBILITY)) {
28742881
case 'maximized':
28752882
case 'visible':
@@ -2893,7 +2900,7 @@ class LayoutStateModel extends Disposable {
28932900
}
28942901

28952902
// Apply all overrides
2896-
this.applyOverrides(configuration);
2903+
this.applyOverrides();
28972904

28982905
// Register for runtime key changes
28992906
this._register(this.storageService.onDidChangeValue(StorageScope.PROFILE, undefined, this._store)(storageChangeEvent => {
@@ -2913,18 +2920,10 @@ class LayoutStateModel extends Disposable {
29132920
}));
29142921
}
29152922

2916-
private applyOverrides(configuration: ILayoutStateLoadConfiguration): void {
2917-
2918-
// Auxiliary bar: Showing for new users
2919-
if (
2920-
this.storageService.isNew(StorageScope.APPLICATION) &&
2921-
this.contextService.getWorkbenchState() === WorkbenchState.EMPTY
2922-
) {
2923-
this.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, false);
2924-
}
2923+
private applyOverrides(): void {
29252924

2926-
// Auxiliary bar: Based on setting for new workspaces
2927-
else if (this.isNew[StorageScope.WORKSPACE]) {
2925+
// Auxiliary bar: Maximized setting (new workspaces)
2926+
if (this.isNew[StorageScope.WORKSPACE]) {
29282927
const defaultAuxiliaryBarVisibility = this.configurationService.getValue(WorkbenchLayoutSettings.AUXILIARYBAR_DEFAULT_VISIBILITY);
29292928
if (
29302929
defaultAuxiliaryBarVisibility === 'maximized' ||

0 commit comments

Comments
 (0)