2
0
Fork 0

feat: make the touch scroll faster and more responsive #42

Merged
aleksei merged 1 commit from feat/faster-touch-scroll into main 2026-11-23 15:46:02 +00:00
Owner

Summary

  • A touch drag now reports a wheel event every 12 px of finger travel instead of every 16 px, so the terminal starts moving sooner.
  • The touch delta is scaled by TOUCH_SCROLL_GAIN = 1.3 before it becomes a synthetic wheel event. The gain sits in a small dispatchTouchWheel wrapper, so it applies to the drag and to the momentum tail alike and never to a real wheel event.
  • The same swipe therefore scrolls about a third further than before, while the momentum keeps tracking the finger.
  • Update the README and adr/terminal.md.

Test plan

  • npm run typecheck
  • npm run build
  • Mobile Playwright run against a temp server, with a wheel listener on .xterm-screen and synthetic touch events:
    • 12 px and 30 px of finger travel produced wheel reports of exactly 15.6 and 39 (1.3×), and a 10 px move produced no report but did not lose travel;
    • a timed drag of 160 px produced 8 reports totalling 208 wheel px;
    • releasing the drag added a momentum phase of 25 reports and 326.5 wheel px over 400 ms.
## Summary - A touch drag now reports a wheel event every 12 px of finger travel instead of every 16 px, so the terminal starts moving sooner. - The touch delta is scaled by `TOUCH_SCROLL_GAIN = 1.3` before it becomes a synthetic wheel event. The gain sits in a small `dispatchTouchWheel` wrapper, so it applies to the drag and to the momentum tail alike and never to a real wheel event. - The same swipe therefore scrolls about a third further than before, while the momentum keeps tracking the finger. - Update the README and `adr/terminal.md`. ## Test plan - `npm run typecheck` - `npm run build` - Mobile Playwright run against a temp server, with a wheel listener on `.xterm-screen` and synthetic touch events: - 12 px and 30 px of finger travel produced wheel reports of exactly `15.6` and `39` (1.3×), and a 10 px move produced no report but did not lose travel; - a timed drag of 160 px produced 8 reports totalling `208` wheel px; - releasing the drag added a momentum phase of 25 reports and `326.5` wheel px over 400 ms.
Emit a wheel report every 12px of finger travel and scale the touch delta by 1.3 before it becomes a wheel event. The gain applies to the drag and to the momentum tail, so the same gesture now scrolls about a third further. A real wheel event is unaffected.
aleksei deleted branch feat/faster-touch-scroll 2026-11-23 15:46:02 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zoo/mux-portal!42
No description provided.