Skip to content
Star

Agent run timeline

Every model and tool step of a run on one time axis. Free and MIT licensed, as HTML, a typed React component or an Astro component, in three styles with light and dark mode.

$npx designme add agent-run-timeline
$npx shadcn@latest add https://designme.dev/r/shadcn/agent-run-timeline.json

Need this designed into your product? Book a call

Run 4821, update the pricing page
Starting
Running
01

Install

Add it to your project with the CLI.

HTML, CSS and JS

$npx designme add agent-run-timeline

React

$npx designme add agent-run-timeline --react

Astro

$npx designme add agent-run-timeline --astro

shadcn, React

$npx shadcn@latest add https://designme.dev/r/shadcn/agent-run-timeline.json

shadcn, Astro

$npx shadcn@latest add https://designme.dev/r/shadcn/astro/agent-run-timeline.json

The CLI copies the source into your project, so you own it and can change anything. Where each version lands, what it needs and the shadcn theme bridge: Installation.

02

About

What it is for and what it does.

Agent run timeline draws one agent run as a Gantt chart: every model, tool and app step is a bar on a shared time axis, in its kind's colour and with its own icon or app mark, so people can see what ran in parallel, what took longest and where a step failed and was retried. While the run is live, a playhead with the time on it sweeps across, the bars grow up to it and the step at work carries a passing light.

  • When you need to see why an agent run was slow and which steps overlapped.
  • When a step failed and was retried, and people should see where in the run that happened.
  • When people care about cost per step as well as time.
  • In a run history or debugging view, to replay a finished run or follow one live.
03

Usage

Import it in React and drive it from your own state, or place it in an Astro page.

React

import { AgentRunTimeline } from '@/components/designme/agent-run-timeline/AgentRunTimeline';

React example

The demo above as a React component, 44 lines you can copy.

'use client';
// The animated preview from designme.dev, rebuilt from the React component: an example of driving it from your own state.
import { useRef, useState } from 'react';
import { AgentRunTimeline, type TimelineStep } from './AgentRunTimeline';
import { useStory } from '../lib/useScript';

/* ---------- Agent run timeline: the playhead sweeps the run at 1.6x, the tests fail and run again, then the totals settle ---------- */
const STEPS: TimelineStep[] = [
  { label: 'Plan the change', icon: 'brain', kind: 'model', start: 0, duration: 1.6, cost: 0.03 },
  { label: 'Read 6 files', icon: 'file-text', kind: 'tool', start: 1.6, duration: 2.2, cost: 0.02 },
  { label: 'Search Figma', brand: 'figma', kind: 'app', start: 1.9, duration: 1.4, cost: 0.01 },
  { label: 'Edit PricingCard', icon: 'edit', kind: 'model', start: 4, duration: 2.4, cost: 0.06 },
  { label: 'Run tests', icon: 'term', kind: 'tool', start: 6.5, duration: 1.5, cost: 0.01, failed: true, tag: '2 failed', note: '2 tests failed' },
  { label: 'Run tests again', icon: 'refresh', kind: 'tool', start: 8.1, duration: 1.9, cost: 0.01, retry: true },
  { label: 'Open a PR on GitHub', brand: 'github', kind: 'app', start: 10.1, duration: 1, cost: 0.02 },
  { label: 'Post to Slack', brand: 'slack', kind: 'app', start: 11.1, duration: 0.6, cost: 0.01 }
];
const SPAN = 12, END = 11.7, PACE = 1.6;

export default function AgentRunTimelineDemo() {
  const ref = useRef<HTMLDivElement>(null);
  const [time, setTime] = useState<number | undefined>(0);
  const [started, setStarted] = useState(false);
  // the run plays at 1.6 times real speed; while a mouse rests on it the story holds, and the clock waits with it
  useStory(ref, async ({ wait }) => {
    await wait(500);
    setStarted(true);
    let t = 0, last = performance.now();
    while (t < END) {
      await wait(16);
      const now = performance.now();
      // a long gap is a hold ending, and counts as one frame
      t = Math.min(END, t + ((now - last < 250 ? now - last : 16) / 1000) * PACE); last = now;
      setTime(t);
    }
    setTime(undefined);
  }, { hold: false });
  return (
    <div ref={ref} style={{ width: '100%' }}>
      <AgentRunTimeline title="Run 4821, update the pricing page" steps={STEPS} span={SPAN} time={time} status={!started ? 'Starting' : time === undefined ? 'Opened a PR and posted to Slack' : undefined} />
    </div>
  );
}

Astro

In a page in src/pages. It plays the demo above; change its agent-run-timeline.js to show your own data. Attributes like class go on its root element.

---
import AgentRunTimeline from '../components/designme/agent-run-timeline/AgentRunTimeline.astro';
---
<AgentRunTimeline />
<AgentRunTimeline data-style="soft" class="my-class" />
04

Props

Everything AgentRunTimeline takes.

PropTypeWhat it does
titlerequiredstringLike "Run 4821, update the pricing page"
stepsrequiredTimelineStep[]
timenumberSeconds into the run. Bars grow up to it and the playhead sits on it. Leave it out once the run has finished
spannumberSeconds the axis covers. Defaults to the end of the last step, rounded up to a multiple of 4
ticksnumber[]Labels on the axis, in seconds. Defaults to quarters of the span
statusstringThe line under the title. Defaults to the steps running now and, once the run is done, the last ones that ran. Say what the run did here when it ends; the totals under the chart already give its time and retries
iconIconNameThe neutral mark in the head's tile, in the steps' icon column. Defaults to a bolt
statsTimelineStat[]The figures in the footer once the run is done. Defaults to the total time, cost, steps and retries, which count up while it plays
kindLabelsPartial<Record<StepKind, string>>The names of the kinds in the key. Defaults to Model, Tools and Apps
barebooleanDraws its own container (the default, as on designme.dev). Set true to sit it flat in a chat thread
classNamestring
05

Code

The full source, as the CLI installs it.

AgentRunTimeline.tsxReact · 207 lines
'use client';
import { useEffect, useRef, useState, type CSSProperties } from 'react';
import { cx } from '../lib/cx';
import { useIsoLayoutEffect, useReducedMotion, useTween } from '../lib/hooks';
import { Icon, type IconName } from '../lib/icons';
import { Brand, type BrandName } from '../lib/brands';
import { enter, Tip } from '../lib/motion';
import '../designme.css';
import './agent-run-timeline.css';

/** What a step is: the model thinking or writing (purple), a tool like a file read or a test run (teal), or an app the agent
    works in, like Figma or GitHub (orange) */
export type StepKind = 'model' | 'tool' | 'app';

export interface TimelineStep {
  label: string;
  icon?: IconName;
  /** An app's own mark in place of the icon, like 'figma', 'github' or 'slack' */
  brand?: BrandName;
  /** Colours the step's bar, icon and live time, and counts it in the key under the title */
  kind?: StepKind;
  /** Seconds into the run when the step started */
  start: number;
  /** How long it took, in seconds */
  duration: number;
  /** Bar colour, any CSS colour. Defaults to the kind's colour, or the chart blue, var(--dm-c1), for a step with no kind */
  color?: string;
  /** What the step cost, in dollars */
  cost?: number;
  /** Hatches the bar red and puts a red tag after the label, for a step that failed */
  failed?: boolean;
  /** The tag on a failed step, like "2 failed". Defaults to "Failed" */
  tag?: string;
  /** Added to the bar's tooltip, like "2 tests failed" */
  note?: string;
  /** A retry of the failed step just before it: a dashed line joins the end of that step to this one once it starts */
  retry?: boolean;
}

