Skip to content

Commit

Permalink
rename side panel (#144862)
Browse files Browse the repository at this point in the history
* rename side panel

* tweaks based on feedback
  • Loading branch information
sbatten authored Mar 11, 2022
1 parent 32d40cf commit 6b74534
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 68 deletions.
54 changes: 27 additions & 27 deletions src/vs/workbench/browser/actions/layoutActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import { ICommandActionTitle } from 'vs/platform/action/common/action';
const menubarIcon = registerIcon('menuBar', Codicon.layoutMenubar, localize('menuBarIcon', "Represents the menu bar"));
const activityBarLeftIcon = registerIcon('activity-bar-left', Codicon.layoutActivitybarLeft, localize('activityBarLeft', "Represents the activity bar in the left position"));
const activityBarRightIcon = registerIcon('activity-bar-right', Codicon.layoutActivitybarRight, localize('activityBarRight', "Represents the activity bar in the right position"));
const panelLeftIcon = registerIcon('panel-left', Codicon.layoutSidebarLeft, localize('panelLeft', "Represents the side bar or side panel in the left position"));
const panelRightIcon = registerIcon('panel-right', Codicon.layoutSidebarRight, localize('panelRight', "Represents the side bar or side panel in the right position"));
const panelLeftIcon = registerIcon('panel-left', Codicon.layoutSidebarLeft, localize('panelLeft', "Represents a side bar in the left position"));
const panelRightIcon = registerIcon('panel-right', Codicon.layoutSidebarRight, localize('panelRight', "Represents side bar in the right position"));
const panelIcon = registerIcon('panel-bottom', Codicon.layoutPanel, localize('panelBottom', "Represents the bottom panel"));
const statusBarIcon = registerIcon('statusBar', Codicon.layoutStatusbar, localize('statusBarIcon', "Represents the status bar"));

Expand All @@ -55,7 +55,7 @@ registerAction2(class extends Action2 {
constructor() {
super({
id: 'workbench.action.closeSidebar',
title: { value: localize('closeSidebar', "Close Side Bar"), original: 'Close Side Bar' },
title: { value: localize('closeSidebar', "Close Primary Side Bar"), original: 'Close Primary Side Bar' },
category: CATEGORIES.View,
f1: true
});
Expand Down Expand Up @@ -164,8 +164,8 @@ class MoveSidebarRightAction extends MoveSidebarPositionAction {

constructor() {
super(MoveSidebarRightAction.ID, {
value: localize('moveSidebarRight', "Move Side Bar Right"),
original: 'Move Side Bar Right'
value: localize('moveSidebarRight', "Move Primary Side Bar Right"),
original: 'Move Primary Side Bar Right'
}, Position.RIGHT);
}
}
Expand All @@ -175,8 +175,8 @@ class MoveSidebarLeftAction extends MoveSidebarPositionAction {

constructor() {
super(MoveSidebarLeftAction.ID, {
value: localize('moveSidebarLeft', "Move Side Bar Left"),
original: 'Move Side Bar Left'
value: localize('moveSidebarLeft', "Move Primary Side Bar Left"),
original: 'Move Primary Side Bar Left'
}, Position.LEFT);
}
}
Expand All @@ -189,16 +189,16 @@ registerAction2(MoveSidebarLeftAction);
export class ToggleSidebarPositionAction extends Action2 {

static readonly ID = 'workbench.action.toggleSidebarPosition';
static readonly LABEL = localize('toggleSidebarPosition', "Toggle Side Bar Position");
static readonly LABEL = localize('toggleSidebarPosition', "Toggle Primary Side Bar Position");

static getLabel(layoutService: IWorkbenchLayoutService): string {
return layoutService.getSideBarPosition() === Position.LEFT ? localize('moveSidebarRight', "Move Side Bar Right") : localize('moveSidebarLeft', "Move Side Bar Left");
return layoutService.getSideBarPosition() === Position.LEFT ? localize('moveSidebarRight', "Move Primary Side Bar Right") : localize('moveSidebarLeft', "Move Primary Side Bar Left");
}

constructor() {
super({
id: ToggleSidebarPositionAction.ID,
title: { value: localize('toggleSidebarPosition', "Toggle Side Bar Position"), original: 'Toggle Side Bar Position' },
title: { value: localize('toggleSidebarPosition', "Toggle Primary Side Bar Position"), original: 'Toggle Primary Side Bar Position' },
category: CATEGORIES.View,
f1: true
});
Expand Down Expand Up @@ -233,7 +233,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: localize('move sidebar right', "Move Side Bar Right")
title: localize('move side bar right', "Move Primary Side Bar Right")
},
when: ContextKeyExpr.and(ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
Expand All @@ -244,7 +244,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: localize('move sidebar right', "Move Side Bar Right")
title: localize('move sidebar right', "Move Primary Side Bar Right")
},
when: ContextKeyExpr.and(ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
Expand All @@ -255,7 +255,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: localize('move sidebar left', "Move Side Bar Left")
title: localize('move sidebar left', "Move Primary Side Bar Left")
},
when: ContextKeyExpr.and(ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
Expand All @@ -266,7 +266,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: localize('move sidebar left', "Move Side Bar Left")
title: localize('move sidebar left', "Move Primary Side Bar Left")
},
when: ContextKeyExpr.and(ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
Expand All @@ -277,7 +277,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Right")
title: localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Primary Side Bar Right")
},
when: ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'),
order: 2
Expand All @@ -287,7 +287,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left")
title: localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Primary Side Bar Left")
},
when: ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'),
order: 2
Expand Down Expand Up @@ -338,7 +338,7 @@ class ToggleSidebarVisibilityAction extends Action2 {
constructor() {
super({
id: ToggleSidebarVisibilityAction.ID,
title: { value: localize('toggleSidebar', "Toggle Side Bar Visibility"), original: 'Toggle Side Bar Visibility' },
title: { value: localize('toggleSidebar', "Toggle Primary Side Bar Visibility"), original: 'Toggle Primary Side Bar Visibility' },
category: CATEGORIES.View,
f1: true,
keybinding: {
Expand Down Expand Up @@ -386,7 +386,7 @@ MenuRegistry.appendMenuItems([
group: '2_workbench_layout',
command: {
id: ToggleSidebarVisibilityAction.ID,
title: localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "Show &&Side Bar"),
title: localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "Show &&Primary Side Bar"),
toggled: SideBarVisibleContext
},
order: 1
Expand All @@ -397,7 +397,7 @@ MenuRegistry.appendMenuItems([
group: '0_workbench_layout',
command: {
id: ToggleSidebarVisibilityAction.ID,
title: localize('miShowSidebarNoMnnemonic', "Show Side Bar"),
title: localize('miShowSidebarNoMnnemonic', "Show Primary Side Bar"),
toggled: SideBarVisibleContext
},
order: 0
Expand All @@ -408,7 +408,7 @@ MenuRegistry.appendMenuItems([
group: '0_workbench_toggles',
command: {
id: ToggleSidebarVisibilityAction.ID,
title: localize('toggleSideBar', "Toggle Side Bar"),
title: localize('toggleSideBar', "Toggle Primary Side Bar"),
icon: panelLeftIcon,
toggled: SideBarVisibleContext
},
Expand All @@ -421,7 +421,7 @@ MenuRegistry.appendMenuItems([
group: '0_workbench_toggles',
command: {
id: ToggleSidebarVisibilityAction.ID,
title: localize('toggleSideBar', "Toggle Side Bar"),
title: localize('toggleSideBar', "Toggle Primary Side Bar"),
icon: panelRightIcon,
toggled: SideBarVisibleContext
},
Expand Down Expand Up @@ -704,7 +704,7 @@ registerAction2(class extends Action2 {
if (!hasAddedView) {
results.push({
type: 'separator',
label: localize('sidePanelContainer', "Side Panel / {0}", containerModel.title)
label: localize('secondarySideBarContainer', "Secondary Side Bar / {0}", containerModel.title)
});
hasAddedView = true;
}
Expand Down Expand Up @@ -809,7 +809,7 @@ class MoveFocusedViewAction extends Action2 {
if (!(isViewSolo && currentLocation === ViewContainerLocation.AuxiliaryBar)) {
items.push({
id: '_.auxiliarybar.newcontainer',
label: localize('moveFocusedView.newContainerInSidePanel', "New Side Panel Entry")
label: localize('moveFocusedView.newContainerInSidePanel', "New Secondary Side Bar Entry")
});
}

Expand Down Expand Up @@ -857,7 +857,7 @@ class MoveFocusedViewAction extends Action2 {

items.push({
type: 'separator',
label: localize('sidePanel', "Side Panel")
label: localize('secondarySideBar', "Secondary Side Bar")
});

const pinnedAuxPanels = paneCompositePartService.getPinnedPaneCompositeIds(ViewContainerLocation.AuxiliaryBar);
Expand Down Expand Up @@ -1133,9 +1133,9 @@ if (!isMacintosh || !isNative) {

ToggleVisibilityActions.push(...[
CreateToggleLayoutItem(ToggleActivityBarVisibilityAction.ID, ContextKeyExpr.equals('config.workbench.activityBar.visible', true), localize('activityBar', "Activity Bar"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: activityBarLeftIcon, iconB: activityBarRightIcon }),
CreateToggleLayoutItem(ToggleSidebarVisibilityAction.ID, SideBarVisibleContext, localize('sideBar', "Side Bar"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: panelLeftIcon, iconB: panelRightIcon }),
CreateToggleLayoutItem(ToggleSidebarVisibilityAction.ID, SideBarVisibleContext, localize('sideBar', "Primary Side Bar"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: panelLeftIcon, iconB: panelRightIcon }),
CreateToggleLayoutItem(TogglePanelAction.ID, PanelVisibleContext, localize('panel', "Panel"), panelIcon),
CreateToggleLayoutItem(ToggleAuxiliaryBarAction.ID, AuxiliaryBarVisibleContext, localize('sidePanel', "Side Panel"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: panelRightIcon, iconB: panelLeftIcon }),
CreateToggleLayoutItem(ToggleAuxiliaryBarAction.ID, AuxiliaryBarVisibleContext, localize('secondarySideBar', "Secondary Side Bar"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: panelRightIcon, iconB: panelLeftIcon }),
CreateToggleLayoutItem(ToggleStatusbarVisibilityAction.ID, ContextKeyExpr.equals('config.workbench.statusBar.visible', true), localize('statusBar', "Status Bar"), statusBarIcon),
]);

Expand Down Expand Up @@ -1220,7 +1220,7 @@ registerAction2(class CustomizeLayoutAction extends Action2 {
...ToggleVisibilityActions.map(toQuickPickItem),
{
type: 'separator',
label: localize('sideBarPosition', "Side Bar Position")
label: localize('sideBarPosition', "Primary Side Bar Position")
},
...MoveSideBarActions.map(toQuickPickItem),
{
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/browser/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
sideBar.updateStyles();
auxiliaryBar.updateStyles();

// Move activity bar, side bar, and side panel
// Move activity bar and side bars
this.adjustPartPositions(position, panelAlignment, panelPosition);
}

Expand Down Expand Up @@ -1484,7 +1484,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi

private adjustPartPositions(sideBarPosition: Position, panelAlignment: PanelAlignment, panelPosition: Position): void {

// Move activity bar, side bar, and side panel
// Move activity bar and side bars
const sideBarSiblingToEditor = panelPosition !== Position.BOTTOM || !(panelAlignment === 'center' || (sideBarPosition === Position.LEFT && panelAlignment === 'right') || (sideBarPosition === Position.RIGHT && panelAlignment === 'left'));
const auxiliaryBarSiblingToEditor = panelPosition !== Position.BOTTOM || !(panelAlignment === 'center' || (sideBarPosition === Position.RIGHT && panelAlignment === 'right') || (sideBarPosition === Position.LEFT && panelAlignment === 'left'));
const preMovePanelWidth = !this.isVisible(Parts.PANEL_PART) ? Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView) ?? this.panelPartView.minimumWidth) : this.workbenchGrid.getViewSize(this.panelPartView).width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ registerAction2(
constructor() {
super({
id: 'workbench.action.previousSideBarView',
title: { value: localize('previousSideBarView', "Previous Side Bar View"), original: 'Previous Side Bar View' },
title: { value: localize('previousSideBarView', "Previous Primary Side Bar View"), original: 'Previous Primary Side Bar View' },
category: CATEGORIES.View,
f1: true
}, -1);
Expand All @@ -384,7 +384,7 @@ registerAction2(
constructor() {
super({
id: 'workbench.action.nextSideBarView',
title: { value: localize('nextSideBarView', "Next Side Bar View"), original: 'Next Side Bar View' },
title: { value: localize('nextSideBarView', "Next Primary Side Bar View"), original: 'Next Primary Side Bar View' },
category: CATEGORIES.View,
f1: true
}, 1);
Expand Down
20 changes: 10 additions & 10 deletions src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const auxiliaryBarLeftIcon = registerIcon('auxiliarybar-left-layout-icon', Codic
export class ToggleAuxiliaryBarAction extends Action {

static readonly ID = 'workbench.action.toggleAuxiliaryBar';
static readonly LABEL = localize('toggleAuxiliaryBar', "Toggle Side Panel");
static readonly LABEL = localize('toggleAuxiliaryBar', "Toggle Secondary Side Bar");

constructor(
id: string,
Expand All @@ -41,7 +41,7 @@ export class ToggleAuxiliaryBarAction extends Action {
class FocusAuxiliaryBarAction extends Action {

static readonly ID = 'workbench.action.focusAuxiliaryBar';
static readonly LABEL = localize('focusAuxiliaryBar', "Focus into Side Panel");
static readonly LABEL = localize('focusAuxiliaryBar', "Focus into Secondary Side Bar");

constructor(
id: string,
Expand Down Expand Up @@ -74,7 +74,7 @@ MenuRegistry.appendMenuItems([
group: '0_workbench_layout',
command: {
id: ToggleAuxiliaryBarAction.ID,
title: localize('miShowAuxiliaryBarNoMnemonic', "Show Side Panel"),
title: localize('miShowAuxiliaryBarNoMnemonic', "Show Secondary Side Bar"),
toggled: AuxiliaryBarVisibleContext
},
order: 4
Expand All @@ -86,7 +86,7 @@ MenuRegistry.appendMenuItems([
group: '0_workbench_toggles',
command: {
id: ToggleAuxiliaryBarAction.ID,
title: localize('toggleSidePanel', "Toggle Side Panel"),
title: localize('toggleSecondarySideBar', "Toggle Secondary Side Bar"),
toggled: AuxiliaryBarVisibleContext,
icon: auxiliaryBarLeftIcon,
},
Expand All @@ -100,7 +100,7 @@ MenuRegistry.appendMenuItems([
group: '0_workbench_toggles',
command: {
id: ToggleAuxiliaryBarAction.ID,
title: localize('toggleSidePanel', "Toggle Side Panel"),
title: localize('toggleSecondarySideBar', "Toggle Secondary Side Bar"),
toggled: AuxiliaryBarVisibleContext,
icon: auxiliaryBarRightIcon,
},
Expand All @@ -114,18 +114,18 @@ MenuRegistry.appendMenuItems([
group: '2_workbench_layout',
command: {
id: ToggleAuxiliaryBarAction.ID,
title: localize({ key: 'miShowAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Show Si&&de Panel"),
title: localize({ key: 'miShowAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Show Secondary Si&&de Bar"),
toggled: AuxiliaryBarVisibleContext
},
order: 5
order: 2
}
}, {
id: MenuId.ViewTitleContext,
item: {
group: '3_workbench_layout_move',
command: {
id: ToggleAuxiliaryBarAction.ID,
title: { value: localize('hideAuxiliaryBar', "Hide Side Panel"), original: 'Hide Side Panel' },
title: { value: localize('hideAuxiliaryBar', "Hide Secondary Side Bar"), original: 'Hide Secondary Side Bar' },
},
when: ContextKeyExpr.and(AuxiliaryBarVisibleContext, ContextKeyExpr.equals('viewLocation', ViewContainerLocationToString(ViewContainerLocation.AuxiliaryBar))),
order: 2
Expand All @@ -134,5 +134,5 @@ MenuRegistry.appendMenuItems([
]);

const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchExtensions.WorkbenchActions);
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);
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleAuxiliaryBarAction), 'View: Toggle Secondary Side Bar', CATEGORIES.View.value);
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAuxiliaryBarAction), 'View: Focus into Secondary Side Bar', CATEGORIES.View.value);
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
import { IWorkbenchLayoutService, Parts, Position } from 'vs/workbench/services/layout/browser/layoutService';
import { IActivityHoverOptions } from 'vs/workbench/browser/parts/compositeBarActions';
import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
import { IAction, Separator, toAction } from 'vs/base/common/actions';
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 { MoveSidePanelToPanelAction } from 'vs/workbench/browser/parts/panel/panelActions';
import { LayoutPriority } from 'vs/base/browser/ui/splitview/splitview';

export class AuxiliaryBarPart extends BasePanelPart {
Expand Down Expand Up @@ -110,8 +109,7 @@ export class AuxiliaryBarPart extends BasePanelPart {
protected fillExtraContextMenuActions(actions: IAction[]): void {
actions.push(...[
new Separator(),
toAction({ id: MoveSidePanelToPanelAction.ID, label: localize('moveToPanel', "Move Views to Panel"), run: () => this.instantiationService.invokeFunction(accessor => new MoveSidePanelToPanelAction().run(accessor)) }),
this.instantiationService.createInstance(ToggleAuxiliaryBarAction, ToggleAuxiliaryBarAction.ID, localize('hideAuxiliaryBar', "Hide Side Panel"))
this.instantiationService.createInstance(ToggleAuxiliaryBarAction, ToggleAuxiliaryBarAction.ID, localize('hideAuxiliaryBar', "Hide Secondary Side Bar"))
]);
}

Expand Down
Loading

0 comments on commit 6b74534

Please sign in to comment.