Skip to content

Fix review TUI wrapping#1158

Merged
peyton-alt merged 1 commit intomainfrom
fix-review
May 8, 2026
Merged

Fix review TUI wrapping#1158
peyton-alt merged 1 commit intomainfrom
fix-review

Conversation

@peyton-alt
Copy link
Copy Markdown
Contributor

@peyton-alt peyton-alt commented May 8, 2026

https://entire.io/gh/entireio/cli/trails/332

Summary

Fixes entire review dashboard rendering corruption when multiple agents are running in narrow terminals.

The dashboard could emit table rows wider than the terminal. Bubble Tea then hard-wrapped those redraw frames, leaving stale header and row fragments on screen. This PR makes dashboard and detail rendering width-aware and sanitizes agent text before it reaches table cells.

Changes

  • Clamp every dashboard line to the current terminal display width.
  • Allocate preview width from the remaining table width instead of using a fixed rune count.
  • Add shared display text helpers for ANSI stripping, control-character removal, display-cell padding, and display-cell truncation.
  • Apply the same display-width handling to detail view header/body/footer rendering.
  • Pin TUI sink ordering so live TUI rendering remains isolated from post-run writers.
  • Add regression coverage for very narrow terminals, resized terminals, wide characters, emoji, ANSI cursor sequences, finished dashboards, and sink ordering.

Validation

  • mise run test:ci
  • mise run lint

Note

Medium Risk
Moderate risk because it changes how TUI text is sanitized and width-truncated/padded (including emoji/wide chars), which could alter on-screen output and edge-case formatting but is isolated to review UI rendering and sink ordering.

Overview
Fixes entire review TUI rendering in narrow/resized terminals by making both the dashboard and detail views display-width aware (cell-based truncation/padding) and by sanitizing agent text to strip ANSI/control sequences before rendering.

The dashboard now derives preview column width from the current terminal width, clamps every rendered line to that width, and adds regression tests covering very small widths, window resizes, wide characters/emoji, and control-sequence leakage. It also adds a test to pin sink ordering so the TUISink runs before post-run writers like DumpSink/SynthesisSink.

Reviewed by Cursor Bugbot for commit 9044dc5. Configure here.

Copilot AI review requested due to automatic review settings May 8, 2026 14:39
@peyton-alt peyton-alt changed the title [codex] Fix review TUI wrapping Fix review TUI wrapping May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves entire review’s Bubble Tea TUI rendering in narrow/resized terminals by making dashboard/detail output display-width aware and sanitizing agent-emitted text to prevent hard-wrapping corruption and control-sequence leakage.

Changes:

  • Added shared helpers to strip ANSI, remove control characters, and pad/truncate by display-cell width.
  • Updated dashboard and detail rendering to clamp lines to terminal width and allocate preview width from remaining table space.
  • Added regression tests for narrow terminals, resizing, wide characters/emoji, ANSI control sequences, finished dashboards, and sink ordering.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/entire/cli/review/tui_text.go Introduces shared ANSI stripping + display-width pad/truncate + control-char sanitization helpers.
cmd/entire/cli/review/tui_model.go Makes dashboard rendering width-aware, clamps lines, and sanitizes/truncates preview text by display width.
cmd/entire/cli/review/tui_model_test.go Adds dashboard width/regression tests (narrow widths, resize, control-sequence stripping).
cmd/entire/cli/review/tui_detail.go Switches detail view rendering to display-width truncation/padding and shared sanitization.
cmd/entire/cli/review/tui_detail_test.go Adds detail-view width regression tests including wide characters/emoji and ANSI stripping.
cmd/entire/cli/review/cmd_test.go Adds tests pinning sink ordering so the TUI sink precedes post-run writers.

Comment thread cmd/entire/cli/review/tui_detail.go
Comment thread cmd/entire/cli/review/tui_model.go
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9044dc5. Configure here.

Comment thread cmd/entire/cli/review/tui_model_test.go Outdated
Comment thread cmd/entire/cli/review/tui_detail.go Outdated
Entire-Checkpoint: bf2e18977a22
@peyton-alt peyton-alt marked this pull request as ready for review May 8, 2026 15:07
@peyton-alt peyton-alt requested a review from a team as a code owner May 8, 2026 15:07
@peyton-alt peyton-alt merged commit 62bc6d6 into main May 8, 2026
9 checks passed
@peyton-alt peyton-alt deleted the fix-review branch May 8, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants