tui-log-view-4

TUI Log view: hanging-indent continuation (2 leading spaces) + blank-line gaps before tool use and before agent text

Metadata

Statusdone
Assignedagent-820
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-27T17:41:36.380542857+00:00
Started2026-04-27T18:40:57.002795920+00:00
Completed2026-04-27T19:02:24.260902322+00:00
Tagseval-scheduled
Tokens595119 in / 30202 out

Description

Description

Refinement on top of tui-log-view-2 (done) and tui-log-view-3 (done). User feedback after using the fixed Log view:

1. Hanging indent

Continuation lines should align under the content of the first line, not under the checkmark. Concretely:

✓ 1 #!/usr/bin/env bash
  2 # Helpers shared by smoke-gate scenarios.
  3 #

First line: <checkmark><space><content> — content starts at column 3. Continuation lines: <space><space><content> — also at column 3.

Net effect: every line of multi-line content sits at the same column. Only the first line carries the indicator; subsequent lines have 2 leading spaces of pure padding.

User quote: 'what about keeping two spaces at the beginning of the line? so we'd have checkmark space and then two spaces on each line below?'

2. Vertical gaps for legibility

Add a blank line at two specific boundaries:

  • Before a tool use — emphasizes 'the agent has stopped thinking and is about to act'
  • Before agent text — emphasizes 'the agent is starting to speak/write now'

User quote: 'maybe before tool use is the cleanest spot ... and before the agent writes text. makes sense to show they are writing something in the log.'

Do NOT add gaps between consecutive tool-result lines, between consecutive lines of agent text, or between events of the same type. Only at the transition boundaries:

  • prev event was agent-text, next is tool-use → blank line
  • prev event was tool-result, next is agent-text → blank line
  • prev event was agent-text, next is agent-text (continuation, same turn) → NO blank line

Files likely to touch

  • src/tui/viz_viewer/render.rs — Log view paragraph builders, around the spans that prepend / status indicators on the first line. Needs to switch first-line-only prefix to a hanging-indent ratatui.Wrap config OR generate the leading spaces explicitly per line.
  • Same render.rs, the event-stream walker — track previous event type and emit a blank Line between events when boundary is (text↔tool).

Validation

  • Failing test first: render Log view with a 5-line code block prefixed by ✓ → assert lines 2-5 each begin with exactly 2 spaces (hanging indent), line 1 begins with ✓ + space, and content text aligns at column 3 on every line
  • Failing test for gap rule: render an event stream of [agent-text, tool-use, tool-result, agent-text] → assert blank Line emitted between agent-text and tool-use, AND between tool-result and agent-text; NO blank Line between tool-use and its tool-result
  • Failing test that consecutive same-type events do NOT get blank lines between them: [agent-text, agent-text, agent-text] → no blank Lines inserted
  • Implementation makes all tests pass
  • cargo build + cargo test pass with no regressions
  • Manual smoke: open wg tui on a chat with multi-line tool results AND interleaved agent text + tool use; visually verify the indent is uniform across continuation lines, and the blank-line gaps appear at the right transition boundaries (and ONLY there)

Depends on

Required by

Log