Eric Amodio há 2 anos
ascendente
cometimento
ab4796c3b3
4 ficheiros alterados com 39 adições e 26 eliminações
  1. +19
    -17
      src/env/node/git/localGitProvider.ts
  2. +14
    -2
      src/git/models/reference.ts
  3. +3
    -6
      src/plus/webviews/graph/graphWebview.ts
  4. +3
    -1
      src/webviews/apps/plus/graph/graph.tsx

+ 19
- 17
src/env/node/git/localGitProvider.ts Ver ficheiro

@ -1893,23 +1893,25 @@ export class LocalGitProvider implements GitProvider, Disposable {
}),
},
}),
contextGroup: groupedRefs.length > 0
? serializeWebviewItemContext<GraphItemRefContext>({
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<GraphItemRefContext>({
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,
});
}
}

+ 14
- 2
src/git/models/reference.ts Ver ficheiro

@ -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' },

+ 3
- 6
src/plus/webviews/graph/graphWebview.ts Ver ficheiro

@ -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<string, GraphHiddenRef> | undefined
hiddenRefs: Record<string, GraphHiddenRef> | undefined,
): Promise<GraphHiddenRefs | undefined> {
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) {

+ 3
- 1
src/webviews/apps/plus/graph/graph.tsx Ver ficheiro

@ -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<GraphApp['onRepositorySelectionChanged']>(
path => this.onRepositorySelectionChanged(path),
250,

Carregando…
Cancelar
Guardar