Skip to content

Stop typed letters from nudging the rest of the prompt - #11

Merged
Byntham merged 1 commit into
mainfrom
t3/fix-prompt-text-jitter
Nov 5, 2026
Merged

Byntham merged 1 commit into
mainfrom
t3/fix-prompt-text-jitter

Conversation

@Byntham

@Byntham Byntham commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Problem

Typing some letters in the prompt box nudged the rest of the text sideways by a fraction of a pixel. The text should never move while you type.

Each typed letter is its own span, and the untyped rest is one ghost span. Fonts kern letter pairs, but not across span boundaries. Every keystroke moves that boundary, so a kerning pair breaks or forms and the following letters shift.

Fix

The composer textbox sets font-kerning: none and font-variant-ligatures: none. Letter widths no longer depend on where the span boundary is.

Proof

I measured the rect of every character after each keystroke in Playwright Firefox, with correct keys only, five runs per variant:

Keystrokes that moved later letters Largest shift
Before 13 to 36 per prompt (of ~100) 0.85px
After 0 in every run 0px

Headless Chromium on Linux showed no shift before or after, so it can't reproduce the bug. I could not test Safari or a Mac. The shift is too small for a screenshot, so there's no visual.

New check in tests/play.mjs asserts the computed styles. npm run lint, npm run typecheck, and npm test (vitest plus the Playwright run) pass.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

Each typed letter is its own span, so the font cannot kern or ligate across
the boundary between typed text and the ghost text. Every keystroke moved
that boundary and nudged later letters by up to 0.85px in Firefox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Byntham
Byntham merged commit 58d08e4 into main Nov 5, 2026
1 check 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