tui-4-log-adds-3

TUI 4:Log adds 3 view modes: events / high-level / raw-with-pretty-printing

Metadata

Statusdone
Assignedagent-697
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-27T15:05:28.132338262+00:00
Started2026-04-27T15:06:44.886972741+00:00
Completed2026-04-27T15:42:00.372744689+00:00
Tagseval-scheduled
Tokens5870047 in / 8263 out

Description

Description

User feature request: clicking 4:Log should let the user cycle through THREE view modes (not just one):

  1. Events (current) — structured event log (tool calls, results, errors) parsed from claude stream-json
  2. High-level — summarized overview view (high-z view) — what the agent is doing at a coarse level. E.g. 'Editing src/cli.rs', 'Running tests', 'Reading config' — collapsed from the events
  3. RAW (pretty-printed) — show EVERYTHING the agent is seeing AND emitting, but pretty-printed (NOT raw JSON dump). Like a nicely formatted transcript of:
    • User messages going IN
    • Tool calls AND their results (formatted nicely, NOT as JSON blobs)
    • Model thinking blocks (when present)
    • Final assistant text
    • All in chronological order with clear visual separation

User quote: 'we could make it a third option when you click on 4:Log... one is logged events from agent. one is current high level. one is RAW. but raw with pretty printing! not garbage json raw'

Why each mode matters

  • Events — operational view: what tools fired, what errors occurred. Quick scan.
  • High-level — at-a-glance view: 'is the agent making progress? on what?'. Useful for monitoring multiple agents.
  • RAW pretty — debug view: see EVERYTHING the agent saw and did. Crucial when investigating why something went wrong, or learning how the agent reasons.

UX

Cycle modes with a single key (e.g. v or shift+tab) while in the Log pane. Show current mode in the pane header: 4:Log [events ▼] / 4:Log [high-level ▼] / 4:Log [raw ▼]. Persist last-used mode per chat.

Pretty-printing the RAW mode

Each event type gets its own renderer:

  • User input: [user] <message> with timestamp
  • Tool call: ⌁ Bash → "echo hi" with the command pretty-formatted (multiline if needed, syntax-highlighted if feasible)
  • Tool result: ✓ <truncated-or-full result> indented under the call
  • Thinking: <thinking>...</thinking> collapsed by default, expandable
  • Assistant text: [assistant] <pretty-rendered markdown> with proper formatting

Use the same source data (raw_stream.jsonl) — just different renderers per mode.

Files likely to touch

  • src/tui/viz_viewer/state.rs — view-mode state machine, key handler for cycling
  • src/tui/viz_viewer/render.rs — three rendering functions per mode
  • New: src/tui/viz_viewer/log_render.rs (or similar) — split out the rendering logic per mode
  • Mode persistence — possibly in chat metadata.json

Out of scope

  • Live filtering / searching within the log (separate enhancement)
  • Exporting the pretty raw to a file (separate command, useful but not required)

Validation

  • Failing tests first: test_log_view_cycles_through_three_modes, test_raw_mode_renders_user_messages_pretty, test_raw_mode_renders_tool_calls_pretty_not_json, test_high_level_mode_summarizes_events
  • Implementation makes tests pass
  • cargo build + cargo test pass with no regressions
  • HARD GATE manual smoke: open wg tui, hit '4', press the cycle key — see events view; press again — see high-level summaries; press again — see fully pretty-printed transcript with NO json blobs visible

Depends on

Required by

Log