Procházet zdrojové kódy

Adds better Commit Graph discovery

main
Eric Amodio před 2 roky
rodič
revize
7c78c273ea
8 změnil soubory, kde provedl 325 přidání a 29 odebrání
  1. +1
    -1
      images/icons/graph.svg
  2. +104
    -8
      package.json
  3. +26
    -3
      src/commands/base.ts
  4. +15
    -1
      src/config.ts
  5. +70
    -8
      src/plus/webviews/graph/graphWebview.ts
  6. +28
    -4
      src/views/commitsView.ts
  7. +80
    -3
      src/webviews/apps/settings/partials/menus.html
  8. +1
    -1
      src/webviews/apps/shared/glicons.scss

+ 1
- 1
images/icons/graph.svg Zobrazit soubor

@ -1 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M2.23223 1.23223C2.70107 0.763392 3.33696 0.5 4 0.5C4.66304 0.5 5.29893 0.763392 5.76777 1.23223C6.23661 1.70107 6.5 2.33696 6.5 3C6.5 3.66304 6.23661 4.29893 5.76777 4.76777C5.29893 5.23661 4.66304 5.5 4 5.5C3.33696 5.5 2.70107 5.23661 2.23223 4.76777C1.76339 4.29893 1.5 3.66304 1.5 3C1.5 2.33696 1.76339 1.70107 2.23223 1.23223ZM4 1.5C3.60218 1.5 3.22064 1.65804 2.93934 1.93934C2.65804 2.22064 2.5 2.60218 2.5 3C2.5 3.39782 2.65804 3.77936 2.93934 4.06066C3.22064 4.34196 3.60218 4.5 4 4.5C4.39782 4.5 4.77936 4.34196 5.06066 4.06066C5.34196 3.77936 5.5 3.39782 5.5 3C5.5 2.60218 5.34196 2.22064 5.06066 1.93934C4.77936 1.65804 4.39782 1.5 4 1.5ZM2.23223 11.2322C2.70107 10.7634 3.33696 10.5 4 10.5C4.66304 10.5 5.29893 10.7634 5.76777 11.2322C6.23661 11.7011 6.5 12.337 6.5 13C6.5 13.663 6.23661 14.2989 5.76777 14.7678C5.29893 15.2366 4.66304 15.5 4 15.5C3.33696 15.5 2.70107 15.2366 2.23223 14.7678C1.76339 14.2989 1.5 13.663 1.5 13C1.5 12.337 1.76339 11.7011 2.23223 11.2322ZM4 11.5C3.60218 11.5 3.22064 11.658 2.93934 11.9393C2.65804 12.2206 2.5 12.6022 2.5 13C2.5 13.3978 2.65804 13.7794 2.93934 14.0607C3.22064 14.342 3.60218 14.5 4 14.5C4.39782 14.5 4.77936 14.342 5.06066 14.0607C5.34196 13.7794 5.5 13.3978 5.5 13C5.5 12.6022 5.34196 12.2206 5.06066 11.9393C4.77936 11.658 4.39782 11.5 4 11.5Z"/><path d="M3.5 11.5V4.5H4.5V11.5H3.5ZM3.5 16V14.5H4.5V16H3.5Z"/><path d="M10.2322 3.23223C10.7011 2.76339 11.337 2.5 12 2.5C12.663 2.5 13.2989 2.76339 13.7678 3.23223C14.2366 3.70107 14.5 4.33696 14.5 5C14.5 5.66304 14.2366 6.29893 13.7678 6.76777C13.2989 7.23661 12.663 7.5 12 7.5C11.337 7.5 10.7011 7.23661 10.2322 6.76777C9.76339 6.29893 9.5 5.66304 9.5 5C9.5 4.33696 9.76339 3.70107 10.2322 3.23223ZM12 3.5C11.6022 3.5 11.2206 3.65804 10.9393 3.93934C10.658 4.22064 10.5 4.60218 10.5 5C10.5 5.39782 10.658 5.77936 10.9393 6.06066C11.2206 6.34196 11.6022 6.5 12 6.5C12.3978 6.5 12.7794 6.34196 13.0607 6.06066C13.342 5.77936 13.5 5.39782 13.5 5C13.5 4.60218 13.342 4.22064 13.0607 3.93934C12.7794 3.65804 12.3978 3.5 12 3.5ZM6.23223 7.23223C6.70107 6.76339 7.33696 6.5 8 6.5C8.66304 6.5 9.29893 6.76339 9.76777 7.23223C10.2366 7.70107 10.5 8.33696 10.5 9C10.5 9.66304 10.2366 10.2989 9.76777 10.7678C9.29893 11.2366 8.66304 11.5 8 11.5C7.33696 11.5 6.70107 11.2366 6.23223 10.7678C5.76339 10.2989 5.5 9.66304 5.5 9C5.5 8.33696 5.76339 7.70107 6.23223 7.23223ZM8 7.5C7.60218 7.5 7.22064 7.65804 6.93934 7.93934C6.65804 8.22064 6.5 8.60218 6.5 9C6.5 9.39782 6.65804 9.77935 6.93934 10.0607C7.22064 10.342 7.60218 10.5 8 10.5C8.39782 10.5 8.77936 10.342 9.06066 10.0607C9.34196 9.77935 9.5 9.39782 9.5 9C9.5 8.60218 9.34196 8.22064 9.06066 7.93934C8.77936 7.65804 8.39782 7.5 8 7.5Z"/><path d="M11.5 11V7H12.5V11C12.5 11.663 12.2366 12.2989 11.7678 12.7678C11.2989 13.2366 10.663 13.5 10 13.5H8.5V16H7.5V13.5H5.5V12.5H7.5V10.5H8.5V12.5H10C10.3978 12.5 10.7794 12.342 11.0607 12.0607C11.342 11.7794 11.5 11.3978 11.5 11Z"/></svg>
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M3 10.5V5.5H4V10.5H3ZM3 15.5V14.5H4V15.5H3Z"/><path d="M11 11V9.5H12V11C12 11.663 11.7366 12.2989 11.2678 12.7678C10.7989 13.2366 10.163 13.5 9.5 13.5H8V15.5H7V13.5H5.5V12.5H7V1H8V12.5H9.5C9.89782 12.5 10.2794 12.342 10.5607 12.0607C10.842 11.7794 11 11.3978 11 11Z"/><path d="M3.5 5C2.67157 5 2 4.32843 2 3.5C2 2.67157 2.67157 2 3.5 2C4.32843 2 5 2.67157 5 3.5C5 4.32843 4.32843 5 3.5 5ZM3.5 6C4.88071 6 6 4.88071 6 3.5C6 2.11929 4.88071 1 3.5 1C2.11929 1 1 2.11929 1 3.5C1 4.88071 2.11929 6 3.5 6Z"/><path d="M11.5 9C10.6716 9 10 8.32843 10 7.5C10 6.67157 10.6716 6 11.5 6C12.3284 6 13 6.67157 13 7.5C13 8.32843 12.3284 9 11.5 9ZM11.5 10C12.8807 10 14 8.88071 14 7.5C14 6.11929 12.8807 5 11.5 5C10.1193 5 9 6.11929 9 7.5C9 8.88071 10.1193 10 11.5 10Z"/><path d="M3.5 14C2.67157 14 2 13.3284 2 12.5C2 11.6716 2.67157 11 3.5 11C4.32843 11 5 11.6716 5 12.5C5 13.3284 4.32843 14 3.5 14ZM3.5 15C4.88071 15 6 13.8807 6 12.5C6 11.1193 4.88071 10 3.5 10C2.11929 10 1 11.1193 1 12.5C1 13.8807 2.11929 15 3.5 15Z"/></svg>

