diff options
| author | Adam Soltys <[email protected]> | 2026-10-15 09:10:51 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-15 09:10:51 -0700 |
| commit | 2f1998d67c6878026dbd9666807e8ea24cbbfdd6 (patch) | |
| tree | 6d06c3af046ffc5653049d2fb66eb2667fabbf22 /src/features/messages.js | |
| parent | 6ecc636c4a16b343f07d65c953c678762a1f175a (diff) | |
| download | coinosv3-2f1998d67c6878026dbd9666807e8ea24cbbfdd6.tar.gz coinosv3-2f1998d67c6878026dbd9666807e8ea24cbbfdd6.zip | |
Media pager: a flick flies from an ordinary brisk swipe, and further. A flight took a hard fling (3 px/ms, coasting 500 ms) — Adam, 2026-10-16: "too hard to get it to fly". Now from 1.6 px/ms, coasting 800 ms (so a brisk swipe is two posts, a hard flick five or six), and the finger's speed is its average over its last 80 ms rather than its last five samples — at a phone's 120 Hz those were a third of that, and the finger slowing as it lifts hid the flick. tools/pager-swipe-fly-test.js: the quick flick is three big moves on a schedule from the start (a move's handling in a headless browser takes 30–50 ms, so a paced flick came out a stroll), flying three to six posts; a 320px swipe over 130ms is still one post; pager-tap-slop and profile-pager tests pass.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01J1Kon8bxJoHRpJdSzshCkp
Diffstat (limited to 'src/features/messages.js')
| -rw-r--r-- | src/features/messages.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 4a154c8..7e92374 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -12763,7 +12763,10 @@ export function messagesFeature(ctx) { // fling would have coasted — the speed times FLY_TAU, in screens — from // FLY_V up; a slower swipe is the one post it was. The ends are not // flown past: a fling that would, lands on the last (or first) post. - const FLY_V = 3, FLY_TAU = 500, FLY_MAX = 6; // px/ms; ms; posts + // (3 px/ms and a 500 ms coast took a hard flick to fly at all — Adam, + // 2026-10-16: "too hard to get it to fly".) + const FLY_V = 1.6, FLY_TAU = 800, FLY_MAX = 6; // px/ms; ms; posts + const TRACK_MS = 80; // the speed is the finger's over its last moment, not its last few samples let touch = null, pendingTap = 0, tapDoneAt = 0; el.addEventListener('touchstart', (e) => { const t = e.touches[0]; @@ -12791,7 +12794,7 @@ export function messagesFeature(ctx) { d.far = Math.max(d.far || 0, Math.hypot(dx, dy)); if (d.axis === 'y') d.box.scrollTop = d.start - delta; else d.box.scrollLeft = d.start - delta; d.track.push({ t: performance.now(), v: delta }); // (when handled: synthetic moves can share a timeStamp) - if (d.track.length > 5) d.track.shift(); + while (d.track.length > 2 && d.track[d.track.length - 1].t - d.track[1].t >= TRACK_MS) d.track.shift(); }, { passive: false }); // let go of a drag: on to the next (or the one before), or back function settle(d, step, vel = 0) { |
