Skip to content

fix(tui): keep a long error inside the status row - #970

Merged
0xallam merged 2 commits into
mainfrom
fix/tui-status-row-overflow
Aug 4, 2026
Merged

fix(tui): keep a long error inside the status row#970
0xallam merged 2 commits into
mainfrom
fix/tui-status-row-overflow

Conversation

@0xallam

@0xallam 0xallam commented Aug 4, 2026

Copy link
Copy Markdown
Member

A red error string filled the screen and pushed the agent tree out of the frame.

Cause

statusView built its row with no width clamp and no newline handling, and two things compounded:

  1. Width. An error wider than the chat column widened the whole column. lipgloss.JoinHorizontal pads every row of a block to its widest row, so a single 273-column status row in a 120-column terminal made the left column 273 wide and pushed the sidebar past the right edge. The agent tree was not overwritten, it was shoved off screen, and the terminal wrapped the frame.
  2. Height. A wrapped exception carries newlines, so the one-line row became four and the frame grew past the bottom.

Measured on a 120x24 terminal with a litellm.APIConnectionError plus traceback:

rows rendered rows wider than the terminal
before 27 27 (every row 273 columns)
after 24 0

Textual clipped this for free: #agent_status_display is height: 1 and #status_text is width: 1fr, so the widget bounded its own content. Nothing bounds it in lipgloss unless it is truncated.

Changes

  • flattenStatus collapses newlines, tabs and whitespace runs to one line.
  • statusMessage flattens, then truncates the message to leave room for its hint, so · Send message to resume stays readable behind a 500-character error instead of being clipped away.
  • statusView clamps whatever left ends up as, so no later branch can widen the frame.
  • setupMsg flattens too. The start screen budgets log rows per entry, so a four-line error rendered as four rows and pushed the launch column off the bottom. It already truncated width but not newlines.

Tests

Three added:

  • the full-frame invariant with a long multi-line error, asserting rows and columns are both bounded and the agent tree is still in the frame
  • flattening and hint preservation, including a message far too long for the row
  • the start-screen log staying at one row per message

All three Go packages pass. Verified visually by rendering the frame: sidebar intact, error on one line ending in , ctrl-q quit still on the right.

🤖 Generated with Claude Code

An error wider than the chat column widened the whole column, because
JoinHorizontal pads every row of a block to its widest row. One 273-column
status row in a 120-column terminal made the left column 273 wide and pushed the
sidebar past the right edge, so the agent tree disappeared and the terminal
wrapped the frame. A wrapped exception carries newlines too, which turned the
one-line row into four and grew the frame past the bottom.

Textual clipped this for free: #agent_status_display is height 1 and #status_text
is width 1fr, so the widget bounded its own content. Nothing bounds it here
unless it is truncated.

Messages are now flattened to a single line and clipped, with the message
yielding before its hint so "Send message to resume" stays readable behind a long
one. statusView clamps whatever it ends up with, so no later branch can widen the
frame. setupMsg flattens as well - the start screen budgets log rows per entry,
so a four-line error rendered as four rows and pushed the launch column off the
bottom.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR confines long, multiline TUI errors to their allocated status or setup-log row and completes the narrow-terminal fix from the previous review.

  • Flattens whitespace and line breaks in status and setup messages.
  • Truncates status content while preserving hints when space permits.
  • Composes status rows at exactly the requested display width, dropping the quit hint on terminals too narrow to accommodate it.
  • Adds full-frame, narrow-terminal, hint-preservation, and setup-log regression coverage.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported quit-hint overflow is fixed: the status composer now drops the hint when it cannot fit, truncates remaining content using display width, and pads every positive-width row to exactly the requested width; no blocking failure remains.

Important Files Changed

Filename Overview
strix/interface/tui/internal/app/view.go Adds ANSI-aware message flattening, truncation, and exact-width status-row composition; the previously reported narrow-width overflow is resolved.
strix/interface/tui/internal/app/model_test.go Adds regression tests for multiline errors, hint preservation, full-frame bounds, and exact status-row widths across terminals from 1 to 60 columns.
strix/interface/tui/internal/app/setup.go Flattens setup feedback before styling and storage so each entry occupies its single budgeted row.
strix/interface/tui/internal/app/setup_log_test.go Verifies that multiline setup errors remain one log entry and do not grow the rendered start screen beyond terminal height.

Reviews (2): Last reviewed commit: "hold the status row to its width in a na..." | Re-trigger Greptile

Comment thread strix/interface/tui/internal/app/view.go Outdated
The clamp reserved room for the quit hint but then added a leading column, a
minimum column of status text and a separator on top of it, so any width of 13 or
less produced a 14-column row - the same overflow, just at a size the first fix
did not reach.

The row is now composed once, to exactly the width it is given. When the terminal
cannot fit the hint beside any status text the hint goes, because the status is
the part carrying information and ctrl-q works whether or not the row has room to
say so.

Reported by Greptile on #970.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@0xallam

0xallam commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

@greptile

@0xallam
0xallam merged commit 82dcd31 into main Aug 4, 2026
2 checks passed
@0xallam
0xallam deleted the fix/tui-status-row-overflow branch August 4, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant