Skip to content

fix(mobile): coalesce keyboard viewport settling - #194

Draft
Lint111 wants to merge 1 commit into
Ark0N:masterfrom
Lint111:agent/split-keyboard-viewport-settle
Draft

fix(mobile): coalesce keyboard viewport settling#194
Lint111 wants to merge 1 commit into
Ark0N:masterfrom
Lint111:agent/split-keyboard-viewport-settle

Conversation

@Lint111

@Lint111 Lint111 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Coalesce the burst of mobile visualViewport resize events into one final xterm layout and PTY resize after the software-keyboard animation settles.

Root cause

Keyboard open and close used separate fixed 150 ms and 100 ms timers. Mobile browsers report several intermediate viewport heights during the OS animation, so those timers could fit xterm against a transient height and expose another layout/redraw before the final size arrived.

What changed

  • reset one 80 ms settle timer on every viewport resize
  • preserve the open/close request to return the terminal to the bottom across reschedules
  • run the existing fit, padding correction, helper synchronization, and resize transport only after the viewport becomes quiet
  • cancel pending settlement during handler cleanup

Commit structure

  1. fix(mobile): coalesce keyboard viewport settling

Validation

  • focused browser regression: 1 passed
  • full test/mobile/keyboard.test.ts: 28 passed, 4 existing unrelated failures
  • npm run typecheck
  • npm run lint
  • npm run check:frontend-syntax
  • npm run check:public-assets
  • npm run build
  • Prettier and git diff --check

The four existing failures are the stale toolbar-transform expectation, outdated accessory action list, and two local-input assertions. The new coalescing regression passes in that same run.

Scope

This PR does not change resize arbitration, mobile terminal controls, input handling, session replay, or authoritative frame capture.

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