export interface TimelineStat {
  /** Like "11.4s" */
  value: string;
  /** Like "total" */
  label: string;
  icon?: IconName;
}

export interface AgentRunTimelineProps {
  /** Like "Run 4821, update the pricing page" */
  title: string;
  steps: TimelineStep[];
  /** Seconds into the run. Bars grow up to it and the playhead sits on it. Leave it out once the run has finished */
  time?: number;
  /** Seconds the axis covers. Defaults to the end of the last step, rounded up to a multiple of 4 */
  span?: number;
  /** Labels on the axis, in seconds. Defaults to quarters of the span */
  ticks?: number[];
  /** The line under the title. Defaults to the steps running now and, once the run is done, the last ones that ran. Say
      what the run did here when it ends; the totals under the chart already give its time and retries */
  status?: string;
  /** The neutral mark in the head's tile, in the steps' icon column. Defaults to a bolt */
  icon?: IconName;
  /** The figures in the footer once the run is done. Defaults to the total time, cost, steps and retries, which count up while it plays */
  stats?: TimelineStat[];
  /** The names of the kinds in the key. Defaults to Model, Tools and Apps */
  kindLabels?: Partial<Record<StepKind, string>>;
  /** Draws its own container (the default, as on designme.dev). Set true to sit it flat in a chat thread */
  bare?: boolean;
  className?: string;
}

// each kind's bar colour, a chart colour (teal and orange take a little of their text slot, so the bars keep 3:1 on a light
// page), and palette slot (its icon tint and live time)
const KIND: Record<StepKind, [string, string, string]> = {
  model: ['Model', 'var(--dm-c2)', 'pl'],
  tool: ['Tools', 'color-mix(in srgb,var(--dm-c6) 70%,var(--dm-pt))', 'pt'],
  app: ['Apps', 'color-mix(in srgb,var(--dm-c4) 75%,var(--dm-pp))', 'pp']
};
const KINDS = Object.keys(KIND) as StepKind[];

/** How many times `value` has changed since the first render, so a part can play its entrance on a change but not on mount */
function useChanges<T>(value: T) {
  const [seen, setSeen] = useState({ value, n: 0 });
  if (Object.is(seen.value, value)) return seen.n;
  setSeen({ value, n: seen.n + 1 });
  return seen.n + 1;
}

/** Like Swap, except that while `instant` is set the text changes straight away: the live status moves too fast to crossfade */
function Status({ text, instant, className }: { text: string; instant: boolean; className?: string }) {
  const [shown, setShown] = useState(text);
  const [out, setOut] = useState(false);
  const reduce = useReducedMotion();
  if (instant && shown !== text) setShown(text);
  useEffect(() => {
    if (instant || text === shown) return;
    setOut(true);
    const t = setTimeout(() => { setShown(text); setOut(false); }, reduce ? 0 : 170);
    return () => clearTimeout(t);
  }, [text, shown, instant, reduce]);
  return <div className={cx(className, !instant && 'dm-sw', out && 'dm-out')}>{instant ? text : shown}</div>;
}

const pct = (n: number) => n * 100 + '%';
const secs = (n: number) => String(+n.toFixed(1));
type State = 'wait' | 'run' | 'done' | 'fail';

/** A run drawn as a Gantt chart: every step as a bar in its kind's colour on a shared time axis, with a playhead while it runs. */
export function AgentRunTimeline({ title, steps, time, span, ticks, status, stats, kindLabels, icon = 'bolt', bare = false, className }: AgentRunTimelineProps) {
  const end = Math.max(0, ...steps.map(s => s.start + s.duration));
  const T = span ?? Math.max(4, Math.ceil(end / 4) * 4);
  const done = time === undefined || time >= T;
  const t = done ? end : Math.max(0, time);
  // the bars ease after the playhead in JS: a CSS width transition restarted on every frame never gets to move
  const eased = useTween(t, 250);
  const changed = useChanges(done) > 0 ? 'dm-enter' : undefined;

  const state = (s: TimelineStep): State => t < s.start ? 'wait' : t < s.start + s.duration && !done ? 'run' : s.failed ? 'fail' : 'done';
  // the line under the title names the steps at work; between two steps it keeps the last one's names
  const now = steps.filter(s => state(s) === 'run').map(s => s.label).join(', ');
  const last = useRef('');
  if (now) last.current = now;
  const retries = steps.filter(s => s.failed && t >= s.start + s.duration).length;
  const line = status ?? (done ? last.current || steps.filter(s => s.start + s.duration >= end).map(s => s.label).join(', ') : now || last.current || 'Starting');
  // the footer counts up with the playhead, so it is there from the start and never pops in at the end
  const started = steps.filter(s => t >= s.start), hasRetries = steps.some(s => s.failed), n = started.length;
  const ran = (s: TimelineStep) => Math.max(0, Math.min(s.duration, t - s.start));
  const cost = started.reduce((sum, s) => sum + (s.cost ?? 0) * (ran(s) / (s.duration || 1)), 0);
  const figures = (done && stats) || [
    { value: `${Math.min(t, end).toFixed(1)}s`, label: 'total', icon: 'clock' as IconName },
    ...(steps.some(s => s.cost !== undefined) ? [{ value: `$${cost.toFixed(2)}`, label: 'cost', icon: 'dollar' as IconName }] : []),
    { value: String(n), label: n === 1 ? 'step' : 'steps', icon: 'layers' as IconName },
    ...(hasRetries ? [{ value: String(retries), label: retries === 1 ? 'retry' : 'retries', icon: 'refresh' as IconName }] : [])
  ];
  const kinds = KINDS.filter(k => steps.some(s => s.kind === k));
  const per = (k: StepKind) => steps.filter(s => s.kind === k).reduce((sum, s) => sum + ran(s), 0);

  // a step that finishes while you watch gives its icon a small bump
  const seenRunning = useRef(new Set<number>());
  steps.forEach((s, i) => { if (state(s) === 'run') seenRunning.current.add(i); });

  // the time on the playhead covers the axis labels it passes
  const grid = useRef<HTMLDivElement>(null);
  useIsoLayoutEffect(() => {
    const g = grid.current; if (!g) return;
    const b = g.querySelector('.dm-art-now')?.getBoundingClientRect(); if (!b) return;
    g.querySelectorAll('.dm-art-ticks span').forEach(el => { const x = el.getBoundingClientRect(); el.classList.toggle('dm-hid', x.right > b.left - 4 && x.left < b.right + 4); });
  });

  return (
    <div data-dm="" className={cx('dm-art', !bare && 'dm-panel', done ? 'dm-fin' : 'dm-live', className)} style={bare ? { paddingInline: 0 } : undefined}>
      <div className="dm-art-h">
        <span className="dm-art-hi" aria-hidden="true"><Icon name={icon} size="xs" /></span>
        <div className="dm-art-hd">
          <div className="dm-art-t">{title}</div>
          <Status className={cx('dm-art-s dm-num', done ? 'dm-muted' : 'dm-shim')} text={line} instant={!done} />
        </div>
        {done
          ? <span key="done" className={cx('dm-art-tag dm-tag dm-ok', changed)}><Icon name="check" size="xs" />Done</span>
          : <span key="run" className={cx('dm-art-tag dm-tag', changed)}><span className="dm-spin" aria-hidden="true" />Running</span>}
      </div>
      {kinds.length > 0 && (
        <div className="dm-art-key dm-num" role="list" aria-label="Time by kind of step">
          {kinds.map(k => <span key={k} role="listitem" style={{ '--dm-k': KIND[k][1] } as CSSProperties}><i />{kindLabels?.[k] ?? KIND[k][0]}<b>{per(k).toFixed(1)}s</b></span>)}
        </div>
      )}
      <div className="dm-art-grid" ref={grid} style={{ '--dm-p': (t / T).toFixed(4) } as CSSProperties}>
        <div className="dm-art-axis" aria-hidden="true">
          <span />
          <div className="dm-art-ticks">{(ticks ?? [0, 1, 2, 3, 4].map(k => (T * k) / 4)).map(v => <span key={v} style={{ left: pct(v / T) }}>{secs(v)}s</span>)}</div>
          <span />
        </div>
        <div className="dm-art-past" aria-hidden="true" />
        <div className="dm-art-rows">
          {steps.map((s, i) => {
            const st = state(s), w = Math.max(0, Math.min(s.duration, eased - s.start)), prev = steps[i - 1];
            const k = s.kind ? KIND[s.kind] : null;
            const tip = `${s.label}: ${s.duration.toFixed(1)}s${s.cost !== undefined ? `, $${s.cost.toFixed(2)}` : ''}${s.note ? `, ${s.note}` : ''}`;
            const e = enter(i * 40);
            const hue = { '--dm-k': s.color ?? (k ? k[1] : 'var(--dm-c1)'), '--dm-kt': k ? `var(--dm-${k[2]})` : 'var(--dm-fg2)', '--dm-kb': k ? `var(--dm-${k[2]}-bg)` : 'var(--dm-chip)' } as CSSProperties;
            return (
              <div key={i} className={cx('dm-art-row', e.className, st === 'done' && seenRunning.current.has(i) && 'dm-bump')} style={{ ...e.style, ...hue }} data-k={s.kind} data-s={st}>
                <span className="dm-art-lab">
                  <span className="dm-art-ic" aria-hidden="true">{s.brand ? <Brand name={s.brand} /> : s.icon && <Icon name={s.icon} size="xs" />}</span>
                  <span className="dm-t">{s.label}</span>
                  {st === 'fail' && <span className="dm-tag dm-bad dm-enter">{s.tag ?? 'Failed'}</span>}
                </span>
                <span className="dm-art-lane">
                  {s.retry && prev?.failed && <span className="dm-art-link" aria-hidden="true" style={{ left: pct((prev.start + prev.duration) / T), width: pct((s.start - prev.start - prev.duration) / T) }} />}
                  <Tip label={tip}>
                    <span className="dm-art-bar" style={{ left: pct(s.start / T), width: pct(w / T) }}><i /></span>
                  </Tip>
                </span>
                <span className="dm-art-d dm-num">{st === 'wait' ? '' : `${ran(s).toFixed(1)}s`}</span>
              </div>
            );
          })}
        </div>
        <div className="dm-art-head" aria-hidden="true"><i /><span className="dm-art-now dm-num">{done && <Icon name="check" size="xs" />}{t.toFixed(1)}s</span></div>
      </div>
      <div className="dm-art-f dm-muted dm-num">
        {figures.map((f, i) => <span key={i}>{f.icon && <Icon name={f.icon} size="xs" />}<span><b>{f.value}</b> {f.label}</span></span>)}
      </div>
    </div>
  );
}
agent-run-timeline.cssReact · 128 lines
/* Generated from designme.dev by scripts/sync.mjs. Edit the site, then sync. */
/* ---------- Agent run timeline ---------- */
/* each kind of step has a hue: --dm-k paints its bar, --dm-kt its text and icon, --dm-kb the icon's tint. The model is purple, tools
   are teal and apps orange, each app with its own mark. The playhead runs in the accent with the time on it, and the lanes it
   has passed take a faint wash; once the run is done it stops at the finish and turns green */
