Repository navigation
fix(web): word-wrap frame to terminal width (mobile text reflow) - #6
Merged
Merged
Conversation
The UI is composed at a fixed layout, so on a narrow terminal (a phone) long lines — questions, hints, the live transcript — overflowed the column count and collided with the cursor-home overwrite render, garbling the text. Add an SGR-aware word wrap (wrap.ts) applied to the whole frame in renderView: every physical row is kept ≤ cols, so text reflows cleanly and the overwrite stays aligned. Escapes don't count toward width and the active color is re-opened on each wrapped row (the line's closing reset no longer strips colour off the last word); trailing spaces are trimmed. Desktop is wide → lines already fit → the fast path returns them unchanged. Also drop the now-redundant key-hint lines on touch (the pills carry those actions) so mobile isn't cluttered. tsc clean; 232 vitest pass (new wrap.test.ts: width, reflow, colour-carry, blank lines); canary 2/2; build ok. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The UI is composed at a fixed layout, so on a narrow phone terminal long lines (questions, hints, the live transcript) overflowed the columns and collided with the cursor-home overwrite render → garbled text ("no-wrap" look).
Fix
An SGR-aware word wrap (
wrap.ts) applied to the whole frame inrenderView, so every physical row is ≤colsand text reflows cleanly:Also drops the redundant key-hint lines on touch (the pills carry those actions).
tsc clean · 232 vitest (new
wrap.test.ts) · canary 2/2 · build ok. On-device pass after deploy.🤖 Generated with Claude Code