8000 Touch pan: momentum/inertia after a flick · Issue #248 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content

Touch pan: momentum/inertia after a flick #248

Closed

Description

@Mattheinrichs

What are you trying to do?

Pan a long agent transcript (opencode) on a touchscreen. The view stops dead the moment the finger lifts, so covering a long session means repeated swipes, and it doesn't match the glide a touchpad or browser gives you. Everything else about the recognizer feels right on a ThinkPad Z16 Gen 2: 8px slop, axis lock, second-finger reject, and with #245 fixed the wheel is a consistent 3 rows per detent.

What would you like wmux to do?

After pointerup on a committed vertical pan, keep scrolling with the release velocity and decay to zero, through the same synthetic-wheel path. Cancel on a new pointerdown or any rejected gesture; vertical only. Decay/velocity cap as constants would be fine; a setting is optional.

What do you do 8000 today instead?

Repeated swipes; the wheel for long distances.

Worth noting the web terminal handler deliberately skipped momentum (its comment cites xterm.js#594), so this would be the first implementation. You said in #243 you'd hand-roll it if wanted; happy to test and tune builds on the device.

Activity

  1. amirlehmam commented on Sep 29, 2026

    @amirlehmam
    Owner

    Shipped in v2.14.0. A committed vertical pan that ends in a flick now glides and decays through the same synthetic-wheel path. Velocity is a least-squares fit over the last ~100 ms, with a pause of 80 ms or more before lift giving no fling. Min is 0.25 px/ms, cap 4 px/ms, and the time constant is 325 ms, frame-rate independent. A new pointerdown, a real wheel, hiding the pane or unmount all cancel it. All constants are in src/renderer/utils/touch-fling.ts. I couldn't feel it without a touchscreen, so your Z16 is the real test: tell me what to tune.

  2. Mattheinrichs commented on Oct 2, 2026

    @Mattheinrichs
    ContributorAuthor

    Fling feedback after real use on a ThinkPad Z16 Gen 2 (Windows 11, v2.17.1):

    Feels great. Flicks glide and decay like a phone, the pause-before-lift rule works (a placement drag never flings), hard flicks stop in the right place, and a new touch or a wheel cancels instantly. No tuning request on the fling itself.

    One adjacent thing, filed separately as #267: while dragging, pan speed tracks the app's rows-per-report multiplier, so at opencode's default scroll_speed 3 the content outruns the finger. That's the mirror of #245 and distinct from the fling, which I'd like to keep at its current distance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0