@gitkraken/gitkraken-components 13.0.0-vnext.15 → 13.0.0-vnext.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import type { Alignment, GridCellRangeRenderer } from 'react-virtualized';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { GraphMarkerType, GraphZone, GraphZoneType } from '../../domain/graph/GraphConstants';
4
- import type { ColumnContentGenerator, GetExternalIcon, GraphMarkerColors, GraphMarkerRowIndices, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnScrollForZone, RowRenderersByIds } from '../../domain/graph/GraphTypes';
4
+ import type { ColumnContentGenerator, GetExternalIcon, GraphMarkerColors, GraphMarkerRowIndices, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnScrollForZone, ProcessedGraphRow, RowRenderersByIds } from '../../domain/graph/GraphTypes';
5
5
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
6
6
  import type { GetRealKeyForCellFunc } from '../../domain/reactvirtualized/ReactVirtualizedHelpers';
7
7
  import type { OnMouseEnter } from '../../domain/ui/UiTypes';
@@ -32,13 +32,15 @@ type GraphColumnProps = {
32
32
  onScrollToRowCausedUpdate?: OnScrollForZone;
33
33
  onZoneEnter: OnMouseEnter;
34
34
  cellRenderersByIds: RowRenderersByIds;
35
+ processedRows?: ProcessedGraphRow[];
35
36
  scrollToAlignment?: Alignment;
36
37
  scrollToIndex?: number;
37
38
  scrollLeft: number;
38
39
  scrollTop: number;
39
40
  smartCellRangeRenderer: GridCellRangeRenderer;
41
+ stickyTimeline?: boolean;
40
42
  translate: TranslationFn;
41
43
  verticalScrollWidth: number;
42
44
  };
43
- export declare function GraphColumn({ branchUpstreamRowIndices, rowCount, cellRenderersByIds, columnIndex, customFooterRow, enabledScrollMarkerTypes, enableResizer, getExternalIcon, getKeyForCell, graphHeight, graphWidth, graphZoneType, graphZones, hasMoreCommits, horizontalScrollHeight, isCommitListFiltered, isLoadingRows, markerColors, markerRowIndices, onResize, onResizeEnd, onResizeFromPropChange, onScroll, onScrollToRowCausedUpdate, onZoneEnter, scrollLeft, scrollToAlignment, scrollToIndex, scrollTop, smartCellRangeRenderer, translate, verticalScrollWidth, }: GraphColumnProps): ReactElement<any> | null;
45
+ export declare function GraphColumn({ branchUpstreamRowIndices, rowCount, cellRenderersByIds, columnIndex, customFooterRow, enabledScrollMarkerTypes, enableResizer, getExternalIcon, getKeyForCell, graphHeight, graphWidth, graphZoneType, graphZones, hasMoreCommits, horizontalScrollHeight, isCommitListFiltered, isLoadingRows, markerColors, markerRowIndices, onResize, onResizeEnd, onResizeFromPropChange, onScroll, onScrollToRowCausedUpdate, onZoneEnter, processedRows, scrollLeft, scrollToAlignment, scrollToIndex, scrollTop, smartCellRangeRenderer, stickyTimeline, translate, verticalScrollWidth, }: GraphColumnProps): ReactElement<any> | null;
44
46
  export {};
@@ -5,7 +5,7 @@ import type { Sha } from '../../domain/commit/CommitTypes';
5
5
  import type { CssVariables } from '../../domain/generic/GenericTypes';
6
6
  import type { GraphCommitDescDisplayMode, GraphMarkerType, GraphSearchMode, GraphZone, GraphZoneType, ShiftSelectMode } from '../../domain/graph/GraphConstants';
7
7
  import type { ThrottledFn } from '../../domain/graph/GraphHelpers';