.dm-art{padding:var(--dm-s-4);--dm-lab:176px;--dm-dur:44px}
/* the head has a neutral mark in a tile as big as the steps' icons, so the steps' icons sit in its column and their names
   start where the title starts (owner, 18 Nov); the key lines up with the title's words too */
.dm-art-h{display:flex;align-items:center;gap:var(--dm-s-2)}
.dm-art-hi{width:22px;height:22px;border-radius:calc(7px * var(--dm-rk-m,var(--dm-rk)));display:grid;place-items:center;flex:none;background:var(--dm-chip);color:var(--dm-fg2)}
.dm-art-hd{flex:1;min-width:0}
.dm-art-t{font-weight:500;line-height:18px}
.dm-art-s{font-size:12.5px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-art-s.dm-sw{display:block}
.dm-art-tag{flex:none;transition:background .3s,color .3s}
.dm-art-tag .dm-spin{width:9px;height:9px}
.dm-art.dm-live .dm-art-tag{background:var(--dm-accent-bg);color:var(--dm-accent-fg,var(--dm-fg))}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art.dm-live .dm-art-tag:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:color-mix(in srgb,var(--dm-accent-mark) 20%,transparent)}
/* the key: how long each kind has run so far */
.dm-art-key{display:flex;flex-wrap:wrap;gap:2px var(--dm-s-4);margin-top:10px;padding-left:30px;font-size:12px;color:var(--dm-muted)}
.dm-art-key span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.dm-art-key i{width:8px;height:8px;border-radius:var(--dm-r-tiny,2px);background:var(--dm-k);flex:none}
.dm-art-key b{font-weight:500;color:var(--dm-fg2)}
.dm-art-grid{position:relative;margin-top:var(--dm-s-3)}
.dm-art-axis,.dm-art-row{display:grid;grid-template-columns:var(--dm-lab) minmax(0,1fr) var(--dm-dur);align-items:center}
.dm-art-axis{height:20px;font-size:11px;color:var(--dm-muted)}
.dm-art-ticks{position:relative;height:16px}
.dm-art-ticks span{position:absolute;top:0;transform:translateX(-50%);transition:opacity .2s}
.dm-art-ticks span:first-child{transform:none}
.dm-art-ticks span:last-child{transform:translateX(-100%)}
.dm-art-ticks span.dm-hid{opacity:0}
.dm-art-rows{position:relative}
.dm-art-row{height:32px}
.dm-art-lab{display:flex;align-items:center;gap:var(--dm-s-2);min-width:0;padding-right:var(--dm-s-3);font-size:12.5px;color:var(--dm-fg2);white-space:nowrap;transition:color .3s}
.dm-art-lab .dm-t{min-width:0;overflow:hidden;text-overflow:ellipsis}
.dm-art-lab .dm-tag{flex:none}
.dm-art-ic{--dm-ring:0 0 0 0 transparent;width:22px;height:22px;border-radius:calc(7px * var(--dm-rk-m,var(--dm-rk)));display:grid;place-items:center;flex:none;background:var(--dm-kb);color:var(--dm-kt);box-shadow:var(--dm-ring);transition:opacity .3s}
.dm-art-ic .dm-brand{width:13px;height:13px}
/* an app's own mark sits on a plain tile */
.dm-art-row[data-k="app"] .dm-art-ic{--dm-ring:inset 0 0 0 1px color-mix(in srgb,var(--dm-rail) 50%,transparent);background:var(--dm-surface);color:var(--dm-fg)}
/* a step that hasn't started waits quietly; the one at work breathes a ring of its hue round its icon */
.dm-art-row[data-s="wait"] .dm-art-lab{color:var(--dm-muted)}
.dm-art-row[data-s="wait"] .dm-art-ic{opacity:.45}
.dm-art-row[data-s="run"] .dm-art-lab{color:var(--dm-fg)}
.dm-art-row[data-s="run"] .dm-art-ic{animation:dm-artbreathe 1.8s var(--dm-ease-io) infinite}
/* (the running step's icon breathes with its opacity: a ring spreading out of it would reach past the card's 16px column) */
@keyframes dm-artbreathe{50%{opacity:.55}}
.dm-art-row.dm-bump .dm-art-ic{animation:dm-artpop .45s var(--dm-ease)}
@keyframes dm-artpop{40%{transform:scale(1.14)}}
/* the lanes: quarter lines at half strength, a bar for each step */
.dm-art-lane{position:relative;height:100%;background:linear-gradient(90deg,color-mix(in srgb,var(--dm-line) 50%,transparent) 1px,transparent 1px) 0 0/25% 100%;box-shadow:inset -1px 0 color-mix(in srgb,var(--dm-line) 50%,transparent)}
.dm-art-bar{position:absolute;top:9px;height:14px;width:0;border-radius:var(--dm-r-tiny,5px);background:linear-gradient(90deg,var(--dm-k),color-mix(in oklab,var(--dm-k) 82%,#fff));cursor:default;transition:filter .2s}
@media (hover:hover) and (pointer:fine){.dm-art-bar:hover{filter:brightness(1.08) saturate(1.1)}}
/* the bar at work carries a passing light and a bright leading edge */
.dm-art-row[data-s="run"] .dm-art-bar{background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.42) 46%,transparent 62%) 0 0/250% 100% no-repeat,var(--dm-k);animation:dm-artsheen 1.3s linear infinite}
.dm-art-bar i{display:none;position:absolute;right:-1px;top:-3px;bottom:-3px;width:2px;border-radius:1px;background:var(--dm-k);box-shadow:none}
.dm-art-row[data-s="run"] .dm-art-bar i{display:block}
@keyframes dm-artsheen{from{background-position:120% 0,0 0}to{background-position:-120% 0,0 0}}
.dm-art-row[data-s="fail"] .dm-art-bar{background:repeating-linear-gradient(135deg,var(--dm-c5) 0 3px,color-mix(in srgb,var(--dm-c5) 45%,var(--dm-surface)) 3px 6px)}
/* a retry hangs off the end of the step that failed */
.dm-art-link{position:absolute;top:-9px;height:25px;min-width:6px;border-left:1px dashed var(--dm-warn-mark);border-bottom:1px dashed var(--dm-warn-mark);pointer-events:none;display:none}
.dm-art-row:not([data-s="wait"]) .dm-art-link{display:block;animation:dm-artdraw .5s var(--dm-ease) backwards}
@keyframes dm-artdraw{from{clip-path:inset(0 100% 100% 0)}to{clip-path:inset(0)}}
/* how long each step took, counting while it runs */
.dm-art-d{font-size:12px;color:var(--dm-muted);text-align:right;white-space:nowrap}
.dm-art-row[data-s="run"] .dm-art-d{color:var(--dm-kt)}
.dm-art-row[data-s="done"] .dm-art-d{color:var(--dm-fg2)}
.dm-art-row[data-s="fail"] .dm-art-d{color:var(--dm-bad)}
/* the playhead, with the time on the axis, and the wash over what it has passed */
.dm-art-past{position:absolute;top:20px;bottom:0;left:var(--dm-lab);width:calc((100% - var(--dm-lab) - var(--dm-dur)) * var(--dm-p,0));background:linear-gradient(90deg,transparent,var(--dm-sel));pointer-events:none;opacity:0;transition:opacity .5s}
.dm-art.dm-live .dm-art-past{opacity:1}
.dm-art-head{position:absolute;top:2px;bottom:0;left:calc(var(--dm-lab) + (100% - var(--dm-lab) - var(--dm-dur)) * var(--dm-p,0));width:0;pointer-events:none;opacity:0;transition:opacity .4s}
.dm-art.dm-live .dm-art-head,.dm-art.dm-fin .dm-art-head{opacity:1}
.dm-art-head i{position:absolute;top:16px;bottom:0;left:-.75px;width:1.5px;border-radius:1px;background:var(--dm-accent-mark,var(--dm-accent));transition:background .4s}
.dm-art-now{position:absolute;top:0;left:0;transform:translateX(-50%);display:inline-flex;align-items:center;gap:3px;height:16px;padding:0 5px;border-radius:var(--dm-r-tiny,5px);background:var(--dm-accent);color:var(--dm-on-accent);font-size:11px;font-weight:500;line-height:1;white-space:nowrap;transition:background .4s,color .4s}
.dm-art-now .dm-i{width:10px;height:10px}
.dm-art.dm-fin .dm-art-head i{background:var(--dm-ok-mark)}
.dm-art.dm-fin .dm-art-now{background:var(--dm-ok-bg);color:var(--dm-ok)}
.dm-art-f{display:flex;flex-wrap:wrap;gap:var(--dm-s-2) var(--dm-s-5);margin-top:var(--dm-s-3);padding-top:var(--dm-s-4);border-top:1px solid color-mix(in srgb,var(--dm-line) 50%,transparent);font-size:12.5px;line-height:16px}
/* each figure's icon is centred in the steps' icon column (22px) and its words start on their names' column */
.dm-art-f>span{display:inline-flex;align-items:center;gap:var(--dm-s-2);white-space:nowrap}
.dm-art-f>span>svg{box-sizing:content-box;padding:0 5px}
.dm-art-f b{color:var(--dm-fg);font-weight:500}
@media (max-width:600px){.dm-art{--dm-lab:112px;--dm-dur:38px}.dm-art-lab{padding-right:var(--dm-s-2)}.dm-art-lab .dm-tag{display:none}.dm-art-f{gap:var(--dm-s-2) var(--dm-s-4)}
  /* the head's tile, the steps' icons and the figures keep 8px to their words on a narrow card too (owner, 2 Dec: the title
     sat too close to its tile), and the key starts on the words' column */
  .dm-art-key{padding-left:30px}}
/* a phone: each step's name sits on its own line above its bar, so it is read in full; the bars take the whole width */
@media (max-width:480px){
  .dm-art{--dm-lab:0px}
  .dm-art-row{height:auto;grid-template-rows:auto 22px;row-gap:2px;padding:5px 0 3px}
  .dm-art-row .dm-art-lab{grid-column:1/-1;grid-row:1;padding-right:0}
  .dm-art-row .dm-art-lab .dm-t{white-space:normal;overflow:visible}
  .dm-art-row .dm-art-lane{grid-column:2;grid-row:2;height:22px}
  .dm-art-row .dm-art-d{grid-column:3;grid-row:2}
  .dm-art-bar{top:4px}
  .dm-art-ic,.dm-art-hi{width:20px;height:20px}
  .dm-art-key{padding-left:28px}
  .dm-art-f>span>svg{padding:0 4px}
  .dm-art-link{top:-35px;height:39px}
}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){--dm-ring:inset 0 0 0 1px color-mix(in srgb,var(--dm-k) 35%,transparent)}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-row[data-k="app"] .dm-art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){--dm-ring:inset 0 0 0 1px color-mix(in srgb,var(--dm-rail) 50%,transparent)}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-row[data-s="run"] .dm-art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){animation:dm-artbp 1s steps(1,end) infinite}
@keyframes dm-artbp{0%,55%{box-shadow:inset 0 0 0 1px var(--dm-k)}56%,100%{box-shadow:var(--dm-ring)}}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-row.dm-bump .dm-art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){animation:none}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-row[data-s="fail"] .dm-art-bar:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:repeating-linear-gradient(135deg,var(--dm-c5) 0 3px,color-mix(in srgb,var(--dm-c5) 45%,var(--dm-surface)) 3px 6px)}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-bar:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:var(--dm-k)}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-row[data-s="run"] .dm-art-bar:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:linear-gradient(135deg,var(--dm-k) 25%,color-mix(in srgb,var(--dm-k) 50%,var(--dm-surface)) 25% 50%,var(--dm-k) 50% 75%,color-mix(in srgb,var(--dm-k) 50%,var(--dm-surface)) 75%) 0 0/8px 8px;animation:dm-artmarch .6s steps(4) infinite}
@keyframes dm-artmarch{to{background-position:8px 0}}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-bar i:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){width:1px;right:0;box-shadow:none}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-link:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){border-left-style:solid;border-bottom-style:solid}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-row:not([data-s="wait"]) .dm-art-link:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){animation:dm-artdrawbp .3s steps(3,end) backwards}
@keyframes dm-artdrawbp{from{clip-path:inset(0 100% 100% 0)}to{clip-path:inset(0)}}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-past:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:repeating-linear-gradient(135deg,transparent 0 5px,var(--dm-grid) 5px 6px)}
:root:not([data-style="soft"],[data-style="studio"]) .dm-art-head i:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){width:1px;left:-.5px}
/* Studio (owner, 17 and 18 Nov): the kinds of step keep their colours as flat, round bars; the failed run a red hatch with no
   red fill; round icon tiles, the head's with a hairline; the totals an off-white foot strip. The content sits 16px in from
   every edge and 16px over the strip */
:root[data-style="studio"] .dm-art,:root [data-style="studio"] .dm-art,:root [data-style="studio"].dm-art{padding:16px 16px 0}
:root[data-style="studio"] .dm-art-hi,:root [data-style="studio"] .dm-art-hi,:root [data-style="studio"].dm-art-hi{box-shadow:inset 0 0 0 1px var(--dm-hair)}
:root[data-style="studio"] .dm-art-lab .dm-tag.dm-bad,:root [data-style="studio"] .dm-art-lab .dm-tag.dm-bad,:root [data-style="studio"].dm-art-lab .dm-tag.dm-bad{background:var(--dm-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dm-bad-mark) 45%,transparent)}
:root[data-style="studio"] .dm-art-bar,:root [data-style="studio"] .dm-art-bar,:root [data-style="studio"].dm-art-bar,:root[data-style="studio"] .dm-art-row[data-s="run"] .dm-art-bar,:root [data-style="studio"] .dm-art-row[data-s="run"] .dm-art-bar,:root [data-style="studio"].dm-art-row[data-s="run"] .dm-art-bar{top:11px;height:10px;border-radius:var(--dm-r-tiny,3px);background:var(--dm-k);animation:none}
@media (hover:hover) and (pointer:fine){:root[data-style="studio"] .dm-art-bar:hover,:root [data-style="studio"] .dm-art-bar:hover,:root [data-style="studio"].dm-art-bar:hover{filter:none}}
:root[data-style="studio"] .dm-art-row[data-s="fail"] .dm-art-bar,:root [data-style="studio"] .dm-art-row[data-s="fail"] .dm-art-bar,:root [data-style="studio"].dm-art-row[data-s="fail"] .dm-art-bar{background:repeating-linear-gradient(135deg,var(--dm-bad-mark) 0 2px,transparent 2px 5px);box-shadow:inset 0 0 0 1px var(--dm-bad-mark)}
:root[data-style="studio"] .dm-art-f,:root [data-style="studio"] .dm-art-f,:root [data-style="studio"].dm-art-f{margin:11px -16px 0;padding:calc(var(--dm-strip-y) + 5px) 16px;line-height:18px;background:var(--dm-strip);border-top:1px solid var(--dm-line);border-radius:0 0 var(--dm-r-card) var(--dm-r-card)}
/* (the figures keep the base's columns: each icon centred on the steps' icon column, its words on their names' column) */
AgentRunTimeline.astroAstro · 34 lines
---
// Generated from designme.dev by scripts/sync.mjs. Edit the site, then sync.
// Agent run timeline: Every model and tool step of a run on one time axis.
// The markup, CSS and script are designme.dev's own, run by the shared core in ../core, which mounts the component when it scrolls
// into view and plays its demo. To show your own data, change agent-run-timeline.js. The markup is kept exactly as it is (is:raw).
import type { HTMLAttributes } from 'astro/types';
import '../core/designme.css';
import './agent-run-timeline.css';

