Files
codewhale/crates
Hunter Bown f342d6508e fix(tui): preserve newlines in generic tool result preview (closes #80)
Before, GenericToolCell rendered its `output` through `render_compact_kv`, which
treated the entire string as one logical line and let the wrapper handle
overflow. Multi-line output (git diff --stat, todo snapshots, file lists)
ended up squashed into a single hard-wrapped blob — the screenshot in the
issue showed "Cargo.lock | 1 + crates/cli/Cargo.toml | 1 + crates/cli/src/main.rs"
all on one row.

Switch the result rendering to `render_tool_output_mode` (already used by
ExecCell) which:

- splits on `\n` first, then wraps each line independently;
- caps live view at TOOL_OUTPUT_LINE_LIMIT (= 6) rows with a "+N more lines;
  press v for details" affordance;
- emits the full body in transcript view.

Threaded `RenderMode` through `ToolCell::Generic(...)` dispatch and renamed
`GenericToolCell::lines_with_motion` → `lines_with_mode(mode)` (sole caller).

Tests:
- `generic_tool_cell_preserves_multi_line_output_in_transcript` asserts each
  diff-stat file lands on its own row.
- `generic_tool_cell_caps_multi_line_output_in_live_with_affordance` pins the
  live cap + affordance + transcript-includes-everything contract.

Fixes #80
2026-04-26 13:44:51 -05:00
..