Commit Graph
The model behind CommitHistory: commits, a one-pass nesting of merged branches under their merge, the rows that show with merges open or closed, git log --graph style lanes laid out lazily, and a commit message parser for file and branch chips.
Example
| Commit | Depth | Lane | Out to |
|---|---|---|---|
| Bump version in package.json | 0 | 0 | 0 |
| Merge invoice-pdf into main | 0 | 0 | 0, 1 |
| Render line items as a PDF table | 1 | 1 | 1 |
| Embed fonts in invoice exports | 1 | 1 | 1 |
| Add the PDF route in routes.ts | 1 | 1 | 0 |
| Fix rounding in proration.ts | 0 | 0 | 0 |
| Merge tax-rates into main | 0 | 0 | 0, 1 |
| Load EU VAT rates from rates.json | 1 | 1 | 0 |
| Create the billing service | 0 | 0 | — |
commit-graph-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
Use the model on its own for a graph of your own, or to lay out commits on the server.
API reference
This item exports functions and types rather than components.
Other exports
createCommitGraphisMergeRowmergeIdsrowOfCommitupdateCommitGraphvisibleRowscreateLaneLayoutcommitSubjectcreateCommitFinderparseCommitMessagesegmentsOfsubjectPiecescreateBranchModelheadTagOfbranchTonestype Committype CommitAuthortype CommitGraphtype CommitMessageSegmenttype CommitStatstype CommitStatustype CommitTagtype VisibleRowstype LaneLayouttype LaneLayoutOptionstype LaneRowtype CommitMatchtype BranchInfotype BranchModeltype BranchModelOptionstype BranchStatetype CommitBranchAgent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.