ConversationTimeline

Molecule

A vertical timeline of an AI investigation: model calls, tool calls, the evidence read, and whether each citation was kept or dropped, with tokens, cost and time per step and a total. Every step names its type in text; arguments and raw results collapse behind a button with `aria-expanded` and `aria-controls`. Same locals, DOM and classes as kui-react. The server draws the list and `ConversationTimeline/scripts/conversation-timeline.js` (inlined once, idempotent) toggles the panels. React's `onExpandedChange` is the bubbling `kui:conversation-expanded-change` event on the root; `expandedIds` (controlled in React) is the state at render time and makes the browser script only emit the event. `messages` overrides every text, `types` key by key.

With totals

Preview
Steps
7
Tokens
3.5k in · 950 out
800 cached
Cost
$0.0143
Time
9.72 s
1 failed
Citations
1 kept
1 dropped
  1. Model call

    Plan the investigation

    model-a

    1.2k in · 340 out · $0.0042 · 1.8 s

  2. Tool call

    search_logs

    service=payments level=error since 07:55

    420 ms

  3. Tool call

    get_trace

    (failed)

    timeout after 5 s

    5 s

  4. Evidence

    payments: gateway timeout burst

    Evidence [1]

  5. Model call

    Write the answer

    model-a

    2.3k in · 610 out · $0.0101 · 2.5 s

  6. Citation kept

    Errors began after payments 4.12.0

  7. Citation dropped

    The database was the bottleneck

Code
<%- include('modules/ui/ConversationTimeline', { steps: steps, currency: 'USD' }) %>

Details open, totals hidden

Preview
  1. Model call

    Plan the investigation

    model-a

    1.2k in · 340 out · $0.0042 · 1.8 s

  2. Tool call

    search_logs

    service=payments level=error since 07:55

    420 ms

    Input

    {"service":"payments","level":"error"}

    Output

    412 rows, first at 08:02:11
  3. Tool call

    get_trace

    (failed)

    timeout after 5 s

    5 s

  4. Evidence

    payments: gateway timeout burst

    Evidence [1]

  5. Model call

    Write the answer

    model-a

    2.3k in · 610 out · $0.0101 · 2.5 s

  6. Citation kept

    Errors began after payments 4.12.0

  7. Citation dropped

    The database was the bottleneck

    Reason: cited evidence 7, which does not exist

Code
<%- include('modules/ui/ConversationTimeline', { steps: steps, defaultExpandedIds: ['2'], hideTotals: true }) %>
<script>
  document.addEventListener('kui:conversation-expanded-change', (e) => save(e.detail.ids));
</script>

Running step, empty state

Preview
Steps
2
Tokens
1.2k in · 340 out
800 cached
Cost
$0.0042
Time
1.8 s
  1. Model call

    Plan the investigation

    model-a

    1.2k in · 340 out · $0.0042 · 1.8 s

  2. Tool call

    query_metrics

    (running)

Nothing has happened yet.

Code
<%- include('modules/ui/ConversationTimeline', { steps: [{ id: 'r', type: 'tool', title: 'query_metrics', status: 'running' }] }) %>
<%- include('modules/ui/ConversationTimeline', { steps: [], messages: { empty: 'Nothing yet.' } }) %>
Source modules/ui/ConversationTimeline.ejs