浏览代码

Removes view layout settings

main
Eric Amodio 1年前
父节点
当前提交
a9dfe768b7
共有 9 个文件被更改,包括 22 次插入127 次删除
  1. +1
    -9
      README.md
  2. 二进制
      images/docs/views-layout-gitlens.png
  3. 二进制
      images/docs/views-layout-scm.png
  4. +0
    -5
      package.json
  5. +1
    -1
      src/commands.ts
  6. +18
    -0
      src/commands/resetViewsLayout.ts
  7. +0
    -100
      src/commands/setViewsLayout.ts
  8. +2
    -3
      src/constants.ts
  9. +0
    -9
      walkthroughs/getting-started/7-git-side-bar-views.md

+ 1
- 9
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
<p style="display:flex;justify-content:space-around">
<img src="images/docs/views-layout-scm.png" alt="Views Layout: Source Control" />
<img src="images/docs/views-layout-gitlens.png" alt="Views Layout: GitLens" />
</p>
GitLens adds many side bar views to provide additional rich functionality.
### Commit Details View [#](#commit-details-view- 'Commits Details view')

二进制
images/docs/views-layout-gitlens.png 查看文件

之前 之后
宽度: 367  |  高度: 420  |  大小: 15 KiB

二进制
images/docs/views-layout-scm.png 查看文件

之前 之后
宽度: 367  |  高度: 420  |  大小: 23 KiB

+ 0
- 5
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",

+ 1
- 1
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';

+ 18
- 0
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`));
}
}
}

+ 0
- 100
src/commands/setViewsLayout.ts 查看文件

@ -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;
}
}
}

+ 2
- 3
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<T, SchemaVersion extends number = 1> {
v: SchemaVersion;
data: T;

+ 0
- 9
walkthroughs/getting-started/7-git-side-bar-views.md 查看文件

@ -1,12 +1,3 @@
## Side Bar Views
<p float="left">
<img src="../../images/docs/views-layout-gitlens.png" alt="GitLens Side Bar Views" width="45%" />
<img src="../../images/docs/views-layout-scm.png" alt="Source Control Side Bar Views" width="45%" />
</p>
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.

正在加载...
取消
保存