diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 9f34b64..6929a36 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -1893,23 +1893,25 @@ export class LocalGitProvider implements GitProvider, Disposable { }), }, }), - contextGroup: groupedRefs.length > 0 - ? serializeWebviewItemContext({ - webviewItem: `gitlens:branch+grouped${head ? '+current' : ''}${ - branch?.upstream != null ? '+tracking' : '' - }`, - webviewItemValue: { - type: 'branch', - ref: GitReference.create(tip, repoPath, { - id: branchId, - refType: 'branch', - name: tip, - remote: false, - upstream: branch?.upstream, - groupedRefs: groupedRefs, - }), - }, - }) : undefined, + contextGroup: + groupedRefs.length > 0 + ? serializeWebviewItemContext({ + webviewItem: `gitlens:branch+grouped${head ? '+current' : ''}${ + branch?.upstream != null ? '+tracking' : '' + }`, + webviewItemValue: { + type: 'branch', + ref: GitReference.create(tip, repoPath, { + id: branchId, + refType: 'branch', + name: tip, + remote: false, + upstream: branch?.upstream, + groupedRefs: groupedRefs, + }), + }, + }) + : undefined, }); } } diff --git a/src/git/models/reference.ts b/src/git/models/reference.ts index d23de17..cc86daf 100644 --- a/src/git/models/reference.ts +++ b/src/git/models/reference.ts @@ -144,7 +144,12 @@ export interface GitTagReference { repoPath: string; } -export type GitReference = GitBranchReference | GraphGitBranchReference | GitRevisionReference | GitStashReference | GitTagReference; +export type GitReference = + | GitBranchReference + | GraphGitBranchReference + | GitRevisionReference + | GitStashReference + | GitTagReference; export namespace GitReference { export function create( @@ -179,7 +184,14 @@ export namespace GitReference { ref: string, repoPath: string, options: - | { id?: string; refType: 'branch'; name: string; remote: boolean; avatarUrl?: string; groupedRefs?: GitReference[] } + | { + id?: string; + refType: 'branch'; + name: string; + remote: boolean; + avatarUrl?: string; + groupedRefs?: GitReference[]; + } | { refType?: 'revision'; name?: string; message?: string } | { refType: 'stash'; name: string; number: string | undefined; message?: string } | { id?: string; refType: 'tag'; name: string } = { refType: 'revision' }, diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 0d93fd3..f93d7b2 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -1,4 +1,4 @@ -import type { GraphRefType} from '@gitkraken/gitkraken-components'; +import type { GraphRefType } from '@gitkraken/gitkraken-components'; import type { ColorTheme, ConfigurationChangeEvent, @@ -1125,7 +1125,7 @@ export class GraphWebview extends WebviewBase { } private async getHiddenRefsById( - hiddenRefs: Record | undefined + hiddenRefs: Record | undefined, ): Promise { if (hiddenRefs == null) return undefined; @@ -1629,10 +1629,7 @@ export class GraphWebview extends WebviewBase { if (isGraphItemRefContext(item)) { const { ref } = item.webviewItemValue; const groupedRefs: GitReference[] = (ref as any).groupedRefs ?? []; - const refsToHide: GitReference[] = [ - ...groupedRefs, - ref - ]; + const refsToHide: GitReference[] = [...groupedRefs, ref]; const graphHiddenRefs: GraphHiddenRef[] = []; for (const refToHide of refsToHide) { diff --git a/src/webviews/apps/plus/graph/graph.tsx b/src/webviews/apps/plus/graph/graph.tsx index 037213a..d5ceae8 100644 --- a/src/webviews/apps/plus/graph/graph.tsx +++ b/src/webviews/apps/plus/graph/graph.tsx @@ -87,7 +87,9 @@ export class GraphApp extends App { (name, settings) => this.onColumnChanged(name, settings), 250, )} - onRefsVisibilityChange={(refs: GraphHiddenRef[], visible: boolean) => this.onRefsVisibilityChanged(refs, visible)} + onRefsVisibilityChange={(refs: GraphHiddenRef[], visible: boolean) => + this.onRefsVisibilityChanged(refs, visible) + } onSelectRepository={debounce( path => this.onRepositorySelectionChanged(path), 250,