+ 104
- 8
package.json Zobrazit soubor

@ -2092,19 +2092,26 @@
"title": "Commit Graph",
"order": 105,
"properties": {
"gitlens.graph.statusBar.enabled": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the _Commit Graph_ in the status bar",
"scope": "window",
"order": 10
},
"gitlens.graph.defaultItemLimit": {
"type": "number",
"default": 500,
"markdownDescription": "Specifies the default number of items to show in the _Commit Graph_. Use 0 to specify no limit",
"scope": "window",
"order": 10
"order": 50
},
"gitlens.graph.pageItemLimit": {
"type": "number",
"default": 200,
"markdownDescription": "Specifies the number of additional items to fetch when paginating in the _Commit Graph_. Use 0 to specify no limit",
"scope": "window",
"order": 20
"order": 60
},
"gitlens.graph.columnColors": {
"type": "array",
@ -2126,7 +2133,7 @@
],
"markdownDescription": "Specifies the colors used for the different columns in the _Commit Graph_",
"scope": "window",
"order": 30,
"order": 100,
"maxItems": 10,
"minItems": 10
}
@ -2719,8 +2726,45 @@
{
"type": "object",
"properties": {
"graph": {
"type": "boolean"
}
}
}
]
},
"scmRepositoryInline": {
"anyOf": [
{
"enum": [
false
]
},
{
"type": "object",
"properties": {
"graph": {
"type": "boolean"
}
}
}
]
},
"scmRepository": {
"anyOf": [
{
"enum": [
false
]
},
{
"type": "object",
"properties": {
"authors": {
"type": "boolean"
},
"graph": {
"type": "boolean"
}
}
}
@ -2824,7 +2868,14 @@
"remote": true
},
"scm": {
"authors": true
"graph": true
},
"scmRepositoryInline": {
"graph": true
},
"scmRepository": {
"authors": true,
"graph": false
},
"scmGroupInline": {
"stash": true
@ -3827,7 +3878,8 @@
{
"command": "gitlens.showGraphPage",
"title": "Show Commit Graph",
"category": "GitLens"
"category": "GitLens+",
"icon": "$(gitlens-graph)"
},
{
"command": "gitlens.showSettingsPage",
@ -8036,7 +8088,7 @@
"git.commit": [
{
"command": "gitlens.addAuthors",
"when": "gitlens:enabled && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && config.gitlens.menus.scm.authors",
"when": "gitlens:enabled && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && config.gitlens.menus.scmRepository.authors",
"group": "4_gitlens@1"
}
],
@ -8052,6 +8104,30 @@
"group": "1_gitlens@2"
}
],
"scm/sourceControl": [
{
"command": "gitlens.showGraphPage",
"when": "gitlens:enabled && config.gitlens.menus.scm.graph",
"group": "6_gitlens@1"
}
],
"scm/title": [
{
"command": "gitlens.showGraphPage",
"when": "gitlens:enabled && config.gitlens.menus.scmRepositoryInline.graph && config.gitlens.plusFeatures.enabled",
"group": "navigation@-1000"
},
{
"command": "gitlens.addAuthors",
"when": "gitlens:enabled && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && config.gitlens.menus.scmRepository.authors",
"group": "2_z_gitlens@1"
},
{
"command": "gitlens.showGraphPage",
"when": "gitlens:enabled && config.gitlens.menus.scmRepository.graph",
"group": "2_z_gitlens@2"
}
],
"scm/resourceGroup/context": [
{
"command": "gitlens.stashSave",
@ -8218,6 +8294,11 @@
"group": "navigation@10"
},
{
"command": "gitlens.showGraphPage",
"when": "view =~ /^gitlens\\.views\\.commits/ && config.gitlens.plusFeatures.enabled",
"group": "navigation@11"
},
{
"command": "gitlens.views.commits.setMyCommitsOnlyOff",
"when": "view =~ /^gitlens\\.views\\.commits/ && gitlens:views:commits:myCommitsOnly",
"group": "navigation@50"
@ -8283,9 +8364,14 @@
"group": "5_gitlens@2"
},
{
"command": "gitlens.showGraphPage",
"when": "view =~ /^gitlens\\.views\\.commits/",
"group": "8_gitlens_toggles@0"
},
{
"command": "gitlens.showRepositoriesView",
"when": "!gitlens:hasVirtualFolders && view =~ /^gitlens\\.views\\.commits/",
"group": "8_gitlens_toggles@0"
"group": "8_gitlens_toggles@1"
},
{
"command": "gitlens.views.addAuthors",
@ -9633,6 +9719,11 @@
"group": "inline@99"
},
{
"command": "gitlens.showGraphPage",
"when": "viewItem =~ /gitlens:repo-folder\\b/ && config.gitlens.plusFeatures.enabled",
"group": "inline@100"
},
{
"command": "gitlens.views.fetch",
"when": "gitlens:hasRemotes && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && viewItem =~ /gitlens:repo-folder\\b/",
"group": "1_gitlens_actions@1"
@ -9664,11 +9755,16 @@
"alt": "gitlens.copyRemoteRepositoryUrl"
},
{
"command": "gitlens.showCommitSearch",
"command": "gitlens.showGraphPage",
"when": "viewItem =~ /gitlens:repo-folder\\b/",
"group": "3_gitlens_explore@1"
},
{
"command": "gitlens.showCommitSearch",
"when": "viewItem =~ /gitlens:repo-folder\\b/",
"group": "3_gitlens_explore@2"
},
{
"command": "gitlens.stashSave",
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && viewItem =~ /gitlens:repo-folder\\b/",
"group": "1_gitlens_actions_1@1"

+ 26
- 3
src/commands/base.ts Zobrazit soubor

@ -1,5 +1,6 @@
import type {
GitTimelineItem,
SourceControl,
SourceControlResourceGroup,
SourceControlResourceState,
TextEditor,
@ -45,6 +46,11 @@ export interface CommandGitTimelineItemContext extends CommandBaseContext {
readonly uri: Uri;
}
export interface CommandScmContext extends CommandBaseContext {
readonly type: 'scm';
readonly scm: SourceControl;
}
export interface CommandScmGroupsContext extends CommandBaseContext {
readonly type: 'scm-groups';
readonly scmResourceGroups: SourceControlResourceGroup[];
@ -183,6 +189,7 @@ export function isCommandContextViewNodeHasTag(
export type CommandContext =
| CommandGitTimelineItemContext
| CommandScmContext
| CommandScmGroupsContext
| CommandScmStatesContext
| CommandUnknownContext
@ -192,6 +199,17 @@ export type CommandContext =
| CommandViewNodeContext
| CommandViewNodesContext;
function isScm(scm: any): scm is SourceControl {
if (scm == null) return false;
return (
(scm as SourceControl).id != null &&
(scm as SourceControl).rootUri != null &&
(scm as SourceControl).inputBox != null &&
(scm as SourceControl).statusBarCommands != null
);
}
function isScmResourceGroup(group: any): group is SourceControlResourceGroup {
if (group == null) return false;
@ -278,16 +296,16 @@ export abstract class Command implements Disposable {
}
}
function parseCommandContext(
export function parseCommandContext(
command: string,
options: CommandContextParsingOptions,
options?: CommandContextParsingOptions,
...args: any[]
): [CommandContext | CommandContext[], any[]] {
let editor: TextEditor | undefined = undefined;
let firstArg = args[0];
if (options.expectsEditor) {
if (options?.expectsEditor) {
if (firstArg == null || (firstArg.id != null && firstArg.document?.uri != null)) {
editor = firstArg;
args = args.slice(1);
@ -376,6 +394,11 @@ function parseCommandContext(
return [{ command: command, type: 'timeline-item:git', item: item, uri: uri }, rest];
}
if (isScm(firstArg)) {
const [scm, ...rest] = args as [SourceControl, any];
return [{ command: command, type: 'scm', scm: scm }, rest];
}
return [{ command: command, type: 'unknown', editor: editor, uri: editor?.document.uri }, args];
}

+ 15
- 1
src/config.ts Zobrazit soubor

@ -378,9 +378,12 @@ export interface GraphColumnConfig {
}
export interface GraphConfig {
columnColors: string[];
defaultItemLimit: number;
pageItemLimit: number;
columnColors: string[];
statusBar: {
enabled: boolean;
};
}
export interface CodeLensConfig {
@ -441,7 +444,18 @@ export interface MenuConfig {
scm:
| false
| {
graph: boolean;
};
scmTitleInline:
| false
| {
graph: boolean;
};
scmTitle:
| false
| {
authors: boolean;
graph: boolean;
};
scmGroupInline:
| false

+ 70
- 8
src/plus/webviews/graph/graphWebview.ts Zobrazit soubor

@ -1,7 +1,8 @@
import type { CommitType } from '@gitkraken/gitkraken-components';
import { commitNodeType, mergeNodeType, stashNodeType } from '@gitkraken/gitkraken-components';
import type { ColorTheme, Disposable, Event } from 'vscode';
import { ColorThemeKind, EventEmitter, Uri, ViewColumn, window } from 'vscode';
import type { ColorTheme, ConfigurationChangeEvent, Disposable, Event, StatusBarItem } from 'vscode';
import { ColorThemeKind, EventEmitter, MarkdownString, StatusBarAlignment, Uri, ViewColumn, window } from 'vscode';
import { parseCommandContext } from '../../../commands/base';
import type { GraphColumnConfig } from '../../../configuration';
import { configuration } from '../../../configuration';
import { Commands } from '../../../constants';
@ -14,9 +15,10 @@ import type { GitLog } from '../../../git/models/log';
import type { GitRemote } from '../../../git/models/remote';
import type { Repository, RepositoryChangeEvent } from '../../../git/models/repository';
import type { GitTag } from '../../../git/models/tag';
import { RepositoryFolderNode } from '../../../views/nodes/viewNode';
import type { IpcMessage } from '../../../webviews/protocol';
import { onIpc } from '../../../webviews/protocol';
import { WebviewWithConfigBase } from '../../../webviews/webviewWithConfigBase';
import { WebviewBase } from '../../../webviews/webviewBase';
import { ensurePlusFeaturesEnabled } from '../../subscription/utils';
import type { GraphCommit, GraphCompositeConfig, GraphRemote, GraphRepository, State } from './protocol';
import {
@ -34,15 +36,17 @@ export interface GraphSelectionChangeEvent {
readonly selection: GitCommit[];
}
export class GraphWebview extends WebviewWithConfigBase<State> {
export class GraphWebview extends WebviewBase<State> {
private _onDidChangeSelection = new EventEmitter<GraphSelectionChangeEvent>();
get onDidChangeSelection(): Event<GraphSelectionChangeEvent> {
return this._onDidChangeSelection.event;
}
private _repositoryEventsDisposable: Disposable | undefined;
private _statusBarItem: StatusBarItem | undefined;
private selectedRepository?: Repository;
private currentLog?: GitLog;
private repoDisposable: Disposable | undefined;
private previewBanner?: boolean;
constructor(container: Container) {
@ -54,13 +58,39 @@ export class GraphWebview extends WebviewWithConfigBase {
'Commit Graph',
Commands.ShowGraphPage,
);
this.disposables.push({ dispose: () => void this.repoDisposable?.dispose() });
this.disposables.push(configuration.onDidChange(this.onConfigurationChanged, this), {
dispose: () => {
this._statusBarItem?.dispose();
void this._repositoryEventsDisposable?.dispose();
},
});
this.onConfigurationChanged();
}
override async show(column: ViewColumn = ViewColumn.Active, ...args: any[]): Promise<void> {
if (!(await ensurePlusFeaturesEnabled())) return;
void this.container.usage.track('graphWebview:shown');
if (this.container.git.repositoryCount > 1) {
const [contexts] = parseCommandContext(Commands.ShowGraphPage, undefined, ...args);
const context = Array.isArray(contexts) ? contexts[0] : contexts;
if (context.type === 'scm' && context.scm.rootUri != null) {
const repository = this.container.git.getRepository(context.scm.rootUri);
if (repository != null) {
this.selectedRepository = repository;
}
} else if (context.type === 'viewItem' && context.node instanceof RepositoryFolderNode) {
this.selectedRepository = context.node.repo;
}
if (this.selectedRepository != null) {
void this.refresh();
}
}
return super.show(column, ...args);
}
@ -104,6 +134,38 @@ export class GraphWebview extends WebviewWithConfigBase {
}
}
private onConfigurationChanged(e?: ConfigurationChangeEvent) {
if (configuration.changed(e, 'graph.statusBar.enabled') || configuration.changed(e, 'plusFeatures.enabled')) {
const enabled = configuration.get('graph.statusBar.enabled') && configuration.get('plusFeatures.enabled');
if (enabled) {
if (this._statusBarItem == null) {
this._statusBarItem = window.createStatusBarItem(
'gitlens.graph',
StatusBarAlignment.Left,
10000 - 3,
);
this._statusBarItem.name = 'GitLens Commit Graph';
this._statusBarItem.command = Commands.ShowGraphPage;
this._statusBarItem.text = '$(gitlens-graph)';
this._statusBarItem.tooltip = new MarkdownString(
'Visualize commits on the all-new Commit Graph ✨',
);
this._statusBarItem.accessibilityInformation = {
label: `Show the GitLens Commit Graph`,
};
}
this._statusBarItem.show();
} else {
this._statusBarItem?.dispose();
this._statusBarItem = undefined;
}
}
if (e != null && configuration.changed(e, 'graph')) {
void this.notifyDidChangeConfig();
}
}
private dismissPreview() {
this.previewBanner = false;
void this.container.storage.storeWorkspace('graph:preview', false);
@ -316,9 +378,9 @@ export class GraphWebview extends WebviewWithConfigBase {
if (this.selectedRepository === undefined) {
const idealRepo = this.pickRepository(repositories);
this.selectedRepository = idealRepo;
this.repoDisposable?.dispose();
this._repositoryEventsDisposable?.dispose();
if (this.selectedRepository != null) {
this.repoDisposable = this.selectedRepository.onDidChange(this.onRepositoryChanged, this);
this._repositoryEventsDisposable = this.selectedRepository.onDidChange(this.onRepositoryChanged, this);
}
}

+ 28
- 4
src/views/commitsView.ts Zobrazit soubor

@ -1,5 +1,5 @@
import type { CancellationToken, ConfigurationChangeEvent } from 'vscode';
import { Disposable, ProgressLocation, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { Disposable, ProgressLocation, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import type { CommitsViewConfig } from '../configuration';
import { configuration, ViewFilesLayout, ViewShowBranchComparison } from '../configuration';
import { Commands, ContextKeys, GlyphChars } from '../constants';
@ -16,8 +16,10 @@ import { executeCommand } from '../system/command';
import { gate } from '../system/decorators/gate';
import { debug } from '../system/decorators/log';
import { disposableInterval } from '../system/function';
import type { UsageChangeEvent } from '../usageTracker';
import { BranchNode } from './nodes/branchNode';
import { BranchTrackingStatusNode } from './nodes/branchTrackingStatusNode';
import { CommandMessageNode } from './nodes/common';
import { RepositoryNode } from './nodes/repositoryNode';
import type { ViewNode } from './nodes/viewNode';
import { RepositoriesSubscribeableNode, RepositoryFolderNode } from './nodes/viewNode';
@ -130,6 +132,19 @@ export class CommitsViewNode extends RepositoriesSubscribeableNode
);
}
const commitGraphNode =
configuration.get('plusFeatures.enabled') && this.view.container.usage.get('graphWebview:shown') == null
? new CommandMessageNode(
this.view,
this,
{ command: Commands.ShowGraphPage, title: 'Show Commit Graph' },
'Visualize commits on the all-new Commit Graph',
'✨ GitLens+',
'Visualize commits on the all-new Commit Graph ✨',
new ThemeIcon('gitlens-graph'),
)
: undefined;
if (this.children.length === 1) {
const [child] = this.children;
@ -143,10 +158,10 @@ export class CommitsViewNode extends RepositoriesSubscribeableNode
}${lastFetched ? ` ${GlyphChars.Dot} Last fetched ${Repository.formatLastFetched(lastFetched)}` : ''}`;
}
return child.getChildren();
return commitGraphNode == null ? child.getChildren() : [commitGraphNode, ...(await child.getChildren())];
}
return this.children;
return commitGraphNode == null ? this.children : [commitGraphNode, ...this.children];
}
getTreeItem(): TreeItem {
@ -164,6 +179,14 @@ export class CommitsView extends ViewBase {
constructor(container: Container) {
super('gitlens.views.commits', 'Commits', container);
this.disposables.push(container.usage.onDidChange(this.onUsageChanged, this));
}
private onUsageChanged(e: UsageChangeEvent | void) {
// Refresh the view if the graph usage state has changed, since we render a node for it before the first use
if (e == null || e.key === 'graphWebview:shown') {
void this.refresh();
}
}
override get canReveal(): boolean {
@ -256,7 +279,8 @@ export class CommitsView extends ViewBase {
!configuration.changed(e, 'defaultDateSource') &&
!configuration.changed(e, 'defaultDateStyle') &&
!configuration.changed(e, 'defaultGravatarsStyle') &&
!configuration.changed(e, 'defaultTimeFormat')
!configuration.changed(e, 'defaultTimeFormat') &&
!configuration.changed(e, 'plusFeatures.enabled')
) {
return false;
}

+ 80
- 3
src/webviews/apps/settings/partials/menus.html Zobrazit soubor

@ -333,14 +333,91 @@
<div class="setting" data-enablement="menus.scm">
<div class="setting__input">
<input
id="menus.scm.authors"
name="menus.scm.authors"
id="menus.scm.graph"
name="menus.scm.graph"
type="checkbox"
data-setting
data-setting-type="object"
disabled
/>
<label for="menus.scm.authors">Add <i>Add Co-authors</i> command</label>
<label for="menus.scm.graph">Add <i>Show Commit Graph</i> command</label>
</div>
</div>
</div>
<div class="setting setting--expandable" data-enablement="menus">
<div class="setting__input">
<div class="setting__expander"></div>
<input
id="menus.scmRepositoryInline"
name="menus.scmRepositoryInline"
type="checkbox"
value="undefined"
data-setting
data-setting-type="object"
disabled
/>
<label for="menus.scmRepositoryInline">Add to the Source Control repository toolbar</label>
</div>
</div>
<div class="settings ml-4">
<div class="setting" data-enablement="menus.scmRepositoryInline">
<div class="setting__input">
<input
id="menus.scmRepositoryInline.graph"
name="menus.scmRepositoryInline.graph"
type="checkbox"
data-setting
data-setting-type="object"
disabled
/>
<label for="menus.scmRepositoryInline.graph">Add <i>Show Commit Graph</i> command</label>
</div>
</div>
</div>
<div class="setting setting--expandable" data-enablement="menus">
<div class="setting__input">
<div class="setting__expander"></div>
<input
id="menus.scmRepository"
name="menus.scmRepository"
type="checkbox"
value="undefined"
data-setting
data-setting-type="object"
disabled
/>
<label for="menus.scmRepository">Add to the Source Control repository context menu</label>
</div>
</div>
<div class="settings ml-4">
<div class="setting" data-enablement="menus.scmRepository">
<div class="setting__input">
<input
id="menus.scmRepository.authors"
name="menus.scmRepository.authors"
type="checkbox"
data-setting
data-setting-type="object"
disabled
/>
<label for="menus.scmRepository.authors">Add <i>Add Co-authors</i> command</label>
</div>
</div>
<div class="setting" data-enablement="menus.scmRepository">
<div class="setting__input">
<input
id="menus.scmRepository.graph"
name="menus.scmRepository.graph"
type="checkbox"
data-setting
data-setting-type="object"
disabled
/>
<label for="menus.scmRepository.graph">Add <i>Show Commit Graph</i> command</label>
</div>
</div>
</div>

+ 1
- 1
src/webviews/apps/shared/glicons.scss Zobrazit soubor

@ -1,7 +1,7 @@
@font-face {
font-family: 'glicons';
font-display: block;
src: url("./glicons.woff2?7c1fcbaed5f09c54558dcca7d79320a6") format("woff2");
src: url("./glicons.woff2?649cd5c77eb3632ea56d58730da557f0") format("woff2");
}
.glicon {

Načítá se…
Zrušit
Uložit