Loading component…
Loading component…
An agent run's spans on a timeline, one lane per agent – the critical path that decides when the run ends in full tint, and drag a span to see a what-if
To reuse this local React demo, copy all files from the Code tab into the same folder, then import CriticalPath from ./critical-path.
import { CriticalPath, type CriticalLane, type CriticalSpan } from "@/components/ui/critical-path";
const lanes: CriticalLane[] = [
{ id: "planner", name: "Planner", model: "Opus 5.5", logo: <ClaudeLogo /> },
{ id: "coder", name: "Coder", model: "Sonnet 5", logo: <ClaudeLogo /> },
{ id: "tests", name: "Test Runner", model: "GPT-5 mini", logo: <OpenAILogo /> },
];
const spans: CriticalSpan[] = [
{ id: "plan", name: "plan", lane: "planner", kind: "llm", start: 0, duration: 9200 },
{ id: "fix", name: "write fix", lane: "coder", kind: "llm", start: 12000, duration: 34500, deps: ["plan"] },
{ id: "tests", name: "run tests", lane: "tests", kind: "tool", logo: <TerminalIcon />, start: 47000, duration: 24800, deps: ["fix"] },
];
export function Run() {
return <CriticalPath title="Ship v2.4" lanes={lanes} spans={spans} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| lanes | CriticalLane[] | One per agent, top to bottom – { id, name, model?, logo?, color?, person? } | |
| spans | CriticalSpan[] | { id, name, lane, kind, duration, start?, deps?, logo?, detail?, failed? } – durations and starts in ms from the start of the run | |
| kind | "llm" \| "tool" \| "agent" | The bar's tint – indigo, teal or gray; failed: true tints it red | |
| deps | string[] | The spans it waits for – it starts when the last of them ends. A lane runs its spans one after another on top of that | |
| start | number | When it really started – a wait after it could have started is kept in every what-if; leave it out to start as soon as possible | |
| title | string | The run's name in the head – "Agent run" by default | |
| step | number | How much ⇧← / ⇧→ change a span, in ms – 500 by default | |
| hint | ReactNode \| false | A quiet line under the timeline until the first edit – false hides it | |
| onChange | (whatIf) => void | After every edit and on reset – { durations, lanes, end, baseEnd, critical } | |
| formatDuration | (ms) => string | Formats every duration – "3.4 s", "1m 42s" by default | |
| className | string | An extra class on the root |
Fills its container's width – the time scale fits it, so it never scrolls sideways
Below 520px the lanes keep only their pixel marks and the hint steps aside
On touch screens the end of a bar has a wider handle; a finger on a bar scrolls the page and a tap opens its card
Names that don't fit end in … – a bar that is too small shows only its logo, then nothing; the card has them in full
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"