Metadata
| Status | done |
|---|---|
| Assigned | agent-696 |
| Agent identity | f51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e |
| Created | 2026-04-27T15:05:27.982474953+00:00 |
| Started | 2026-04-27T15:06:20.749557934+00:00 |
| Completed | 2026-04-27T15:32:37.057538563+00:00 |
| Tags | eval-scheduled |
Description
Description
User reports: 'the last response in the log isn't word wrapping? so we seem to be missing a lot of text. really the whole thing isn't word wrapping.'
The Log view (4:Log) renders agent responses but long lines are being truncated/cut off rather than wrapped to fit the pane width. Result: user can't see the full content of any non-trivial response.
Required
Render multi-line responses with proper word-wrapping to the pane width. Standard ratatui pattern: Paragraph::new(text).wrap(Wrap { trim: false }).
Apply to:
- Agent response messages (claude / nex output)
- Tool-result blocks (especially Bash output)
- Any other long-text rendering in the Log pane
Preserve continuation-line alignment (per the related response-first-line-shift task: continuation lines hang under first character of text, not column 0).
Hard gate
Open wg tui in a chat with a long agent response (>120 chars / multi-paragraph). Visually confirm:
- Text wraps to pane width
- No content lost off-screen
- Continuation lines align under first char of original line (not naked left margin)
- Resize the pane → text re-wraps correctly
Files likely to touch
- src/tui/viz_viewer/render.rs (response rendering — find Paragraph builders that lack
.wrap()) - Maybe state.rs if there's pre-formatting that pre-truncates
Validation
- Failing test first: test_log_view_wraps_long_response — synthetic 500-char response in a 80-col pane → all chars present in render output across multiple wrapped lines
- Implementation makes test pass
- cargo build + cargo test pass with no regressions
- HARD GATE manual smoke as above
Depends on
Required by
- (none)
Log
- 2026-04-27T15:05:27.963563853+00:00 Task paused
- 2026-04-27T15:06:02.782778598+00:00 Task published
- 2026-04-27T15:06:19.529357688+00:00 Lightweight assignment: agent=Careful Programmer (f5143935), exec_mode=full, context_scope=task, reason=Careful Programmer role is ideal for UI-critical rendering bug requiring precise implementation, TDD, and manual smoke testing.
- 2026-04-27T15:06:20.749564196+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-27T15:06:44.441345951+00:00 Starting work: investigating Log view word-wrapping issue in src/tui/viz_viewer/render.rs
- 2026-04-27T15:27:23.285015279+00:00 Wrote two tests: test_log_view_wraps_long_response (passes already) + test_log_view_auto_tail_pins_last_visual_line (catches the bug). Bug: scroll math in draw_log_tab used logical-line count, but ratatui Paragraph.wrap() produces visual lines, so auto-tail pushed the response tail off-screen below the viewport.
- 2026-04-27T15:27:32.180644587+00:00 Fix: pre-wrap raw lines via wrap_line_spans(body_width) BEFORE Paragraph::new, so logical-line count == visual-line count and scroll math (auto_tail, scroll_y) uses the same units as drawn output. Removed Paragraph .wrap() to avoid re-wrap mismatch.
- 2026-04-27T15:27:32.317041799+00:00 Validated: cargo build OK; 3 log-view tests pass; 542 viz_viewer tests pass; 4 pre-existing graph_watcher failures unrelated (verified by git-stash of changes, same failures on baseline — Too many open files / inotify limit)
- 2026-04-27T15:32:18.948257741+00:00 Committed: 8a0051ba8 — pushed to remote
- 2026-04-27T15:32:37.057552189+00:00 Task pending eval (agent reported done; awaiting `.evaluate-*` to score)
- 2026-04-27T15:35:22.054581474+00:00 PendingEval → Done (evaluator passed; downstream unblocks)