Commit Graph
1 Commits
Author SHA1 Message Date
Kamil KaliszandClaude Opus 5.5 e85bb83353 fix(mobile): pinned field on phones: swipes, focus scroll, viewport pan, iOS lift
Found on a real Android phone (Chrome) and iPhone (Safari) with Send on Enter:

- A swipe that started on the live screen closed the keyboard: the content
  touchstart blurred the focused input before the gesture was known to be a
  tap or a scroll. It now skips the visible #cjkInput
  (_contentTouchStartBlurs()); a real tap still closes it (inert content, a
  link, a long press).
- Focusing the field scrolled the terminal off screen: KeyboardHandler's
  focusin scrollIntoView({ block: 'center' }) centred the fixed field in its
  ancestors. isInputElement() skips #cjkInput like xterm's inputs.
- Android pans the visual viewport to reveal the field (offsetTop 285 in a
  458/744 viewport), leaving only the terminal's last line visible. On phones
  .app now follows visualViewport.offsetTop while the keyboard is up, and the
  fixed bars inside .app are lifted from .app's bottom, so a partial pan does
  not lift them twice. Non-phone branches and resetLayout() clear the shift.
- On iOS the first keyboard open reported innerHeight as the visual height
  (323 vs 640), zeroing the bars' lift; the layout height is now the larger of
  innerHeight and documentElement.clientHeight.

Tests in test/keyboard-handler-pinned-field.test.ts and
test/terminal-touch-tap.test.ts; docs in architecture-invariants and
src/web/CLAUDE.md; changeset sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:45:20 +01:00