@gitkraken/gitkraken-components 13.0.0-vnext.2 → 13.0.0-vnext.27

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.
Files changed (48) hide show
  1. package/README.md +2 -0
  2. package/dist/components/dnd/DndComponent.d.ts +1 -1
  3. package/dist/components/dnd/DndContainer.d.ts +1 -1
  4. package/dist/components/graph/GraphColumn.d.ts +5 -2
  5. package/dist/components/graph/GraphContainer.d.ts +211 -21
  6. package/dist/components/graph/GraphHeaderRow.d.ts +5 -1
  7. package/dist/components/graph/GraphScrollMarker.d.ts +1 -1
  8. package/dist/components/graph/commitzone/CommitNode.d.ts +1 -1
  9. package/dist/components/graph/commitzone/CommitZone.d.ts +1 -1
  10. package/dist/components/graph/commitzone/GraphAvatar.d.ts +1 -1
  11. package/dist/components/graph/commitzone/edges/Edges.d.ts +1 -1
  12. package/dist/components/graph/common/DraggableGraphHeader.d.ts +1 -1
  13. package/dist/components/graph/common/GenericGraphZone.d.ts +1 -1
  14. package/dist/components/graph/common/ScrollbarContainer.d.ts +1 -1
  15. package/dist/components/graph/common/StickyTimeline.d.ts +10 -0
  16. package/dist/components/graph/common/TimelineMessage.d.ts +6 -0
  17. package/dist/components/graph/messagezone/WorkDirMessageInput.d.ts +1 -1
  18. package/dist/components/graph/refzone/CreateRefNode.d.ts +1 -1
  19. package/dist/components/graph/refzone/RefNode.d.ts +2 -1
  20. package/dist/components/graph/refzone/RefNodes.d.ts +2 -1
  21. package/dist/components/graph/refzone/RefZone.d.ts +4 -1
  22. package/dist/components/graph/rowAdornment/RowAdornmentLayer.d.ts +52 -0
  23. package/dist/components/graph/rowAdornment/RowAdornmentOverlay.d.ts +19 -0
  24. package/dist/components/graph/rowRenderers/CommitsInfoRow.d.ts +1 -1
  25. package/dist/components/graph/rowRenderers/RefZoneRow.d.ts +1 -0
  26. package/dist/components/graph/shared/Avatar.d.ts +1 -1
  27. package/dist/components/graph/shared/FileDiffTypeIcon.d.ts +2 -1
  28. package/dist/components/graph/shared/WipStatsPill.d.ts +11 -0
  29. package/dist/components/resizable/Resizable.d.ts +2 -7
  30. package/dist/domain/generic/GenericTypes.d.ts +6 -0
  31. package/dist/domain/graph/GraphConstants.d.ts +15 -1
  32. package/dist/domain/graph/GraphHelpers.d.ts +21 -5
  33. package/dist/domain/graph/GraphTypes.d.ts +29 -8
  34. package/dist/domain/graph/row/ProcessedGraphRowObj.d.ts +4 -4
  35. package/dist/domain/graph/rowAdornment/RowAdornmentTypes.d.ts +97 -0
  36. package/dist/domain/hostingservice/HostingServiceTypes.d.ts +3 -1
  37. package/dist/domain/reactvirtualized/ReactVirtualizedHelpers.d.ts +1 -1
  38. package/dist/domain/ref/RefConstants.d.ts +4 -1
  39. package/dist/domain/ref/RefTypes.d.ts +1 -1
  40. package/dist/index.d.ts +16 -1
  41. package/dist/index.js +21 -2
  42. package/dist/styles.css +1 -1
  43. package/dist/types.d.ts +1 -0
  44. package/dist/utils/ObjectUtils.d.ts +29 -0
  45. package/package.json +100 -93
  46. package/CHANGELOG.md +0 -15
  47. package/ThirdPartyNotices.txt +0 -227
  48. package/dist/types.js +0 -1
package/README.md CHANGED
@@ -3,10 +3,12 @@
3
3
  This is a shared module between the GitKraken app and GitLens to share React components.
4
4
 
5
5
  ## Requires resolution to React 17
6
+
6
7
  > [!WARNING]
7
8
  > In order for this package to work properly, you must resolve React to version 17 in your own project.
8
9
  > The reason for this is because this library's react-bootstrap dependency lists React 16 as a dependency, and npm/yarn 1 do not provide a way for dependencies to lock sub-dependencies. Therefore it is up to your project to force this library's react-bootstrap to use react 17.
9
10
  > The following is an example of what to put into your package.json:
11
+
10
12
  ```
11
13
  "resolutions": {
12
14
  "react": "17.0.2",
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  export type DndCanDrag = (sourceData?: any) => boolean;
4
4
  export type DndOnBeginDrag = (event: React.DragEvent, sourceData?: any) => void;
5
5
  export type DndOnDragEnter = (event: React.DragEvent, sourceData?: any, targetData?: any) => void;
@@ -1,6 +1,6 @@
1
1
  import type { Drake } from 'dragula';
2
2
  import type { ReactElement, ReactNode } from 'react';
3
- import React from 'react';
3
+ import * as React from 'react';
4
4
  export type DndDirection = 'vertical' | 'horizontal';
5
5
  export type DndIsDraggable = (source: ReactElement<any>) => boolean;
6
6
  export type DndIsDroppable = (source: ReactElement<any>, target: ReactElement<any>) => boolean;
@@ -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';
@@ -20,6 +20,7 @@ type GraphColumnProps = {
20
20
  graphZones: GraphZone[];
21
21
  hasMoreCommits: boolean;
22
22
  horizontalScrollHeight: number;
23
+ isFilteredSearch: boolean;
23
24
  isLoadingRows: boolean;
24
25
  markerColors: GraphMarkerColors;
25
26
  markerRowIndices: GraphMarkerRowIndices;
@@ -31,13 +32,15 @@ type GraphColumnProps = {
31
32
  onScrollToRowCausedUpdate?: OnScrollForZone;
32
33
  onZoneEnter: OnMouseEnter;
33
34
  cellRenderersByIds: RowRenderersByIds;
35
+ processedRows?: ProcessedGraphRow[];
34
36
  scrollToAlignment?: Alignment;
35
37
  scrollToIndex?: number;
36
38
  scrollLeft: number;
37
39
  scrollTop: number;
38
40
  smartCellRangeRenderer: GridCellRangeRenderer;
41
+ stickyTimeline?: boolean;
39
42
  translate: TranslationFn;
40
43
  verticalScrollWidth: number;
41
44
  };
42
- export declare function GraphColumn({ branchUpstreamRowIndices, rowCount, cellRenderersByIds, columnIndex, customFooterRow, enabledScrollMarkerTypes, enableResizer, getExternalIcon, getKeyForCell, graphHeight, graphWidth, graphZoneType, graphZones, hasMoreCommits, horizontalScrollHeight, 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, isFilteredSearch, isLoadingRows, markerColors, markerRowIndices, onResize, onResizeEnd, onResizeFromPropChange, onScroll, onScrollToRowCausedUpdate, onZoneEnter, processedRows, scrollLeft, scrollToAlignment, scrollToIndex, scrollTop, smartCellRangeRenderer, stickyTimeline, translate, verticalScrollWidth, }: GraphColumnProps): ReactElement<any> | null;
43
46
  export {};
@@ -1,20 +1,29 @@
1
- /// <reference types="node" />
2
1
  import type { Alignment, ScrollParams } from 'react-virtualized';
3
2
  import type { ReactElement } from 'react';
4
- import React from 'react';
3
+ import * as React from 'react';
5
4
  import type { Sha } from '../../domain/commit/CommitTypes';
6
5
  import type { CssVariables } from '../../domain/generic/GenericTypes';
7
6
  import type { GraphCommitDescDisplayMode, GraphMarkerType, GraphSearchMode, GraphZone, GraphZoneType, ShiftSelectMode } from '../../domain/graph/GraphConstants';
8
7
  import type { ThrottledFn } from '../../domain/graph/GraphHelpers';
9
- 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
+ import type { RowAdornmentProvider } from '../../domain/graph/rowAdornment/RowAdornmentTypes';
10
10
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
11
11
  import type { CreateRefFormData, RefIconsPosition } from '../../domain/ref/RefTypes';
12
- import type { OnBlur, OnKeyDown, OnKeyUp, OnMouseDown, OnResizeParams } from '../../domain/ui/UiTypes';
12
+ import type { OnKeyDown, OnKeyUp, OnMouseDown, OnResizeParams } from '../../domain/ui/UiTypes';
13
13
  import type { WorkDirStats } from '../../domain/workdir/WorkDirTypes';
14
14
  import type { IGraphContainer } from './IGraphContainer';
15
15
  type ClearScrollToIndex = () => void;
16
16
  type OnZoneEnter = (e: React.MouseEvent<any>, zoneType: GraphZoneType, hoveredRefGroup?: GraphRefGroup, hoveredSha?: Sha) => void;
17
17
  type OnGraphContainerBlurred = (event: React.FocusEvent<any>, hoveredRefGroup?: GraphRefGroup, hoveredSha?: Sha) => void;
18
+ /**
19
+ * Options for the public selectCommits method.
20
+ */
21
+ export interface SelectCommitsOptions {
22
+ /** If true, toggle selection; if false, replace selection. Default: false */
23
+ toggle?: boolean;
24
+ /** If true, scroll to ensure the focused commit is visible. Default: false */
25
+ ensureVisible?: boolean;
26
+ }
18
27
  interface OwnProps {
19
28
  formatCommitDateTime?: OnFormatCommitDateTime;
20
29
  formatCommitMessage?: FormatCommitMessage;
@@ -42,9 +51,11 @@ export interface StateProps {
42
51
  enabledScrollMarkerTypes?: GraphMarkerType[];
43
52
  scrollRowPadding?: number;
44
53
  enableMultiSelection?: boolean;
54
+ stickyTimeline?: boolean;
45
55
  graphCommitDescDisplayMode?: GraphCommitDescDisplayMode;
46
56
  graphRows: GraphRow[];
47
57
  hasMoreCommits?: boolean;
58
+ hasMoreSearchResults?: boolean;
48
59
  highlightedShas?: HighlightedShas;
49
60
  excludeByType?: ExcludeByType;
50
61
  excludeRefsById?: ExcludeRefsById;
@@ -68,6 +79,11 @@ export interface StateProps {
68
79
  rowsStatsLoading?: boolean;
69
80
  wipMessageEditable?: boolean;
70
81
  workDirStats?: WorkDirStats;
82
+ /**
83
+ * Provider for row adornments.
84
+ * Graph subscribes to invalidate events and calls provide/resolve as needed.
85
+ */
86
+ rowAdornmentProvider?: RowAdornmentProvider;
71
87
  }
72
88
  export interface DispatchProps {
73
89
  onDoubleClickGraphRef?: OnDoubleClickGraphRef;
@@ -165,6 +181,7 @@ type HasMergeNodeChildBySha = {
165
181
  [sha: Sha]: boolean;
166
182
  };
167
183
  declare class GraphContainer extends React.Component<Props, ComponentState> implements IGraphContainer {
184
+ static getDerivedStateFromProps(props: Props, state: ComponentState): Partial<ComponentState> | null;
168
185
  private graphComponentRef;
169
186
  private graphContainerRef;
170
187
  private resizeObserver;
@@ -173,7 +190,8 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
173
190
  isRefContextMenuShown: boolean;
174
191
  isMounted: boolean;
175
192
  selectedShas: Set<Sha>;
176
- lastFocusedSha?: Sha;
193
+ selectionAnchorSha?: Sha;
194
+ selectionFocusSha?: Sha;
177
195
  processedGraphRowBySha: ProcessedGraphRowBySha;
178
196
  shaByRefId: ShaByRefId;
179
197
  childrenBySha: ChildrenBySha;
@@ -189,10 +207,12 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
189
207
  shouldFireShowMoreCommits: boolean;
190
208
  columnsToFreeWhenFound: ColumnsToFreeBySha;
191
209
  hasMergeNodeChildBySha: HasMergeNodeChildBySha;
210
+ private _autoLoadTimer?;
192
211
  reserverInfoBySha: ReserverInfoBySha;
193
212
  columnsUsed: ColumnsUsed;
194
213
  rowsStats?: Record<string, RowStats>;
195
214
  workDirStats: WorkDirStats;
215
+ private _markerColorsCache;
196
216
  excludeByType: ExcludeByType;
197
217
  excludeRefsById: ExcludeRefsById;
198
218
  includeOnlyRefsById: IncludeOnlyRefsById;
@@ -208,18 +228,19 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
208
228
  graphZonesByType: GraphZonesByType;
209
229
  graphZoneOrdering: GraphZoneType[];
210
230
  clientHeight: number;
211
- missingAvatarsTimer?: NodeJS.Timeout;
231
+ missingAvatarsTimer?: ReturnType<typeof setTimeout>;
212
232
  pendingMissingAvatars: AvatarUrlByEmail;
213
233
  requestedMissingAvatars: AvatarUrlRequestedByEmail;
214
- missingRefsMetadataTimer?: NodeJS.Timeout;
234
+ missingRefsMetadataTimer?: ReturnType<typeof setTimeout>;
215
235
  pendingMissingRefsMetadata: RefsMissingMetadata;
216
236
  requestedMissingRefsMetadata: RefMetadataRequestedById;
237
+ previousRefMetadataById: RefMetadataById | null;
217
238
  branchUpstreamRowIndices: number[];
218
239
  downstreamsByUpstream: DownstreamsByUpstream;
219
- timelinesInterval?: NodeJS.Timeout;
240
+ timelinesInterval?: ReturnType<typeof setInterval>;
220
241
  constructor(props: Props);
221
242
  componentDidMount(): void;
222
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
243
+ componentDidUpdate(prevProps: Props, prevState: ComponentState): void;
223
244
  componentWillUnmount(): void;
224
245
  focus(): void;
225
246
  getRefIconsPositionOrDefault(refIconsPosition?: RefIconsPosition | null): RefIconsPosition;
@@ -246,14 +267,76 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
246
267
  onRefDragLeave: OnRefDragLeave;
247
268
  onRefDrop: OnRefDrop;
248
269
  onRefEndDrag: OnRefEndDrag;
270
+ private performRangeSelection;
249
271
  onZoneRowClick(event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha): void;
250
- getShiftSelectRange(currentSha: Sha): Sha[];
272
+ private handleToggleSelection;
273
+ getShiftSelectRange(currentSha: Sha, shiftSelectMode: ShiftSelectMode): Sha[] | undefined;
274
+ /**
275
+ * Check if a commit can extend the current topological selection via Ctrl+Click.
276
+ *
277
+ * In topological mode, we maintain a contiguous path through the git graph.
278
+ * This method determines if adding a commit would maintain that contiguity.
279
+ *
280
+ * Graph orientation:
281
+ * - Lower row index = NEWER commits (children, at top of graph)
282
+ * - Higher row index = OLDER commits (parents, at bottom of graph)
283
+ * - `getDirectTopologicalPathBetween(A, B)` finds path from A to B following parent pointers,
284
+ * meaning B must be an ancestor (older) of A
285
+ *
286
+ * Three cases based on clicked commit's position relative to selection bounds:
287
+ *
288
+ * 1. NEWER than newest selected (clickedIndex < newestIndex):
289
+ * - Clicked commit would extend the TOP of the selection
290
+ * - Check: clicked → newest (is newest an ancestor of clicked?)
291
+ * - Example: Selection is rows 5-10, clicking row 3
292
+ * Must verify row 3 can reach row 5 by following parents
293
+ *
294
+ * 2. OLDER than oldest selected (clickedIndex > oldestIndex):
295
+ * - Clicked commit would extend the BOTTOM of the selection
296
+ * - Check: oldest → clicked (is clicked an ancestor of oldest?)
297
+ * - Example: Selection is rows 5-10, clicking row 12
298
+ * Must verify row 10 can reach row 12 by following parents
299
+ *
300
+ * 3. BETWEEN newest and oldest (newestIndex < clickedIndex < oldestIndex):
301
+ * - Clicked commit must be ON the existing path, not a parallel branch
302
+ * - Check BOTH directions:
303
+ * - newest → clicked (is clicked an ancestor of newest?)
304
+ * - clicked → oldest (is oldest an ancestor of clicked?)
305
+ * - Example: Selection is rows 5-10, clicking row 7
306
+ * Must verify row 5 → row 7 → row 10 forms a valid path
307
+ * - This prevents selecting commits on parallel branches that happen
308
+ * to merge into the same ancestor
309
+ *
310
+ * @returns true if the commit can be added while maintaining topological contiguity
311
+ */
312
+ private canExtendTopologicalSelection;
313
+ private getTopologicalPathBetween;
314
+ private getDirectTopologicalPathBetween;
315
+ /**
316
+ * Finds the nearest commit that is topologically reachable from the anchor commit.
317
+ * Searches in the appropriate direction based on whether the anchor is ahead or behind the target.
318
+ * This is used as a fallback when the clicked commit is not directly topologically reachable.
319
+ */
320
+ private findNearestTopologicallyReachableCommit;
321
+ /**
322
+ * Validates that a path has only 2 endpoints - the start and end commits.
323
+ * An endpoint is a commit that has no children or parents within the selected path
324
+ * (excluding the explicit start and end points).
325
+ */
326
+ private hasOnlyTwoEndpoints;
327
+ /**
328
+ * Checks if a set of rows form a topologically contiguous set
329
+ * Rows are contiguous if all rows are connected via parent-child relationships (i.e., they form a single connected subgraph)
330
+ */
331
+ areRowsContiguous(rows: ReadonlyGraphRow[]): boolean;
251
332
  onClickRef: OnClickRef;
252
333
  onClickCommit: OnClickCommit;
253
334
  onDoubleClickCommit: OnDoubleClickCommit;
254
- onWindowKeyUp: OnKeyUp;
255
- onWindowBlur: OnBlur;
256
- onWindowKeyDown: OnKeyDown;
335
+ onWindowBlur: (e: FocusEvent) => void;
336
+ onWindowKeyUp: () => void;
337
+ onWindowKeyDown: (e: KeyboardEvent) => void;
338
+ onWindowMouseDown: () => void;
339
+ private isKeyboardNavigating;
257
340
  onKeyUp: OnKeyUp;
258
341
  onKeyDown: OnKeyDown;
259
342
  isNavigationKey(key: string): boolean;
@@ -265,19 +348,69 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
265
348
  onRefZoneUnhovered: OnRefZoneUnhovered;
266
349
  onShowMoreCommits: OnShowMoreCommits;
267
350
  onScrollForZone: OnScrollForZone;
351
+ /**
352
+ * Checks if there are still highlighted commits that haven't been found yet,
353
+ * OR if there are more search results available to load.
354
+ * Used in filter mode to determine if we should continue loading more commits.
355
+ * @returns true if there are unfound highlighted commits or more search results available, false otherwise
356
+ */
357
+ private hasUnfoundHighlightedCommits;
268
358
  loadMoreCommitsIfNecessary(graphHeight: number, hasMoreCommits: boolean): void;
359
+ private shouldAutoLoadToFillViewport;
360
+ private autoLoadToFillViewport;
269
361
  onScrollToRowCausedUpdateForFirstColumn: OnScrollForZone;
270
362
  onCommitContextMenu: OnCommitContextMenu;
271
363
  onRefContextMenu: OnRefZoneContextMenu;
272
- selectCommits(shas: Sha[], includeToPrevSel: boolean, isAutoOrKeyScroll: boolean): void;
364
+ /**
365
+ * Deep equality check for isSelectedBySha objects to avoid unnecessary scroll-to-selection
366
+ * when object reference changes but content is the same (e.g., after postMessage serialization)
367
+ */
368
+ private areSelectedByShaEqual;
369
+ private _pendingRowsUpdate;
370
+ private _selectionVersion;
371
+ private _cachedSmartCellRangeRenderer;
372
+ private _cachedScrollLeftForRenderer;
373
+ private _cachedForceCache;
374
+ /**
375
+ * Gets or creates a cached smartCellRangeRenderer.
376
+ * Only recreates when scrollLeft or forceCache changes.
377
+ * This prevents react-virtualized from invalidating its cache on every render.
378
+ */
379
+ private getOrCreateSmartCellRangeRenderer;
380
+ /**
381
+ * Gets commits rows by SHA
382
+ *
383
+ * @param shas - Array of commit SHAs to get
384
+ * @returns Array of ReadonlyGraphRow objects
385
+ */
386
+ getCommits(shas: Sha[]): ReadonlyGraphRow[];
387
+ /**
388
+ * Selects commits in the graph
389
+ * @param shas - Array of commit SHAs to select
390
+ * @param options - Selection options (toggle, ensureVisible)
391
+ * @returns Array of selected ReadonlyGraphRow objects
392
+ */
393
+ selectCommits(shas: Sha[], options?: SelectCommitsOptions): ReadonlyGraphRow[];
394
+ /**
395
+ * Internal method to select commits with full control over selection behavior
396
+ * @param shas - Array of commit SHAs to select
397
+ * @param options - Selection options including toggle, ensureVisible, isKeyboardNav, isTopological, isContiguous
398
+ * @returns Array of selected ReadonlyGraphRow objects
399
+ */
400
+ private selectCommitsCore;
401
+ private predictScrollTop;
273
402
  getCommitZoneContentWidthBetweenGutters(): number;
274
- getSelectedShas(): Sha[];
275
403
  getExcludeRemotesByName(): ExcludeRemotesByName;
276
404
  getIncludeOnlyRemotesByName(): IncludeOnlyRemotesByName;
277
405
  clearScrollToIndex: ClearScrollToIndex;
406
+ getVisibleRows: () => ProcessedGraphRow[];
278
407
  getTopAndBottomVisibleRowIndex(): TopAndBottomVisibleRowIndex;
279
- getOffsetSha(sha: Sha): Sha;
280
- selectSha(sha: Sha, isAutoOrKeyScroll?: boolean): void;
408
+ getOffsetSha(sha: Sha, scrollDirection: 'up' | 'down' | 'none', lastScrollDirection: 'up' | 'down' | 'none' | undefined, isKeyboardNav: boolean): Sha;
409
+ private _pendingScrollUpdate;
410
+ private _lastSelectedRowIndex;
411
+ private _lastScrollDirection;
412
+ private _scrollToAlignmentOverride;
413
+ selectSha(sha: Sha, isKeyboardNav?: boolean): void;
281
414
  updateWidthByZone(widthToAssignForZone: number, graphZoneType: GraphZoneType, updatePreferredWidth?: boolean): void;
282
415
  updateCommitZoneContentWidthFromChange(): void;
283
416
  getCurrentWidthByZone(graphZoneType: GraphZoneType, withoutVerticalScrollWidth?: boolean): number;
@@ -330,9 +463,60 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
330
463
  getIconCallback: GetExternalIcon;
331
464
  onMissingAvatar: GetMissingAvatar;
332
465
  onMissingRefMetadata: GetMissingRefMetadata;
333
- selectNext(topological?: boolean): void;
334
- selectPrevious(topological?: boolean): void;
466
+ selectNext(shiftKey?: boolean, topological?: boolean, shiftSelectMode?: ShiftSelectMode): void;
467
+ selectPrevious(shiftKey?: boolean, topological?: boolean, shiftSelectMode?: ShiftSelectMode): void;
468
+ /**
469
+ * Navigate selection in the specified direction.
470
+ * @param direction - 'up' (towards newer/children) or 'down' (towards older/parents)
471
+ */
472
+ private selectInDirection;
473
+ /**
474
+ * Determine the next SHA to select based on direction and mode.
475
+ */
476
+ private getNextShaInDirection;
477
+ private getNextTopologicalSha;
478
+ private getPreviousTopologicalSha;
479
+ /**
480
+ * Find the next commit in the given direction that is topologically reachable from the anchor.
481
+ * Uses a hybrid approach: fast path for common cases, BFS fallback for complex graphs.
482
+ * @param preferSameColumn - If true, tries same-column navigation first (faster, used for ctrl+shift+arrow)
483
+ */
484
+ private findNextReachableFromAnchor;
485
+ /**
486
+ * Fast reachability check - determines if targetSha is reachable from startSha.
487
+ * Uses BFS with visit limit for performance.
488
+ */
489
+ private isReachableFrom;
490
+ /**
491
+ * Get the same-column child of a commit.
492
+ * Prefers children on the same column, then falls back to children where this commit is the first parent.
493
+ */
494
+ private getSameColumnChild;
495
+ /**
496
+ * Jump to the previous branching point (towards newer commits), or tip if none.
497
+ * A branching point is a commit with visible children on a different column.
498
+ */
499
+ private selectPreviousBranchingPoint;
500
+ /**
501
+ * Check if a commit is a branching point (has visible children on a different column).
502
+ */
503
+ private isBranchingPoint;
504
+ /**
505
+ * Get the same-column parent of a commit.
506
+ */
507
+ private getSameColumnParent;
508
+ /**
509
+ * Jump to the next branching point (towards older commits), or root if none.
510
+ * A branching point is a commit with visible children on a different column.
511
+ */
512
+ private selectNextBranchingPoint;
513
+ selectNextRef(): void;
514
+ selectPreviousRef(): void;
335
515
  selectHead(upstream?: boolean): void;
516
+ selectFirst(shiftKey?: boolean, shiftSelectMode?: ShiftSelectMode): void;
517
+ selectLast(shiftKey?: boolean, shiftSelectMode?: ShiftSelectMode): void;
518
+ selectPageUp(shiftKey?: boolean, shiftSelectMode?: ShiftSelectMode): void;
519
+ selectPageDown(shiftKey?: boolean, shiftSelectMode?: ShiftSelectMode): void;
336
520
  getAvailableColumnAndUseIt(): number;
337
521
  getColumns(graphRow: GraphRow): number;
338
522
  getFilteredHeadsForGraphRow(row: GraphRow, hasIncludes: boolean): Head[];
@@ -361,13 +545,19 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
361
545
  onGraphContainerBlurred: OnGraphContainerBlurred;
362
546
  onGraphContainerMouseEnter: OnGraphMouseEnter;
363
547
  onGraphContainerMouseLeave: OnGraphMouseLeave;
548
+ private _headerHoverRestoreTimer?;
549
+ onGraphHeaderMouseDown: () => void;
550
+ onGraphHeaderMouseUp: (event: React.MouseEvent<any>) => void;
551
+ onGraphHeaderWheel: (event: React.WheelEvent<any>) => void;
552
+ onGraphHeaderMouseMove: (event: React.MouseEvent<any>) => void;
553
+ private hoverRowForHeaderEvent;
364
554
  onGraphResized: OnGraphResized;
365
555
  onGraphVisibleRowsUpdated(): void;
366
556
  getCurrentPlatform(): string;
367
557
  isMacOSPlatform(): boolean;
368
- isCommitListFiltered(): boolean;
558
+ isFilteredSearch(): boolean;
369
559
  getGraphColumnSettingFromZoneType(graphZone: GraphZone): GraphColumnSetting;
370
- decorateWithHelmet: (container: ReactElement<'div'>, cssVariables: CssVariables, nonce?: string) => React.JSX.Element;
560
+ decorateWithHelmet: (container: ReactElement<"div">, cssVariables: CssVariables, nonce?: string) => React.JSX.Element;
371
561
  render(): React.JSX.Element;
372
562
  }
373
563
  export default GraphContainer;
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { GraphZone } from '../../domain/graph/GraphConstants';
4
4
  import type { ExcludeRefsById, GetExternalIcon, GraphColumnsSettings, GraphItemContext, IncludeOnlyRefsById, OnFilterColumnClick, OnGraphColumnReOrdered, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnPopupGraphHeaderContextMenu, OnSettingsClick, OnToggleRefNodesShown } from '../../domain/graph/GraphTypes';
5
5
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
@@ -29,6 +29,10 @@ type Props = {
29
29
  translate: TranslationFn;
30
30
  width: number;
31
31
  height: number;
32
+ onMouseDownCapture?: React.MouseEventHandler<HTMLDivElement>;
33
+ onMouseMoveCapture?: React.MouseEventHandler<HTMLDivElement>;
34
+ onMouseUpCapture?: React.MouseEventHandler<HTMLDivElement>;
35
+ onWheel?: React.WheelEventHandler<HTMLDivElement>;
32
36
  settingsContext?: GraphItemContext;
33
37
  };
34
38
  declare class GraphHeaderRow extends React.PureComponent<Props> {
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { GraphMarkerType } from '../../domain/graph/GraphConstants';
4
4
  import type { GraphMarkerColors, GraphMarkerRowIndices } from '../../domain/graph/GraphTypes';
5
5
  interface Props {
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { CommitType } from '../../../domain/commit/CommitTypes';
4
4
  import type { CssVariables } from '../../../domain/generic/GenericTypes';
5
5
  import type { GetExternalIcon, GraphItemContext, GraphZoneModeConstants } from '../../../domain/graph/GraphTypes';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
4
4
  import type { CssVariables, Style } from '../../../domain/generic/GenericTypes';
5
5
  import type { ColumnColorByColumn, GetExternalIcon, GraphItemContext, GraphZoneModeConstants, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnCommitContextMenu, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, RowEdges } from '../../../domain/graph/GraphTypes';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { CssVariables, Style } from '../../../domain/generic/GenericTypes';
4
4
  import type { GraphItemContext } from '../../../domain/graph/GraphTypes';
5
5
  import type { ComponentTooltip } from '../../../domain/ui/UiTypes';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { ColumnColorByColumn, GraphZoneModeConstants, RowEdges } from '../../../../domain/graph/GraphTypes';
4
4
  type EdgeProps = {
5
5
  columnColorByColumn: ColumnColorByColumn;
@@ -1,5 +1,5 @@
1
1
  import type { MouseEventHandler, ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { GraphZone, GraphZoneType } from '../../../domain/graph/GraphConstants';
4
4
  import type { ExcludeRefsById, GetExternalIcon, GraphColumnSetting, GraphItemContext, GraphRefOptData, IncludeOnlyRefsById, OnFilterColumnClick, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnGraphZoneResizeStart, OnSettingsClick, OnToggleRefNodesShown } from '../../../domain/graph/GraphTypes';
5
5
  import type { TranslationFn } from '../../../domain/language/LanguageTypes';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
4
4
  import type { Style } from '../../../domain/generic/GenericTypes';
5
5
  import type { GraphZoneType } from '../../../domain/graph/GraphConstants';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  export type ScrollParams = {
4
4
  clientHeight: number;
5
5
  clientWidth: number;
@@ -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 {};
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { Sha } from '../../../domain/commit/CommitTypes';
4
4
  import type { Style } from '../../../domain/generic/GenericTypes';
5
5
  import type { GraphZoneType } from '../../../domain/graph/GraphConstants';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { Style } from '../../../domain/generic/GenericTypes';
4
4
  import type { FormatRefShorthand, IsRefShorthandValid, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefShorthandChange } from '../../../domain/graph/GraphTypes';
5
5
  import type { TranslationFn } from '../../../domain/language/LanguageTypes';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
4
4
  import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRef, GraphRefGroup, OnClickRef, OnClickRefMetadata, OnDoubleClickRef, OnDoubleClickRefMetadata, OnHideRefClick, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefZoneContextMenu, RefMetadataById, RefMetadataItem, RefMetadataType } from '../../../domain/graph/GraphTypes';
5
5
  import type { TranslationFn } from '../../../domain/language/LanguageTypes';
@@ -33,6 +33,7 @@ export type RefNodeProps = {
33
33
  refGroupContext: GraphItemContext | null;
34
34
  refIconsPosition: RefIconsPosition;
35
35
  refMetadata: RefMetadataById | null;
36
+ fallbackRefMetadata?: RefMetadataById | null;
36
37
  sha: Sha;
37
38
  showRemoteNamesOnRefs: boolean;
38
39
  enabledRefMetadataTypes: RefMetadataType[];
@@ -26,6 +26,7 @@ type RefNodesProps = {
26
26
  refGroupsByName: RefGroup[];
27
27
  refIconsPosition: RefIconsPosition;
28
28
  refMetadata: RefMetadataById | null;
29
+ fallbackRefMetadata?: RefMetadataById | null;
29
30
  refNodeHovered: OnRefNodeHovered;
30
31
  onToggleRefNodesShown: OnToggleRefNodesShown;
31
32
  onRefBeginDrag: OnRefBeginDrag;
@@ -42,5 +43,5 @@ type RefNodesProps = {
42
43
  type: CommitType;
43
44
  useColumnHeaderIcons: boolean;
44
45
  };
45
- declare function RefNodes({ enabledRefMetadataTypes, column, columnForColoring, context, enableShowHideRefsOptions, targetRef, hasActive, hasRefs, getExternalIcon, includeOnlyRefsById, includeOnlyRemotesByName, isGhostRef, isHovered, isInUnsupportedRebase, numGraphColumns, onMissingRefMetadata, refGroupContexts, refGroupsByName, refIconsPosition, refMetadata, refNodeHovered, sha, showRemoteNamesOnRefs, showContextMenuForGroupedRef, onClickRef, onDoubleClickRef, onToggleRefNodesShown, onRefBeginDrag, onRefCanDrag, onRefCanDrop, onRefDragEnter, onRefDragLeave, onRefDrop, onRefEndDrag, translate, type, useColumnHeaderIcons, }: RefNodesProps): ReactElement<'span' | 'div'>;
46
+ declare function RefNodes({ enabledRefMetadataTypes, column, columnForColoring, context, enableShowHideRefsOptions, targetRef, hasActive, hasRefs, getExternalIcon, includeOnlyRefsById, includeOnlyRemotesByName, isGhostRef, isHovered, isInUnsupportedRebase, numGraphColumns, onMissingRefMetadata, refGroupContexts, refGroupsByName, refIconsPosition, refMetadata, fallbackRefMetadata, refNodeHovered, sha, showRemoteNamesOnRefs, showContextMenuForGroupedRef, onClickRef, onDoubleClickRef, onToggleRefNodesShown, onRefBeginDrag, onRefCanDrag, onRefCanDrop, onRefDragEnter, onRefDragLeave, onRefDrop, onRefEndDrag, translate, type, useColumnHeaderIcons, }: RefNodesProps): ReactElement<'span' | 'div'>;
46
47
  export default RefNodes;
@@ -2,7 +2,7 @@ import type { ReactElement } from 'react';
2
2
  import React from 'react';
3
3
  import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
4
4
  import type { Style } from '../../../domain/generic/GenericTypes';
5
- import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRefGroup, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefGroupContexts, RefMetadataById, RefMetadataType } from '../../../domain/graph/GraphTypes';
5
+ import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRefGroup, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClearCurrentlyHoveredGraphCommit, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefGroupContexts, RefMetadataById, RefMetadataType } from '../../../domain/graph/GraphTypes';
6
6
  import type { TranslationFn } from '../../../domain/language/LanguageTypes';
7
7
  import type { RefIconsPosition } from '../../../domain/ref/RefTypes';
8
8
  type RefZoneDefaultProps = {
@@ -40,6 +40,7 @@ type RefZoneProps = {
40
40
  refGroupsByName: GraphRefGroup[];
41
41
  refIconsPosition: RefIconsPosition;
42
42
  refMetadata: RefMetadataById | null;
43
+ fallbackRefMetadata?: RefMetadataById | null;
43
44
  refNodeHovered: OnRefNodeHovered;
44
45
  refNodeUnhovered: OnRefNodeUnhovered;
45
46
  refZoneHovered: OnRefZoneHovered;
@@ -55,6 +56,8 @@ type RefZoneProps = {
55
56
  type: CommitType;
56
57
  useColumnHeaderIcons: boolean;
57
58
  width: number;
59
+ clearCurrentlyHoveredGraphCommit: OnClearCurrentlyHoveredGraphCommit;
60
+ currentlyHoveredCommitSha: Sha | null;
58
61
  };
59
62
  export default class RefZone extends React.PureComponent<RefZoneProps> {
60
63
  popoverTargetRef: React.RefObject<HTMLDivElement>;