export interface Props extends HTMLAttributes<'div'> {
  /** "soft" or "studio" draws it in that style. Leave it out for Blueprint, or for the style set on <html> (data-style="soft" or "studio") */
  'data-style'?: 'soft' | 'studio';
}
const { class: className, ...rest } = Astro.props;
---
<div class:list={['card', 'wide', className]} data-c="agent-run-timeline" {...rest}>
  <div class="stage-in"><Fragment is:raw>
<div class="art panel">
  <div class="art-h"><span class="art-hi" aria-hidden="true"></span><div class="art-hd"><div class="art-t">Run 4821, update the pricing page</div><div class="art-s muted num">Starting</div></div><span class="art-tag tag"><span class="spin" aria-hidden="true"></span>Running</span></div>
  <div class="art-key num" role="list" aria-label="Time by kind of step"></div>
  <div class="art-grid">
    <div class="art-axis" aria-hidden="true"><span></span><div class="art-ticks"></div><span></span></div>
    <div class="art-past" aria-hidden="true"></div>
    <div class="art-rows"></div>
    <div class="art-head" aria-hidden="true"><i></i><span class="art-now num">0.0s</span></div>
  </div>
  <div class="art-f muted num"></div>
</div>
  </Fragment></div>
</div>
<script>
  import './agent-run-timeline.js';
</script>
agent-run-timeline.htmlHTML · 16 lines
<div class="card wide" data-c="agent-run-timeline">
  <div class="stage-in">
    <div class="art panel">
      <div class="art-h"><span class="art-hi" aria-hidden="true"></span><div class="art-hd"><div class="art-t">Run 4821, update the pricing page</div><div class="art-s muted num">Starting</div></div><span class="art-tag tag"><span class="spin" aria-hidden="true"></span>Running</span></div>
      <div class="art-key num" role="list" aria-label="Time by kind of step"></div>
      <div class="art-grid">
        <div class="art-axis" aria-hidden="true"><span></span><div class="art-ticks"></div><span></span></div>
        <div class="art-past" aria-hidden="true"></div>
        <div class="art-rows"></div>
        <div class="art-head" aria-hidden="true"><i></i><span class="art-now num">0.0s</span></div>
      </div>
      <div class="art-f muted num"></div>
    </div>
  </div>
</div>
agent-run-timeline.cssHTML · 127 lines
/* ---------- Agent run timeline ---------- */
/* each kind of step has a hue: --dm-k paints its bar, --dm-kt its text and icon, --dm-kb the icon's tint. The model is purple, tools
   are teal and apps orange, each app with its own mark. The playhead runs in the accent with the time on it, and the lanes it
   has passed take a faint wash; once the run is done it stops at the finish and turns green */
.art{padding:var(--dm-s-4);--dm-lab:176px;--dm-dur:44px}
/* the head has a neutral mark in a tile as big as the steps' icons, so the steps' icons sit in its column and their names
   start where the title starts (owner, 18 Nov); the key lines up with the title's words too */
