# Thinking timeline

An agent's turn step by step on one rail: the live step shimmering, settled steps as dots, dead ends and parallel steps one lane in.

Live variants: https://design.arcadia.is/components/thinking-timeline

```tsx
import { ThinkingTimeline } from "@arcadia/ui";
```

```tsx
import { MessageGroup, Bubble, ThinkingTimeline } from "@arcadia/ui";

function Playback() {
  const { frame, start } = usePlayback();
  return (
    <div {...sx("cmp-thinking-thread", ThinkingTimelineStyles.thread)}>
      <MessageGroup side="end">
        <Bubble side="end">Why did the refund retry run twice?</Bubble>
      </MessageGroup>
      <ThinkingTimeline steps={frame.steps} state={frame.state} startedAt={start} elapsedMs={frame.elapsedMs} finish={frame.finish} />
    </div>
  );
}
```

Show earlier steps to see where the parallel work began.

```tsx
import { ThinkingTimeline } from "@arcadia/ui";

<ThinkingTimeline steps={COMPLETED.steps} state="done" elapsedMs={COMPLETED.elapsedMs} finish={COMPLETED.finish} window={6} instant />
```

```tsx
import { ThinkingTimeline } from "@arcadia/ui";

<ThinkingTimeline singleLine steps={[
    { id: "read", text: "Read the refund retry schedule and its backoff configuration", state: "done", icon: "file" },
    { id: "trace", text: "Tracing café payments through the queue, 2 of 7", progress: "2 of 7", state: "live" },
  ]} />
```

## Accessibility

The header is a real disclosure button with `aria-expanded`, and so is each step's Show details line. The steps are an ordered list, the live one marked `aria-current="step"`. A polite status region says each new live step once and the end of the turn; a count moving inside a step is not repeated. Nodes, rails and curves are hidden from assistive tech: every state is in words.

Reduced motion ends every entrance at once and stops the shimmer and the node's arc on a frame that still reads. Nothing takes focus but the header, a step's Show details line and the line that shows older steps, and no input waits on any motion.

## API reference

### ThinkingTimeline

- `steps` (`readonly ThinkingStep[]`, required)
- `state` (`"live" | "done" | "failed" | "stopped"`, default `"live"`): The turn's state.
- `startedAt` (`number`): When the turn began (epoch ms): the header counts from here once a second while it is live.
- `elapsedMs` (`number`): The turn's own measure of its time once it ended: "Thought for 14s".
- `verb` (`"think" | "work"`, default `"think"`)
- `finish` (`{ label: string; summary?: string }`): The line under the last step once the turn is done.
- `open` (`boolean`): Controlled open state.
- `defaultOpen` (`boolean`, default `true`): Initial open state when uncontrolled.
- `onOpenChange` (`(open: boolean, details: OpenChangeDetails) => void`)
- `window` (`number`, default `40`): Steps per history page, 1 to 80. Starting with the most recent steps.
- `announce` (`boolean`, default `true`): A polite live region says the live step and the end of the turn. false where the product announces.
- `instant` (`boolean`, default `false`): A view restored or loaded whole: nothing plays its entrance (`data-instant`).
- `singleLine` (`boolean`, default `false`)
- `rootStyle` (`RootStyle`): Typed StyleX override: where the timeline sits.

Rest props go to `HTMLAttributes<HTMLDivElement>`.
