Explorar el Código

Removes view layout settings

main
Eric Amodio hace 1 año
padre
commit
a9dfe768b7
Se han modificado 9 ficheros con 22 adiciones y 127 borrados
  1. +1
    -9
      README.md
  2. BIN
      images/docs/views-layout-gitlens.png
  3. BIN
      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 Ver fichero

@ -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')

BIN
images/docs/views-layout-gitlens.png Ver fichero

Antes Después
Anchura: 367  |  Altura: 420  |  Tamaño: 15 KiB

BIN
images/docs/views-layout-scm.png Ver fichero

Antes Después
Anchura: 367  |  Altura: 420  |  Tamaño: 23 KiB

+ 0
- 5
package.json Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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 Ver fichero

@ -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.

Cargando…
Cancelar
Guardar