8
- import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, EdgeByColumn, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, FormatCommitMessage, FormatRefShorthand, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRow, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, IsRefShorthandValid, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickGraphRef, OnClickGraphRow, OnClickRef, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickGraphRef, OnDoubleClickGraphRow, OnDoubleClickRef, OnEmailsMissingAvatarUrls, OnFilterColumnClick, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphColumnResized, OnGraphColumnsReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphRefNodeHovered, OnGraphRefNodeUnhovered, OnGraphResized, OnGraphRowHovered, OnGraphRowUnhovered, OnGraphScrollForZone, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnLoadSelectedGraphRow, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefContextMenu, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefsMissingMetadata, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnRowContextMenu, OnScrollForZone, OnSelectGraphRows, OnSettingsClick, OnShowMoreCommits, OnToggleRefNodesShown, OnToggleRefsVisibilityClick, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, RefMetadataById, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowEdges, RowStats, RowStatsConstraints, ShaByRefId, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
8
+ import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, EdgeByColumn, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, FormatCommitMessage, FormatRefShorthand, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRow, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, IsRefShorthandValid, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickGraphRef, OnClickGraphRow, OnClickRef, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickGraphRef, OnDoubleClickGraphRow, OnDoubleClickRef, OnEmailsMissingAvatarUrls, OnFilterColumnClick, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphColumnResized, OnGraphColumnsReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphRefNodeHovered, OnGraphRefNodeUnhovered, OnGraphResized, OnGraphRowHovered, OnGraphRowUnhovered, OnGraphScrollForZone, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnLoadSelectedGraphRow, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefContextMenu, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefsMissingMetadata, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnRowContextMenu, OnScrollForZone, OnSelectGraphRows, OnSettingsClick, OnShowMoreCommits, OnToggleRefNodesShown, OnToggleRefsVisibilityClick, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, ReadonlyGraphRow, RefMetadataById, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowEdges, RowStats, RowStatsConstraints, ShaByRefId, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
9
9
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
10
10
  import type { CreateRefFormData, RefIconsPosition } from '../../domain/ref/RefTypes';
11
11
  import type { OnBlur, OnKeyDown, OnKeyUp, OnMouseDown, OnResizeParams } from '../../domain/ui/UiTypes';
@@ -41,9 +41,11 @@ export interface StateProps {
41
41
  enabledScrollMarkerTypes?: GraphMarkerType[];
42
42
  scrollRowPadding?: number;
43
43
  enableMultiSelection?: boolean;
44
+ stickyTimeline?: boolean;
44
45
  graphCommitDescDisplayMode?: GraphCommitDescDisplayMode;
45
46
  graphRows: GraphRow[];
46
47
  hasMoreCommits?: boolean;
48
+ hasMoreSearchResults?: boolean;
47
49
  highlightedShas?: HighlightedShas;
48
50
  excludeByType?: ExcludeByType;
49
51
  excludeRefsById?: ExcludeRefsById;
@@ -282,6 +284,13 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
282
284
  onRefZoneUnhovered: OnRefZoneUnhovered;
283
285
  onShowMoreCommits: OnShowMoreCommits;
284
286
  onScrollForZone: OnScrollForZone;
287
+ /**
288
+ * Checks if there are still highlighted commits that haven't been found yet,
289
+ * OR if there are more search results available to load.
290
+ * Used in filter mode to determine if we should continue loading more commits.
291
+ * @returns true if there are unfound highlighted commits or more search results available, false otherwise
292
+ */
293
+ private hasUnfoundHighlightedCommits;
285
294
  loadMoreCommitsIfNecessary(graphHeight: number, hasMoreCommits: boolean): void;
286
295
  private shouldAutoLoadToFillViewport;
287
296
  private autoLoadToFillViewport;
@@ -295,7 +304,22 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
295
304
  private isSelectedByShaEqual;
296
305
  private _pendingRowsUpdate;
297
306
  private _selectionVersion;
298
- selectCommits(shas: Sha[], includeToPrevSel: boolean, isAutoOrKeyScroll: boolean): void;
307
+ /**
308
+ * Gets commits rows by SHA
309
+ *
310
+ * @param shas - Array of commit SHAs to get
311
+ * @returns Array of ReadonlyGraphRow objects
312
+ */
313
+ getCommits(shas: Sha[]): ReadonlyGraphRow[];
314
+ /**
315
+ * Selects commits in the graph
316
+ *
317
+ * @param shas - Array of commit SHAs to select
318
+ * @param includeToPrevSel - If true, toggle selection; if false, replace selection
319
+ * @param isAutoOrKeyScroll - Whether this is an auto-scroll or keyboard navigation
320
+ * @returns Array of selected ReadonlyGraphRow objects
321
+ */
322
+ selectCommits(shas: Sha[], includeToPrevSel: boolean, isAutoOrKeyScroll: boolean): ReadonlyGraphRow[];
299
323
  getCommitZoneContentWidthBetweenGutters(): number;
300
324
  getExcludeRemotesByName(): ExcludeRemotesByName;
301
325
  getIncludeOnlyRemotesByName(): IncludeOnlyRemotesByName;
@@ -0,0 +1,10 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ProcessedGraphRow } from '../../../domain/graph/GraphTypes';
3
+ import type { TranslationFn } from '../../../domain/language/LanguageTypes';
4
+ interface StickyTimelineProps {
5
+ processedRows: ProcessedGraphRow[];
6
+ scrollTop: number;
7
+ translate: TranslationFn;
8
+ }
9
+ export declare function StickyTimeline({ processedRows, scrollTop, translate }: StickyTimelineProps): ReactElement | null;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { ReactElement } from 'react';
2
+ interface TimelineMessageProps {
3
+ message: string;
4
+ }
5
+ export declare function TimelineMessage({ message }: TimelineMessageProps): ReactElement;
6
+ export {};
@@ -70,8 +70,20 @@ export declare const commitAuthorZone: CommitAuthorZoneType;
70
70
  export declare const commitDateTimeZone: CommitDateTimeZoneType;
