Loading component…
Loading component…
What an agent changed in a pull request, edit by edit – lines added and removed as two lines laid over each other, a diff bar per file, and every edit's diff on hover
To reuse this local React demo, copy all files from the Code tab into the same folder, then import DiffTimeline from ./diff-timeline.
import { DiffTimeline } from "@/components/ui/diff-timeline";
export function PullRequestRun({ edits, elapsed, running }) {
return (
<DiffTimeline
agent={{ id: "frontend", name: "Frontend agent" }}
context="PR #214"
edits={edits} // [{ at: 30, file: "components/hero.tsx", added: 44, removed: 0, diff: [...] }]
elapsed={elapsed} // seconds since the run started
live={running}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| agent | { id: string; name: string } | The agent – its id gives it its own pixel mark | |
| context | string | Quiet text after the name, e.g. the pull request | |
| edits | DiffEdit[] | Every edit: at (seconds), file, added, removed and optional diff lines. The scales come from all of them, so nothing rescales while the run plays | |
| elapsed | number | the last edit | Seconds since the run started – later edits stay hidden |
| live | boolean | false | Still writing: the mark twinkles, the line ends glow and the status names the file |
| duration | number | the run, rounded up to a minute | Length of the time axis in seconds |
| maxRows | number | 7 | File rows shown before the list scrolls – the card keeps one height however many files the run touches |
| className | string | Extra class on the card |
A gray tray with two white panels – the chart on top, the files below – and the legend on the tray; fills its container, line widths stay crisp
Below 440px the totals move under the name, folders hide and counts shorten (4.8k)
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"