From 405cffcb55a05e359cc7fa22d344003c8d7ecdfc Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Thu, 13 Jan 2022 14:00:01 -0800 Subject: [PATCH] remove side panel setting --- .../browser/actions/layoutActions.ts | 6 ++-- src/vs/workbench/browser/layout.ts | 13 ++----- .../parts/auxiliarybar/auxiliaryBarActions.ts | 6 ++-- .../parts/auxiliarybar/auxiliaryBarPart.ts | 12 ++----- .../browser/workbench.contribution.ts | 6 ---- .../views/browser/viewDescriptorService.ts | 36 ------------------- 6 files changed, 9 insertions(+), 70 deletions(-) diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 52d885350c6..8115738f0ec 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -828,10 +828,10 @@ registerAction2(class extends Action2 { constructor() { super({ - id: 'workbench.action.swapPanelViews', + id: 'workbench.action.movePanelToSidePanel', title: { - value: localize('swapPanelViews', "Swap Panel View Containers"), - original: 'Swap Panel View Containers' + value: localize('movePanelToSidePanel', "Move Panel To Side Panel"), + original: 'Move Panel To Side Panel' }, category: CATEGORIES.View, f1: true, diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 6a7190fe728..f89ec024c86 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -49,7 +49,7 @@ import { getVirtualWorkspaceScheme } from 'vs/platform/remote/common/remoteHosts import { Schemas } from 'vs/base/common/network'; import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; import { ActivitybarPart } from 'vs/workbench/browser/parts/activitybar/activitybarPart'; -import { AuxiliaryBarPart, AUXILIARYBAR_ENABLED } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart'; +import { AuxiliaryBarPart } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { LayoutStateKeys, LayoutStateModel, WorkbenchLayoutSettings } from 'vs/workbench/browser/layoutState'; @@ -500,7 +500,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } // Auxiliary Panel to restore - if (this.configurationService.getValue(AUXILIARYBAR_ENABLED) && this.isVisible(Parts.AUXILIARYBAR_PART)) { + if (this.isVisible(Parts.AUXILIARYBAR_PART)) { let viewContainerToRestore = this.storageService.get(AuxiliaryBarPart.activePanelSettingsKey, StorageScope.WORKSPACE, this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id); if (viewContainerToRestore) { @@ -510,11 +510,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } } - // Hide Auxiliary Bar if disabled - if (!this.configurationService.getValue(AUXILIARYBAR_ENABLED)) { - this.stateModel.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, true); - } - // Window border this.updateWindowBorder(true); } @@ -1624,10 +1619,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } private setAuxiliaryBarHidden(hidden: boolean, skipLayout?: boolean): void { - if (!this.configurationService || !this.configurationService.getValue(AUXILIARYBAR_ENABLED)) { - return; - } - this.stateModel.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, hidden); // Adjust CSS diff --git a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts index 582f2b0abc3..b13222f2aaa 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts +++ b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts @@ -71,7 +71,6 @@ MenuRegistry.appendMenuItems([ title: localize({ key: 'miShowAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Show Si&&de Panel"), toggled: AuxiliaryBarVisibleContext }, - when: ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true), order: 4 } }, @@ -84,7 +83,6 @@ MenuRegistry.appendMenuItems([ title: localize({ key: 'miShowAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Show Si&&de Panel"), toggled: AuxiliaryBarVisibleContext }, - when: ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true), order: 5 } }, { @@ -102,5 +100,5 @@ MenuRegistry.appendMenuItems([ ]); const actionRegistry = Registry.as(WorkbenchExtensions.WorkbenchActions); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleAuxiliaryBarAction), 'View: Toggle Side Panel', CATEGORIES.View.value, ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true)); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAuxiliaryBarAction), 'View: Focus into Side Panel', CATEGORIES.View.value, ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true)); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleAuxiliaryBarAction), 'View: Toggle Side Panel', CATEGORIES.View.value); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAuxiliaryBarAction), 'View: Focus into Side Panel', CATEGORIES.View.value); diff --git a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts index 2df85dca181..797cf51bf80 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts +++ b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts @@ -26,9 +26,6 @@ import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; import { IAction, Separator } from 'vs/base/common/actions'; import { ToggleAuxiliaryBarAction } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions'; import { assertIsDefined } from 'vs/base/common/types'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; - -export const AUXILIARYBAR_ENABLED: string = 'workbench.experimental.sidePanel.enabled'; export class AuxiliaryBarPart extends BasePanelPart { static readonly activePanelSettingsKey = 'workbench.auxiliarybar.activepanelid'; @@ -36,13 +33,12 @@ export class AuxiliaryBarPart extends BasePanelPart { static readonly placeholdeViewContainersKey = 'workbench.auxiliarybar.placeholderPanels'; // Use the side bar dimensions - override readonly minimumWidth: number = this.isEnabled ? 170 : 0; - override readonly maximumWidth: number = this.isEnabled ? Number.POSITIVE_INFINITY : 0; + override readonly minimumWidth: number = 170; + override readonly maximumWidth: number = Number.POSITIVE_INFINITY; override readonly minimumHeight: number = 0; override readonly maximumHeight: number = Number.POSITIVE_INFINITY; constructor( - @IConfigurationService private readonly configurationService: IConfigurationService, @INotificationService notificationService: INotificationService, @IStorageService storageService: IStorageService, @ITelemetryService telemetryService: ITelemetryService, @@ -84,10 +80,6 @@ export class AuxiliaryBarPart extends BasePanelPart { ); } - get isEnabled(): boolean { - return !!this.configurationService.getValue(AUXILIARYBAR_ENABLED); - } - override updateStyles(): void { super.updateStyles(); diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index fd57d9d9292..cd5993bafe8 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -362,12 +362,6 @@ const registry = Registry.as(ConfigurationExtensions.Con 'default': false, 'description': localize('layoutControlEnabled', "Controls whether the layout control button in the custom title bar is enabled."), }, - 'workbench.experimental.sidePanel.enabled': { - 'type': 'boolean', - 'default': false, - 'description': localize('auxiliaryBarEnabled', "Controls whether the side panel opposite the side bar is enabled."), - 'included': product.quality !== 'stable' - }, 'workbench.experimental.panel.alignment': { 'type': 'string', 'enum': ['left', 'center', 'right', 'justify'], diff --git a/src/vs/workbench/services/views/browser/viewDescriptorService.ts b/src/vs/workbench/services/views/browser/viewDescriptorService.ts index 987e83b09fa..677caa66ec2 100644 --- a/src/vs/workbench/services/views/browser/viewDescriptorService.ts +++ b/src/vs/workbench/services/views/browser/viewDescriptorService.ts @@ -19,7 +19,6 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati import { getViewsStateStorageId, ViewContainerModel } from 'vs/workbench/services/views/common/viewContainerModel'; import { registerAction2, Action2, MenuId } from 'vs/platform/actions/common/actions'; import { localize } from 'vs/nls'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; interface ICachedViewContainerInfo { containerId: string; @@ -95,7 +94,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor constructor( @IInstantiationService private readonly instantiationService: IInstantiationService, - @IConfigurationService private readonly configurationService: IConfigurationService, @IContextKeyService private readonly contextKeyService: IContextKeyService, @IStorageService private readonly storageService: IStorageService, @IExtensionService private readonly extensionService: IExtensionService, @@ -119,11 +117,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor // Register all containers that were registered before this ctor this.viewContainers.forEach(viewContainer => this.onDidRegisterViewContainer(viewContainer)); - // TODO@sbatten remove with setting for side panel/auxiliary bar - if (!this.configurationService.getValue('workbench.experimental.sidePanel.enabled')) { - this.fallbackDisabledAuxiliaryBar(); - } - this._register(this.viewsRegistry.onViewsRegistered(views => this.onDidRegisterViews(views))); this._register(this.viewsRegistry.onViewsDeregistered(({ views, viewContainer }) => this.onDidDeregisterViews(views, viewContainer))); @@ -191,35 +184,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor } } - private fallbackDisabledAuxiliaryBar(): void { - for (const [containerId, containerLocation] of this.cachedViewContainerInfo.entries()) { - if (containerLocation === ViewContainerLocation.AuxiliaryBar) { - const container = this.getViewContainerById(containerId); - if (!container || this.isGeneratedContainerId(containerId)) { - continue; - } - - this.moveViewContainerToLocation(container, this.getDefaultViewContainerLocation(container)); - } - } - - - for (const [viewId, containerInfo] of this.cachedViewInfo.entries()) { - const containerId = containerInfo.containerId; - - if (!this.isGeneratedContainerId(containerId) || this.cachedViewContainerInfo.get(containerId) !== ViewContainerLocation.AuxiliaryBar) { - continue; - } - - // check if view has been registered to default location - const viewContainer = this.viewsRegistry.getViewContainer(viewId); - const viewDescriptor = this.getViewDescriptorById(viewId); - if (viewContainer && viewDescriptor) { - this.addViews(viewContainer, [viewDescriptor]); - } - } - } - private fallbackOrphanedViews(): void { for (const [viewId, containerInfo] of this.cachedViewInfo.entries()) { const containerId = containerInfo.containerId;