Skip to content

Nexus: wrap rows on narrow windows instead of cutting them - #37

Merged
Darknode-Official merged 1 commit into
mainfrom
fix/narrow-wrap
Nov 26, 2026
Merged

Darknode-Official merged 1 commit into
mainfrom
fix/narrow-wrap

Conversation

@Darknode-Official

Copy link
Copy Markdown
Owner

On a narrow window (for example a monitor turned vertical) several TUI rows ran past the right edge and were cut off: tool labels, the "Updated " line, diff-card code lines, the live status line, the rotating tip and the footer status.

Changes

  • One wrap pass per message (fitRows in bodyLines): any row wider than the window wraps, with continuation rows hanging under the row's text (after the indent, the connector, a status/spinner glyph or the diff gutter). It runs once per message before the per-message cache stores the rows, so the busy-frame hot path is unchanged.
  • Diff cards: long code lines wrap under the line-number gutter and keep the red/green background.
  • Git diff view: no longer clips its rows.
  • Live status line and tip: wrap instead of being cut.
  • Footer: when the hint and the status do not fit side by side, the hint gets its own row and the status parts are packed onto up to 3 right-aligned rows (the ··· toggle stays on the last). Those rows come out of the transcript area. Windows under 20 rows keep the old single row.
  • Collapsed output: a line cut by the 2-row collapsed view now ends with "…" (ctrl+o still shows it all).
  • Command approval: the question showed only the first 80 characters of the command, so a long command could be approved unseen. It now shows the whole command (up to 2000 characters; the card already wraps).

Verified

  • npm test (temp HOME): all suites pass; 4 new regression checks in test/visual-audit.test.js, and the F18 tip check updated from "ends with an ellipsis" to "wraps".
  • Live TUI in tmux against a scripted fake Ollama (read, edit with long lines in a long path, a long command, a final answer):
    • 48x60: tool labels, the Updated line, diff rows, status, tip, output and the final answer all wrap; the footer uses 3 rows; the approval card shows the full command.
    • 120x40: unchanged layout, footer on one row; only a code line longer than the card wraps.
    • 48x16: footer stays on one row so the transcript keeps its space.

…edge

On a narrow window (a monitor turned vertical) several rows ran past the
right edge and were cut: tool labels, the "Updated <file>" line, diff-card
code lines, the live status line, the rotating tip and the footer status.

- every message's rows are fitted to the window once, before they are
  cached: a row wider than the window wraps, with continuation rows hanging
  under its text (past the indent, connector, glyph or diff gutter)
- diff-card code lines wrap under the line-number gutter and keep their
  red/green background
- the git diff view no longer clips its rows
- the live status line and the tip wrap instead of being cut
- the footer splits onto up to 4 rows when the hint and the status do not
  fit side by side (windows 20+ rows tall; shorter ones keep one row)
- a collapsed output line that is cut says so with a trailing ellipsis
- the command approval card shows the whole command (it was cut at 80
  characters, so a long command could be approved without being seen)
@Darknode-Official
Darknode-Official merged commit cb09a23 into main Nov 26, 2026
6 checks passed
@Darknode-Official
Darknode-Official deleted the fix/narrow-wrap branch November 26, 2026 11:32
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