Skip to content

fix(web): word-wrap frame to terminal width (mobile text reflow) - #6

Merged
momentmaker merged 1 commit into
mainfrom
fix/mobile-text-wrap
Jun 17, 2026
Merged

momentmaker merged 1 commit into
mainfrom
fix/mobile-text-wrap

Conversation

@momentmaker

Copy link
Copy Markdown
Member

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 in renderView, so every physical row is ≤ cols and text reflows cleanly:

  • escapes don't count toward width
  • the active colour is re-opened on each wrapped row (the line's closing reset no longer strips colour off the last word)
  • trailing spaces trimmed
  • desktop unchanged — wide terminal → lines already fit → fast-path returns them as-is

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

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>
@momentmaker
momentmaker merged commit b862861 into main Jun 17, 2026
5 checks passed
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