.art-h{display:flex;align-items:center;gap:var(--dm-s-2)}
.art-hi{width:22px;height:22px;border-radius:calc(7px * var(--dm-rk-m,var(--dm-rk)));display:grid;place-items:center;flex:none;background:var(--dm-chip);color:var(--dm-fg2)}
.art-hd{flex:1;min-width:0}
.art-t{font-weight:500;line-height:18px}
.art-s{font-size:12.5px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.art-s.sw{display:block}
.art-tag{flex:none;transition:background .3s,color .3s}
.art-tag .spin{width:9px;height:9px}
.art.live .art-tag{background:var(--dm-accent-bg);color:var(--dm-accent-fg,var(--dm-fg))}
:root:not([data-style="soft"],[data-style="studio"]) .art.live .art-tag:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:color-mix(in srgb,var(--dm-accent-mark) 20%,transparent)}
/* the key: how long each kind has run so far */
.art-key{display:flex;flex-wrap:wrap;gap:2px var(--dm-s-4);margin-top:10px;padding-left:30px;font-size:12px;color:var(--dm-muted)}
.art-key span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.art-key i{width:8px;height:8px;border-radius:var(--dm-r-tiny,2px);background:var(--dm-k);flex:none}
.art-key b{font-weight:500;color:var(--dm-fg2)}
.art-grid{position:relative;margin-top:var(--dm-s-3)}
.art-axis,.art-row{display:grid;grid-template-columns:var(--dm-lab) minmax(0,1fr) var(--dm-dur);align-items:center}
.art-axis{height:20px;font-size:11px;color:var(--dm-muted)}
.art-ticks{position:relative;height:16px}
.art-ticks span{position:absolute;top:0;transform:translateX(-50%);transition:opacity .2s}
.art-ticks span:first-child{transform:none}
.art-ticks span:last-child{transform:translateX(-100%)}
.art-ticks span.hid{opacity:0}
.art-rows{position:relative}
.art-row{height:32px}
.art-lab{display:flex;align-items:center;gap:var(--dm-s-2);min-width:0;padding-right:var(--dm-s-3);font-size:12.5px;color:var(--dm-fg2);white-space:nowrap;transition:color .3s}
.art-lab .t{min-width:0;overflow:hidden;text-overflow:ellipsis}
.art-lab .tag{flex:none}
.art-ic{--dm-ring:0 0 0 0 transparent;width:22px;height:22px;border-radius:calc(7px * var(--dm-rk-m,var(--dm-rk)));display:grid;place-items:center;flex:none;background:var(--dm-kb);color:var(--dm-kt);box-shadow:var(--dm-ring);transition:opacity .3s}
.art-ic .brand{width:13px;height:13px}
/* an app's own mark sits on a plain tile */
.art-row[data-k="app"] .art-ic{--dm-ring:inset 0 0 0 1px color-mix(in srgb,var(--dm-rail) 50%,transparent);background:var(--dm-surface);color:var(--dm-fg)}
/* a step that hasn't started waits quietly; the one at work breathes a ring of its hue round its icon */
.art-row[data-s="wait"] .art-lab{color:var(--dm-muted)}
.art-row[data-s="wait"] .art-ic{opacity:.45}
.art-row[data-s="run"] .art-lab{color:var(--dm-fg)}
.art-row[data-s="run"] .art-ic{animation:artbreathe 1.8s var(--dm-ease-io) infinite}
/* (the running step's icon breathes with its opacity: a ring spreading out of it would reach past the card's 16px column) */
@keyframes artbreathe{50%{opacity:.55}}
.art-row.bump .art-ic{animation:artpop .45s var(--dm-ease)}
@keyframes artpop{40%{transform:scale(1.14)}}
/* the lanes: quarter lines at half strength, a bar for each step */
.art-lane{position:relative;height:100%;background:linear-gradient(90deg,color-mix(in srgb,var(--dm-line) 50%,transparent) 1px,transparent 1px) 0 0/25% 100%;box-shadow:inset -1px 0 color-mix(in srgb,var(--dm-line) 50%,transparent)}
.art-bar{position:absolute;top:9px;height:14px;width:0;border-radius:var(--dm-r-tiny,5px);background:linear-gradient(90deg,var(--dm-k),color-mix(in oklab,var(--dm-k) 82%,#fff));cursor:default;transition:filter .2s}
@media (hover:hover) and (pointer:fine){.art-bar:hover{filter:brightness(1.08) saturate(1.1)}}
/* the bar at work carries a passing light and a bright leading edge */
.art-row[data-s="run"] .art-bar{background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.42) 46%,transparent 62%) 0 0/250% 100% no-repeat,var(--dm-k);animation:artsheen 1.3s linear infinite}
.art-bar i{display:none;position:absolute;right:-1px;top:-3px;bottom:-3px;width:2px;border-radius:1px;background:var(--dm-k);box-shadow:none}
.art-row[data-s="run"] .art-bar i{display:block}
@keyframes artsheen{from{background-position:120% 0,0 0}to{background-position:-120% 0,0 0}}
.art-row[data-s="fail"] .art-bar{background:repeating-linear-gradient(135deg,var(--dm-c5) 0 3px,color-mix(in srgb,var(--dm-c5) 45%,var(--dm-surface)) 3px 6px)}
/* a retry hangs off the end of the step that failed */
.art-link{position:absolute;top:-9px;height:25px;min-width:6px;border-left:1px dashed var(--dm-warn-mark);border-bottom:1px dashed var(--dm-warn-mark);pointer-events:none;display:none}
.art-row:not([data-s="wait"]) .art-link{display:block;animation:artdraw .5s var(--dm-ease) backwards}
@keyframes artdraw{from{clip-path:inset(0 100% 100% 0)}to{clip-path:inset(0)}}
/* how long each step took, counting while it runs */
.art-d{font-size:12px;color:var(--dm-muted);text-align:right;white-space:nowrap}
.art-row[data-s="run"] .art-d{color:var(--dm-kt)}
.art-row[data-s="done"] .art-d{color:var(--dm-fg2)}
.art-row[data-s="fail"] .art-d{color:var(--dm-bad)}
/* the playhead, with the time on the axis, and the wash over what it has passed */
.art-past{position:absolute;top:20px;bottom:0;left:var(--dm-lab);width:calc((100% - var(--dm-lab) - var(--dm-dur)) * var(--dm-p,0));background:linear-gradient(90deg,transparent,var(--dm-sel));pointer-events:none;opacity:0;transition:opacity .5s}
.art.live .art-past{opacity:1}
.art-head{position:absolute;top:2px;bottom:0;left:calc(var(--dm-lab) + (100% - var(--dm-lab) - var(--dm-dur)) * var(--dm-p,0));width:0;pointer-events:none;opacity:0;transition:opacity .4s}
.art.live .art-head,.art.fin .art-head{opacity:1}
.art-head i{position:absolute;top:16px;bottom:0;left:-.75px;width:1.5px;border-radius:1px;background:var(--dm-accent-mark,var(--dm-accent));transition:background .4s}
.art-now{position:absolute;top:0;left:0;transform:translateX(-50%);display:inline-flex;align-items:center;gap:3px;height:16px;padding:0 5px;border-radius:var(--dm-r-tiny,5px);background:var(--dm-accent);color:var(--dm-on-accent);font-size:11px;font-weight:500;line-height:1;white-space:nowrap;transition:background .4s,color .4s}
.art-now .i{width:10px;height:10px}
.art.fin .art-head i{background:var(--dm-ok-mark)}
.art.fin .art-now{background:var(--dm-ok-bg);color:var(--dm-ok)}
.art-f{display:flex;flex-wrap:wrap;gap:var(--dm-s-2) var(--dm-s-5);margin-top:var(--dm-s-3);padding-top:var(--dm-s-4);border-top:1px solid color-mix(in srgb,var(--dm-line) 50%,transparent);font-size:12.5px;line-height:16px}
/* each figure's icon is centred in the steps' icon column (22px) and its words start on their names' column */
.art-f>span{display:inline-flex;align-items:center;gap:var(--dm-s-2);white-space:nowrap}
.art-f>span>svg{box-sizing:content-box;padding:0 5px}
.art-f b{color:var(--dm-fg);font-weight:500}
@media (max-width:600px){.art{--dm-lab:112px;--dm-dur:38px}.art-lab{padding-right:var(--dm-s-2)}.art-lab .tag{display:none}.art-f{gap:var(--dm-s-2) var(--dm-s-4)}
  /* the head's tile, the steps' icons and the figures keep 8px to their words on a narrow card too (owner, 2 Dec: the title
     sat too close to its tile), and the key starts on the words' column */
  .art-key{padding-left:30px}}
/* a phone: each step's name sits on its own line above its bar, so it is read in full; the bars take the whole width */
@media (max-width:480px){
  .art{--dm-lab:0px}
  .art-row{height:auto;grid-template-rows:auto 22px;row-gap:2px;padding:5px 0 3px}
  .art-row .art-lab{grid-column:1/-1;grid-row:1;padding-right:0}
  .art-row .art-lab .t{white-space:normal;overflow:visible}
  .art-row .art-lane{grid-column:2;grid-row:2;height:22px}
  .art-row .art-d{grid-column:3;grid-row:2}
  .art-bar{top:4px}
  .art-ic,.art-hi{width:20px;height:20px}
  .art-key{padding-left:28px}
  .art-f>span>svg{padding:0 4px}
  .art-link{top:-35px;height:39px}
}
:root:not([data-style="soft"],[data-style="studio"]) .art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){--dm-ring:inset 0 0 0 1px color-mix(in srgb,var(--dm-k) 35%,transparent)}
:root:not([data-style="soft"],[data-style="studio"]) .art-row[data-k="app"] .art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){--dm-ring:inset 0 0 0 1px color-mix(in srgb,var(--dm-rail) 50%,transparent)}
:root:not([data-style="soft"],[data-style="studio"]) .art-row[data-s="run"] .art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){animation:artbp 1s steps(1,end) infinite}
@keyframes artbp{0%,55%{box-shadow:inset 0 0 0 1px var(--dm-k)}56%,100%{box-shadow:var(--dm-ring)}}
:root:not([data-style="soft"],[data-style="studio"]) .art-row.bump .art-ic:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){animation:none}
:root:not([data-style="soft"],[data-style="studio"]) .art-row[data-s="fail"] .art-bar:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:repeating-linear-gradient(135deg,var(--dm-c5) 0 3px,color-mix(in srgb,var(--dm-c5) 45%,var(--dm-surface)) 3px 6px)}
:root:not([data-style="soft"],[data-style="studio"]) .art-bar:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:var(--dm-k)}
:root:not([data-style="soft"],[data-style="studio"]) .art-row[data-s="run"] .art-bar:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:linear-gradient(135deg,var(--dm-k) 25%,color-mix(in srgb,var(--dm-k) 50%,var(--dm-surface)) 25% 50%,var(--dm-k) 50% 75%,color-mix(in srgb,var(--dm-k) 50%,var(--dm-surface)) 75%) 0 0/8px 8px;animation:artmarch .6s steps(4) infinite}
@keyframes artmarch{to{background-position:8px 0}}
:root:not([data-style="soft"],[data-style="studio"]) .art-bar i:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){width:1px;right:0;box-shadow:none}
:root:not([data-style="soft"],[data-style="studio"]) .art-link:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){border-left-style:solid;border-bottom-style:solid}
:root:not([data-style="soft"],[data-style="studio"]) .art-row:not([data-s="wait"]) .art-link:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){animation:artdrawbp .3s steps(3,end) backwards}
@keyframes artdrawbp{from{clip-path:inset(0 100% 100% 0)}to{clip-path:inset(0)}}
:root:not([data-style="soft"],[data-style="studio"]) .art-past:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:repeating-linear-gradient(135deg,transparent 0 5px,var(--dm-grid) 5px 6px)}
:root:not([data-style="soft"],[data-style="studio"]) .art-head i:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){width:1px;left:-.5px}
/* Studio (owner, 17 and 18 Nov): the kinds of step keep their colours as flat, round bars; the failed run a red hatch with no
   red fill; round icon tiles, the head's with a hairline; the totals an off-white foot strip. The content sits 16px in from
   every edge and 16px over the strip */