71
71
  export declare const commitShaZone: CommitShaZoneType;
72
72
  export declare const changesZone: ChangesZoneType;
73
- /** A special sha used to indicate that the graph should be highlighted but there are no rows to highlight */
74
- export declare const noShaHighlightedSha = "no-sha-highlighted";
73
+ /**
74
+ * A sentinel key used as a key in objects to indicate "empty set" state
75
+ * This distinguishes between:
76
+ * - `{}` (empty object) - no filtering applied or null/undefined
77
+ * - `{ [emptySetMarker]: true }` - filtering applied but yielded no results
78
+ *
79
+ * Example usage:
80
+ * ```typescript
81
+ * const highlightedShas = searchResults.count === 0
82
+ * ? { [emptySetMarker]: true } // No results found
83
+ * : searchResults.ids; // Results found
84
+ * ```
85
+ */
86
+ export declare const emptySetMarker = "gk.empty-set-marker";
75
87
  export declare enum GraphColumnMode {
76
88
  Compact = "compact",
77
89
  Rich = "rich",
@@ -4,7 +4,7 @@ import type { CssVariables } from '../generic/GenericTypes';
4
4
  import type { GetRealKeyForCellFunc } from '../reactvirtualized/ReactVirtualizedHelpers';
5
5
  import type { GraphRefType } from '../ref/RefTypes';
6
6
  import type { WorkDirStats } from '../workdir/WorkDirTypes';
7
- import type { GraphMarkerType, GraphZone, GraphZoneType, TimelineEntriesByPeriod } from './GraphConstants';
7
+ import type { GraphMarkerType, GraphZone, GraphZoneType, TimelineEntry } from './GraphConstants';
8
8
  import { GraphColumnMode } from './GraphConstants';
9
9
  import type { BaseMetadata, ExternalIconKeys, GetMissingRefMetadata, GraphColumnWidthConstraints, GraphItemContext, GraphRef, GraphRefGroup, GraphRow, GraphZoneModeConstants, Head, HighlightedShas, ProcessedGraphRow, ProcessedGraphRowBySha, Ref, RefMetadata, RefMetadataById, RefMetadataType, RowStatsConstraints } from './GraphTypes';
10
10
  export type DebouncableFn = (...args: any) => void;
@@ -18,7 +18,22 @@ export declare function hasScrolledToRight(htmlElement: HTMLElement): boolean;
18
18
  export declare function parseContext(context?: GraphItemContext | null): string | null;
19
19
  export declare function getRowStatsConstraints(stats: number[]): RowStatsConstraints;
20
20
  export declare function getOrAskForRefMetadata(ref: GraphRef, refMetadata: RefMetadataById | undefined, onMissingRefMetadata: GetMissingRefMetadata, refMetadataType?: RefMetadataType): RefMetadata | BaseMetadata | BaseMetadata[] | null | undefined;
21
- export declare function getTimelineEntriesByPeriod(): TimelineEntriesByPeriod;
21
+ export declare function getTimelineLabelAndValue(diffMs: number): {
22
+ label: string;
23
+ value: number;
24
+ };
25
+ export declare function getTimelineEntriesByPeriod(): TimelineEntry[];
26
+ /**
27
+ * Assigns timeline entries to graph rows based on commit dates.
28
+ *
29
+ * Timeline markers act as boundaries between time periods:
30
+ * - All commits above a marker must be younger (more recent) than the marker time
31
+ * - All commits at and below a marker must be equal to or older than the marker time
32
+ *
33
+ * @param orderedRows - Array of graph rows ordered from newest to oldest
34
+ * @param entries - Array of timeline entries ordered from newest to oldest
35
+ */
36
+ export declare function assignTimelineEntriesToRows(orderedRows: ProcessedGraphRow[], entries: TimelineEntry[]): void;
22
37
  export declare function getRefIdByBaseRef(refType: GraphRefType, ref: Ref): string;
23
38
  export declare function getRefIdByGraphRef(ref: GraphRef): string;
24
39
  export declare function getLastShrinkableGraphZone(activeGraphZones: GraphZone[], stoppingIndex?: number): GraphZone | undefined;
@@ -70,6 +85,7 @@ export interface GraphRowHelperProps {
70
85
  selectedShas: Set<Sha>;
71
86
  processedRows: ProcessedGraphRow[];
72
87
  processedGraphRowBySha: ProcessedGraphRowBySha;
88
+ scrollTop: number;
73
89
  alwaysShowTimelines?: boolean;
74
90
  }
75
91
  export declare class GraphRowHelper {
@@ -313,6 +313,14 @@ export interface GraphRefsData {
313
313
  orderedRefGroups: GraphRefGroup[];
314
314
  refGroupsByName: GraphRefGroupsByName;
315
315
  }
316
+ type ReadonlyDeep<T> = T extends Record<string, unknown> ? {
317
+ readonly [K in keyof T]: ReadonlyDeep<T[K]>;
318
+ } : T extends Array<infer U> ? ReadonlyArray<ReadonlyDeep<U>> : T;
319
+ export interface ReadonlyGraphRow extends ReadonlyDeep<GraphRow> {
320
+ readonly hasRefs?: boolean;
321
+ /** Whether the row is hidden from the graph (filtered out by type or other filters). Output only */
322
+ readonly hidden: boolean;
323
+ }
316
324
  export interface ProcessedGraphRow extends GraphRow {
317
325
  rowIndex?: number;
318
326
  column: number;
@@ -322,6 +330,8 @@ export interface ProcessedGraphRow extends GraphRow {
322
330
  edges: RowEdges;
323
331
  edgeColumnMaxes: number;
324
332
  hasRefs?: boolean;
333
+ /** Whether the row is hidden from the graph (filtered out by type or other filters). Output only */
334
+ hidden: boolean;
325
335
  summary: string;
326
336
  body?: string;
327
337
  timeLineEntry?: TimelineEntry;
@@ -465,7 +475,7 @@ export type OnDoubleClickGraphRef = (event: React.MouseEvent<any>, refGroup: Gra
465
475
  export type OnRowContextMenu = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
466
476
  export type OnRefContextMenu = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
467
477
  export type OnToggleRefsVisibilityClick = (event: React.MouseEvent<any>, refs: GraphRefOptData[], visible: boolean, graphRow?: GraphRow) => void;
468
- export type OnSelectGraphRows = (selectedRows: GraphRow[]) => void;
478
+ export type OnSelectGraphRows = (selectedRows: ReadonlyGraphRow[]) => void;
469
479
  export type OnGraphRowHovered = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
470
480
  export type OnGraphRowUnhovered = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
471
481
  export type OnGraphRefNodeHovered = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
@@ -476,3 +486,4 @@ export type OnGraphColumnResized = (graphZoneType: GraphZoneType, columnSettings
476
486
  export type OnShowMoreCommits = () => void;
477
487
  export type OnEmailsMissingAvatarUrls = (emails: AvatarUrlByEmail) => void;
478
488
  export type OnRefsMissingMetadata = (refs: RefsMissingMetadata) => void;
489
+ export {};
@@ -41,6 +41,7 @@ export declare class ProcessedGraphRowObj implements ProcessedGraphRow {
41
41
  get tags(): Tag[];
42
42
  get hasRefs(): boolean;
43
43
  get hasChildRefs(): boolean;
44
+ get hidden(): boolean;
44
45
  get refsData(): GraphRefsData | undefined;
45
46
  constructor(graphContainer: IGraphContainer, row: GraphRow, column?: number, edgeColumnMaxes?: number, edges?: RowEdges, childRefs?: ChildRefsByType, timeLineEntry?: TimelineEntry, columnForColoring?: number);
46
47
  private initializeRefGroups;