diff --git a/README.md b/README.md index 95656cf..3250891 100644 --- a/README.md +++ b/README.md @@ -279,15 +279,7 @@ You can create multiple working trees, each of which can be opened in individual ## Side Bar Views [#](#side-bar-views- 'Side Bar Views') -GitLens adds many side bar views to provide additional rich functionality. The default layout (location) of these views can be quickly customized via the _GitLens: Set Views Layout_ (`gitlens.setViewsLayout`) command from the [_Command Palette_](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette). - -- _Source Control Layout_ — shows all the views together on the Source Control side bar -- _GitLens Layout_ — shows all the views together on the GitLens side bar - -

- Views Layout: Source Control - Views Layout: GitLens -

+GitLens adds many side bar views to provide additional rich functionality. ### Commit Details View [#](#commit-details-view- 'Commits Details view') diff --git a/images/docs/views-layout-gitlens.png b/images/docs/views-layout-gitlens.png deleted file mode 100644 index 83c2215..0000000 Binary files a/images/docs/views-layout-gitlens.png and /dev/null differ diff --git a/images/docs/views-layout-scm.png b/images/docs/views-layout-scm.png deleted file mode 100644 index 56f793c..0000000 Binary files a/images/docs/views-layout-scm.png and /dev/null differ diff --git a/package.json b/package.json index 455a5bc..f795de5 100644 --- a/package.json +++ b/package.json @@ -5061,11 +5061,6 @@ "category": "GitLens" }, { - "command": "gitlens.setViewsLayout", - "title": "Set Views Layout", - "category": "GitLens" - }, - { "command": "gitlens.showCommitSearch", "title": "Search Commits", "category": "GitLens", diff --git a/src/commands.ts b/src/commands.ts index 00ffb54..c383f45 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -45,7 +45,7 @@ export * from './commands/refreshHover'; export * from './commands/remoteProviders'; export * from './commands/repositories'; export * from './commands/resets'; -export * from './commands/setViewsLayout'; +export * from './commands/resetViewsLayout'; export * from './commands/searchCommits'; export * from './commands/showCommitsInView'; export * from './commands/showLastQuickPick'; diff --git a/src/commands/resetViewsLayout.ts b/src/commands/resetViewsLayout.ts new file mode 100644 index 0000000..b116827 --- /dev/null +++ b/src/commands/resetViewsLayout.ts @@ -0,0 +1,18 @@ +import { viewsConfigKeys } from '../config'; +import { Commands } from '../constants'; +import type { Container } from '../container'; +import { command, executeCommand } from '../system/command'; +import { Command } from './base'; + +@command() +export class ResetViewsLayoutCommand extends Command { + constructor(private readonly container: Container) { + super(Commands.ResetViewsLayout); + } + + async execute() { + for (const view of viewsConfigKeys) { + void (await executeCommand(`gitlens.views.${view}.resetViewLocation`)); + } + } +} diff --git a/src/commands/setViewsLayout.ts b/src/commands/setViewsLayout.ts deleted file mode 100644 index 3bc792a..0000000 --- a/src/commands/setViewsLayout.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { window } from 'vscode'; -import { viewsConfigKeys } from '../config'; -import { Commands } from '../constants'; -import type { Container } from '../container'; -import { command, executeCommand, executeCoreCommand } from '../system/command'; -import { Command } from './base'; - -@command() -export class ResetViewsLayoutCommand extends Command { - constructor(private readonly container: Container) { - super(Commands.ResetViewsLayout); - } - - async execute() { - for (const view of viewsConfigKeys) { - void (await executeCommand(`gitlens.views.${view}.resetViewLocation`)); - } - } -} - -export enum ViewsLayout { - GitLens = 'gitlens', - SourceControl = 'scm', -} - -export interface SetViewsLayoutCommandArgs { - layout: ViewsLayout; -} - -@command() -export class SetViewsLayoutCommand extends Command { - constructor(private readonly container: Container) { - super(Commands.SetViewsLayout); - } - - async execute(args?: SetViewsLayoutCommandArgs) { - let layout = args?.layout; - if (layout == null) { - const pick = await window.showQuickPick( - [ - { - label: 'Source Control Layout', - description: '(default)', - detail: 'Shows all the views together on the Source Control side bar', - layout: ViewsLayout.SourceControl, - }, - { - label: 'GitLens Layout', - description: '', - detail: 'Shows all the views together on the GitLens side bar', - layout: ViewsLayout.GitLens, - }, - ], - { - placeHolder: 'Choose a GitLens views layout', - }, - ); - if (pick == null) return; - - layout = pick.layout; - } - - void this.container.storage.store('views:layout', layout); - - const views = viewsConfigKeys.filter(v => v !== 'contributors'); - - switch (layout) { - case ViewsLayout.GitLens: - try { - // Because of https://github.com/microsoft/vscode/issues/105774, run the command twice which seems to fix things - let count = 0; - while (count++ < 2) { - void (await executeCoreCommand('vscode.moveViews', { - viewIds: views.map(v => `gitlens.views.${v}`), - destinationId: 'workbench.view.extension.gitlens', - })); - } - } catch {} - - break; - case ViewsLayout.SourceControl: - try { - // Because of https://github.com/microsoft/vscode/issues/105774, run the command twice which seems to fix things - let count = 0; - while (count++ < 2) { - void (await executeCoreCommand('vscode.moveViews', { - viewIds: views.map(v => `gitlens.views.${v}`), - destinationId: 'workbench.view.scm', - })); - } - } catch { - for (const view of views) { - void (await executeCommand(`gitlens.views.${view}.resetViewLocation`)); - } - } - - break; - } - } -} diff --git a/src/constants.ts b/src/constants.ts index 4db88ce..23c3a56 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -227,7 +227,6 @@ export const enum Commands { RevealCommitInView = 'gitlens.revealCommitInView', SearchCommits = 'gitlens.showCommitSearch', SearchCommitsInView = 'gitlens.views.searchAndCompare.searchCommits', - SetViewsLayout = 'gitlens.setViewsLayout', ShowBranchesView = 'gitlens.showBranchesView', ShowCommitDetailsView = 'gitlens.showCommitDetailsView', ShowCommitInView = 'gitlens.showCommitInView', @@ -526,6 +525,8 @@ export const enum SyncedStorageKeys { export type DeprecatedGlobalStorage = { /** @deprecated use `confirm:ai:send:openai` */ 'confirm:sendToOpenAI': boolean; + /** @deprecated not longer valid */ + 'views:layout': 'gitlens' | 'scm'; } & { /** @deprecated */ [key in `disallow:connection:${string}`]: any; @@ -554,7 +555,6 @@ export type GlobalStorage = { version: string; // Keep the pre-release version separate from the released version preVersion: string; - 'views:layout': StoredViewsLayout; 'views:welcome:visible': boolean; 'views:commitDetails:dismissed': CommitDetailsDismissed[]; } & { [key in `confirm:ai:tos:${AIProviders}`]: boolean } & { @@ -587,7 +587,6 @@ export type WorkspaceStorage = { 'views:commitDetails:autolinksExpanded': boolean; } & { [key in `confirm:ai:tos:${AIProviders}`]: boolean } & { [key in `connected:${string}`]: boolean }; -export type StoredViewsLayout = 'gitlens' | 'scm'; export interface Stored { v: SchemaVersion; data: T; diff --git a/walkthroughs/getting-started/7-git-side-bar-views.md b/walkthroughs/getting-started/7-git-side-bar-views.md index 5d9bdd6..c483bce 100644 --- a/walkthroughs/getting-started/7-git-side-bar-views.md +++ b/walkthroughs/getting-started/7-git-side-bar-views.md @@ -1,12 +1,3 @@ ## Side Bar Views -

- GitLens Side Bar Views - Source Control Side Bar Views -

- GitLens adds side bar views for Commits, File History, Branches, Remotes, Stashes, Tags, Contributors, Search & Compare, and more that provide rich source control details and functionality. - -By default, these views can be displayed in either the [GitLens side bar](command:gitlens.views.home.focus 'Open GitLens side bar') or on the [Source Control side bar](command:workbench.scm.focus 'Open Source Control side bar'). - -💡 Use the [GitLens: Set Views Layout](command:gitlens.setViewsLayout) command from the [Command Palette](command:workbench.action.quickOpen?%22>GitLens%3A%20Set%20Views%20Layout%22) to change the layout, or drag & drop the views individually.