:root[data-style="studio"] .art,:root [data-style="studio"] .art,:root [data-style="studio"].art{padding:16px 16px 0}
:root[data-style="studio"] .art-hi,:root [data-style="studio"] .art-hi,:root [data-style="studio"].art-hi{box-shadow:inset 0 0 0 1px var(--dm-hair)}
:root[data-style="studio"] .art-lab .tag.bad,:root [data-style="studio"] .art-lab .tag.bad,:root [data-style="studio"].art-lab .tag.bad{background:var(--dm-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dm-bad-mark) 45%,transparent)}
:root[data-style="studio"] .art-bar,:root [data-style="studio"] .art-bar,:root [data-style="studio"].art-bar,:root[data-style="studio"] .art-row[data-s="run"] .art-bar,:root [data-style="studio"] .art-row[data-s="run"] .art-bar,:root [data-style="studio"].art-row[data-s="run"] .art-bar{top:11px;height:10px;border-radius:var(--dm-r-tiny,3px);background:var(--dm-k);animation:none}
@media (hover:hover) and (pointer:fine){:root[data-style="studio"] .art-bar:hover,:root [data-style="studio"] .art-bar:hover,:root [data-style="studio"].art-bar:hover{filter:none}}
:root[data-style="studio"] .art-row[data-s="fail"] .art-bar,:root [data-style="studio"] .art-row[data-s="fail"] .art-bar,:root [data-style="studio"].art-row[data-s="fail"] .art-bar{background:repeating-linear-gradient(135deg,var(--dm-bad-mark) 0 2px,transparent 2px 5px);box-shadow:inset 0 0 0 1px var(--dm-bad-mark)}
:root[data-style="studio"] .art-f,:root [data-style="studio"] .art-f,:root [data-style="studio"].art-f{margin:11px -16px 0;padding:calc(var(--dm-strip-y) + 5px) 16px;line-height:18px;background:var(--dm-strip);border-top:1px solid var(--dm-line);border-radius:0 0 var(--dm-r-card) var(--dm-r-card)}
/* (the figures keep the base's columns: each icon centred on the steps' icon column, its words on their names' column) */
agent-run-timeline.jsHTML · 78 lines
DM.def('agent-run-timeline', (r, c) => {
  // each kind of step has a hue (a chart colour for its bar, the palette slot for its text and icon tint) and a name in the key.
  // Teal and orange take a little of their text slot, so the bars keep 3:1 on a light stage
  const K = { model:['Model', 'var(--dm-c2)', 'pl'], tool:['Tools', 'color-mix(in srgb,var(--dm-c6) 70%,var(--dm-pt))', 'pt'], app:['Apps', 'color-mix(in srgb,var(--dm-c4) 75%,var(--dm-pp))', 'pp'] };
  // an icon starting with @ is an app's own mark
  const S = [
    { l:'Plan the change', ic:'brain', k:'model', s:0, d:1.6, cost:.03 },
    { l:'Read 6 files', ic:'file-text', k:'tool', s:1.6, d:2.2, cost:.02 },
    { l:'Search Figma', ic:'@figma', k:'app', s:1.9, d:1.4, cost:.01 },
    { l:'Edit PricingCard', ic:'edit', k:'model', s:4, d:2.4, cost:.06 },
    { l:'Run tests', ic:'term', k:'tool', s:6.5, d:1.5, cost:.01, fail:'2 failed' },
    { l:'Run tests again', ic:'refresh', k:'tool', s:8.1, d:1.9, cost:.01, retry:true },
    { l:'Open a PR on GitHub', ic:'@github', k:'app', s:10.1, d:1, cost:.02 },
    { l:'Post to Slack', ic:'@slack', k:'app', s:11.1, d:.6, cost:.01 }
  ];
  const T = 12, END = Math.max(...S.map(s => s.s + s.d)), PACE = 1.6, TK = [0, 3, 6, 9, 12];
  const art = $('.art', r), grid = $('.art-grid', r), rows = $('.art-rows', r), now = $('.art-now', r), head = $('.art-head', r), st = $('.art-s', r), foot = $('.art-f', r);
  $('.art-hi', r).innerHTML = I('bolt', 'xs');
  $('.art-ticks', r).innerHTML = TK.map(t => `<span style="left:${t / T * 100}%">${t}s</span>`).join('');
  const ticks = $$('.art-ticks span', r);
  $('.art-key', r).innerHTML = Object.entries(K).map(([id, k]) => `<span role="listitem" style="--dm-k:${k[1]}"><i></i>${k[0]}<b data-k="${id}">0.0s</b></span>`).join('');
  const kb = Object.fromEntries($$('.art-key b', r).map(b => [b.dataset.k, b]));
  const pct = v => v / T * 100 + '%';
  S.forEach((s, i) => {
    const k = K[s.k], prev = S[i - 1];
    const link = s.retry && prev ? `<span class="art-link" aria-hidden="true" style="left:${pct(prev.s + prev.d)};width:${pct(s.s - prev.s - prev.d)}"></span>` : '';
    s.el = html(`<div class="art-row" data-k="${s.k}" data-s="wait" style="--dm-k:${k[1]};--dm-kt:var(--dm-${k[2]});--dm-kb:var(--dm-${k[2]}-bg)"><span class="art-lab"><span class="art-ic" aria-hidden="true">${s.ic[0] === '@' ? BRAND[s.ic.slice(1)] : I(s.ic, 'xs')}</span><span class="t">${s.l}</span></span><span class="art-lane">${link}<span class="art-bar" style="left:${pct(s.s)}" data-tip="${s.l}: ${s.d.toFixed(1)}s, $${s.cost.toFixed(2)}${s.fail ? ', 2 tests failed' : ''}"><i></i></span></span><span class="art-d num"></span></div>`);
    s.bar = $('.art-bar', s.el); s.dur = $('.art-d', s.el); s.st = 'wait';
    rows.appendChild(s.el);
  });
  stagger($$('.art-row', r), 40);
  let line = '', ft = '';
  // the run as it stands t seconds in: bars, states, times, the key, the footer and the line under the title
  function draw(t){
    grid.style.setProperty('--dm-p', (t / T).toFixed(4));
    let cost = 0, n = 0, re = 0; const per = { model:0, tool:0, app:0 }, live = [];
    S.forEach(s => {
      const w = Math.max(0, Math.min(s.d, t - s.s)), was = s.st;
      s.st = t < s.s ? 'wait' : t < s.s + s.d ? 'run' : s.fail ? 'fail' : 'done';
      s.bar.style.width = pct(w);
      s.dur.textContent = t >= s.s ? w.toFixed(1) + 's' : '';
      if (s.st !== was){
        s.el.dataset.s = s.st;
        if (s.st === 'fail'){ const tg = html(`<span class="tag bad">${s.fail}</span>`); $('.art-lab', s.el).appendChild(tg); enter(tg); }
        if (s.st === 'done'){ s.el.classList.remove('bump'); void s.el.offsetWidth; s.el.classList.add('bump'); }
      }
      if (t >= s.s){ n++; cost += s.cost * w / s.d; per[s.k] += w; }
      if (s.st === 'fail') re++;
      if (s.st === 'run') live.push(s.l);
    });
    for (const k in per) kb[k].textContent = per[k].toFixed(1) + 's';
    const f = `<span>${I('clock','xs')}<span><b>${Math.min(t, END).toFixed(1)}s</b> total</span></span><span>${I('dollar','xs')}<span><b>$${cost.toFixed(2)}</b> cost</span></span><span>${I('layers','xs')}<span><b>${n}</b> ${n === 1 ? 'step' : 'steps'}</span></span><span>${I('refresh','xs')}<span><b>${re}</b> ${re === 1 ? 'retry' : 'retries'}</span></span>`;
    if (f !== ft){ foot.innerHTML = f; ft = f; }
    // between two steps the line keeps the last one's name, so it never flickers
    if (live.length && live.join(', ') !== line){ line = live.join(', '); st.textContent = line; }
    now.textContent = t.toFixed(1) + 's';
    // the playhead is placed by the script as it moves (it is no column of the card)
    head.style.left = `calc(var(--dm-lab) + (100% - var(--dm-lab) - var(--dm-dur)) * ${(t / T).toFixed(4)})`;
    // the time on the playhead covers the axis labels it passes
    const b = now.getBoundingClientRect();
    ticks.forEach(el => { const x = el.getBoundingClientRect(); el.classList.toggle('hid', x.right > b.left - 4 && x.left < b.right + 4); });
  }
  draw(0);
  c.run(async () => {
    await c.wait(500);
    art.classList.add('live'); st.classList.remove('muted'); st.classList.add('shim');
    // time moves on only while the demo isn't held, so a mouse resting on it stops the playhead where it is: a long gap
    // between two frames is a hold (or the card being away) ending, and counts as one frame
    await new Promise(res => { let t = 0, last = 0; c.loop(ts => { const dt = last && ts - last < 250 ? ts - last : 16; last = ts; t = Math.min(END, t + dt / 1000 * PACE); draw(t); if (t >= END){ res(); return false; } }); });
    art.classList.remove('live'); art.classList.add('fin');
    st.classList.remove('shim'); st.classList.add('muted');
    now.innerHTML = I('check','xs') + END.toFixed(1) + 's';
    const tag = $('.art-tag', r); tag.className = 'art-tag tag ok'; tag.innerHTML = I('check','xs') + 'Done'; enter(tag);
    // what the run did, not its time or retries again: the totals under the chart already say those (owner, 18 Nov)
    swap(st, 'Opened a PR and posted to Slack');
  });
});
06

Questions

What people ask about it.

How do I follow a run live?
Keep the steps you know about in steps and update time with the seconds since the run started, for example on each animation frame. When the run ends, leave time out.
How do I show a failed step and its retry?
Mark the failed step with failed: true, a short tag like "2 failed" and an optional note for its tooltip, then add the retry as its own step after it with retry: true. The footer counts the failed steps as retries.
Which app marks can a step show?
Set brand to one of the marks the components share: google, github, figma, slack, notion, linear, gmail or drive. For anything else, use icon.
Can I replay a finished run?
Yes. Pass the full steps list and move time from 0 to the end of the run. The demo plays it back at 1.6 times real speed, and holds while a mouse rests on it.
07

More in Agent status

Show what the agent is doing, how far along it is, and what it is working with.

ThinkingThe live trace, written as the agent works, then folded away.
Reasoning trailThe agent's plan, notes, sources and edits, after it thinks.
Parallel agentsSeveral agents working in parallel, each with its own lane and hand-offs.
Delegation treeAn orchestrator and its sub-agents, with cost rolled up per branch.
Approval queueEvery run that needs you, is running or is done, in one list.
Trace viewOne agent run as a waterfall of spans, with latency and tokens.
Web searchThe agent's searches as a trail: what it asked, what came back, what it read or skipped, and the answer with its sources.
Context meterHow full the context is and what fills it, with Compact to free room.
All 15 in Agent status →