Skip to content

feat(v0.11): Reasoning Trace Display — surface thinking blocks from extended reasoning models #30

@vivekchand

Description

@vivekchand

Problem

Reasoning/thinking blocks from Claude are already parsed and rendered, but the UX is poor: thinking blocks are expanded inline with no visual separation from tool calls, there's no token count, and there's no way to collapse them.

What's Already There

  • api_transcript_events() (~line 10719) extracts type: 'thinking' blocks from JSONL transcripts (lines ~10762-10763)
  • The transcript modal renders thinking events with CSS class .evt-item.type-thinking (line 2072) — left border #6b7280, icon 💭
  • api_transcript_events() truncates thinking text to 2000 chars per block (line 10763)
  • Sessions list shows a 🧠 badge when thinking: true is set on a call (~line 7012)
  • thinking_calls counter is tracked and surfaced in session stats (~line 13051)

What's Missing

  1. Collapsed by default — thinking blocks should render collapsed (summary line only) with a toggle to expand; right now they render fully expanded inline
  2. Token count — the API returns thinking token usage but it's not shown per-block or in aggregate in the transcript viewer
  3. Visual grouping — when multiple thinking blocks appear in sequence (e.g. extended thinking), they should be grouped rather than listed individually

Where to Change

  • Rendering: viewTranscript() (~line 5072) builds the message HTML — add a collapse/expand toggle for type === 'thinking' events
  • Token display: api_transcript_events() can pass token counts if present in the raw JSONL block; render them as a badge in the transcript viewer
  • CSS: .evt-item.type-thinking at line 2072 — add collapsed state styles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions