Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/vs/workbench/browser/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3050,7 +3050,18 @@ class LayoutStateModel extends Disposable {
}

private loadKeyFromStorage<T extends StorageKeyType>(key: WorkbenchLayoutStateKey<T>): T | undefined {
const value = this.storageService.get(`${LayoutStateModel.STORAGE_PREFIX}${key.name}`, key.scope);
let value = this.storageService.get(`${LayoutStateModel.STORAGE_PREFIX}${key.name}`, key.scope);

// TODO@bpasero remove this code in 1y when "pre-AI" workspaces have migrated
// Refs: https://github.com/microsoft/vscode-internalbacklog/issues/6168
if (
key.scope === StorageScope.WORKSPACE &&
key.name === LayoutStateKeys.AUXILIARYBAR_HIDDEN.name &&
typeof this.configurationService.getValue('workbench.secondarySideBar.defaultVisibilityMarker') === 'string' &&
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic string 'workbench.secondarySideBar.defaultVisibilityMarker' should be extracted as a constant. Consider adding it to the WorkbenchLayoutSettings enum (lines 2755-2762) for consistency with other configuration keys used in this class.

Copilot uses AI. Check for mistakes.
this.storageService.get(this.configurationService.getValue('workbench.secondarySideBar.defaultVisibilityMarker'), StorageScope.WORKSPACE) === undefined
) {
value = undefined;
Comment on lines +3059 to +3063
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration value workbench.secondarySideBar.defaultVisibilityMarker is retrieved twice using configurationService.getValue(). Consider storing it in a local variable to avoid redundant lookups.

Suggested change
key.name === LayoutStateKeys.AUXILIARYBAR_HIDDEN.name &&
typeof this.configurationService.getValue('workbench.secondarySideBar.defaultVisibilityMarker') === 'string' &&
this.storageService.get(this.configurationService.getValue('workbench.secondarySideBar.defaultVisibilityMarker'), StorageScope.WORKSPACE) === undefined
) {
value = undefined;
key.name === LayoutStateKeys.AUXILIARYBAR_HIDDEN.name
) {
const defaultVisibilityMarker = this.configurationService.getValue('workbench.secondarySideBar.defaultVisibilityMarker');
if (
typeof defaultVisibilityMarker === 'string' &&
this.storageService.get(defaultVisibilityMarker, StorageScope.WORKSPACE) === undefined
) {
value = undefined;
}

Copilot uses AI. Check for mistakes.
}

if (value !== undefined) {
this.isNew[key.scope] = false; // remember that we had previous state for this scope
Expand Down
8 changes: 8 additions & 0 deletions src/vs/workbench/browser/workbench.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,14 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
localize('workbench.secondarySideBar.defaultVisibility.maximized', "The secondary side bar is visible and maximized by default.")
]
},
'workbench.secondarySideBar.defaultVisibilityMarker': {
type: 'string',
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type property should be consistently quoted with single quotes to match the surrounding code style. All other properties in this file use single quotes around property names.

Suggested change
type: 'string',
'type': 'string',

Copilot uses AI. Check for mistakes.
'description': localize('secondarySideBarDefaultVisibilityMarker', "A marker of state to identify if default secondary sidebar setting applied in a workspace."),
tags: ['experimental'],
experiment: {
mode: 'auto'
}
},
'workbench.secondarySideBar.showLabels': {
'type': 'boolean',
'default': true,
Expand Down
Loading