Repository navigation
fix(tui): display fixes across chat and secondary screens - #4494
Merged
Merged
Conversation
…code
- A shell command that exited non-zero drew as a passed step ("└ exit 2"
in the success colour): the shell tool reports success when the command
ran. The exit code now decides.
- A long or multi-line question wrapped flush to column 0, so its second
line read as stray output; continuations now hang under the text.
- Inline code kept the builtin style's one-space padding after its box
was removed, doubling the spaces around every path and flag.
- gofmt drift in control/state.go and client/wire_contract_test.go.
Glamour pads each rendered document with a blank row above and below. On top of the transcript's own spacing every gap around an answer became two rows, and the finished answer sat a row lower than its streamed copy.
The mid-turn Enter hint was appended after a composer that already spanned the pane, so that row overran the terminal and JoinVertical padded every row of the frame to match: at any width, the screen wrapped the moment the user typed while the agent worked. The composer now gives the hint its width.
At 69-73 columns the provider panel's model-list hint was cut mid-word ("esc b…"): the compact hint only kicked in below 65 columns, but the full one is 71 wide.
A list taller than the window was cropped to its tail, so the highlighted agent near the top was invisible and Enter switched to a row the user could not see. The rows now scroll around the selection.
The gateway screen ignored the window size. With the 76 models the gateway advertises, the list ran off the bottom, the terminal kept only its tail, and the cursor row, title and top models were not on screen. Narrow terminals also overflowed on the intro text, the 60-cell input and the one-row key list. The screen now wraps to the width, scrolls the model list around the cursor, and breaks the key list between keys.
A URL or path wider than the question panel was wrapped by lipgloss at render time rather than by the panel's own layout, so the panel grew rows the click map never counted and a click could land on a different option or on nothing. Words wider than the panel are now broken in layout.
A resize while the gateway screen, the AI-provider panel or an agent-switch gate was up reached only that screen. Leaving it redrew the chat or readiness gate at the old size, so every line overflowed a window that had shrunk. The current size is now handed back on the way out.
Answers sometimes stopped well short of the window and stranded words on
short rows ("python -" / "m" / "pytest"). Glamour wraps paragraphs with
muesli/reflow's wordwrap, which writes a "-" breakpoint without counting it
toward the line length, so each hyphen made a line one column longer than
its limit; glamour then re-wrapped the overflow. Any paragraph with a flag,
a hyphenated word or a `-m` hit it.
reflow v0.3.0 is the latest release and unmaintained, so the module is
vendored under tui/third_party with the one-line fix and wired in with a
replace directive (tui/third_party/README.md records why and when to drop it).
Upstream project files, not source: they never run from a subdirectory and only add noise to the vendored module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows up #4457. Driving the TUI in a real terminal turned up display bugs across the chat screen and the secondary screens; most were already in
main. The worst: typing while the agent worked wrapped the whole screen at every width. Each fix below has a regression test that fails without it.Chat screen
-mended rows well short of the window and stranded words (python -/m/pytest). The cause is a line-length miscount inmuesli/reflow, the wrapper glamour uses; it has no maintained release, so it's vendored undertui/third_partywith the one-line fix (the README there says when to drop it).python -m pytestexiting 2 drew as a passed step, because the shell tool reports success whenever the command runs.run pytest now).Other screens
Test plan
cd tui && go test ./...python -m pytest -q -x"): rows fill to the width, and no word is stranded alone on a row.⏎hint shows beside the text.failed — exit Nin red./agentswith more agents than fit, and/gatewayin a short window: the highlighted row stays visible.