From b540d3fab2579da40e0bcdb59581f83b0b742947 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 15 Oct 2026 07:07:40 -0700 Subject: Feed wheel: after a reversal the next two notches are plain, then a spin winds up again. The 700 ms spell without wind-up after a turn back (63fc25d) also covered a spin begun inside it, so correcting the direction and spinning on felt slow for most of a second (Adam, 2026-10-16: "it slows down for a while when I don't want it to"; "overall the scrolling still isn't as fast"). The calm is now a count: the reversal's next two notches don't wind the speed up — a couple of correcting notches still travel a couple of notches — and from the third the wind-up is back, so a spin after a reversal goes as far as one from rest. tools/feed-wheel-reverse-test.js (a reversal plus four quick notches goes well past five plain ones, and about as far as five from rest). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01J1Kon8bxJoHRpJdSzshCkp --- src/app.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/app.js b/src/app.js index 5575cc5..dae7b17 100644 --- a/src/app.js +++ b/src/app.js @@ -6654,13 +6654,15 @@ if (INTENT_URI) { }; // ---- the wheel // A turn back against the coast catches the page at once and is a plain - // notch from rest — no flight the other way, since for a moment after a - // reversal (CALM) notches don't wind the speed up, so a couple of - // correcting notches travel a couple of notches. (A spell of quarter-size - // "hunting" notches ramping back up was tried here and felt like a - // stutter and a slow patch — Adam, 2026-10-16.) - const CALM = 700; // ms after a reversal without wind-up - let calmUntil = 0; // (lastDir/lastMoveAt: the tick's, above) + // notch from rest — no flight the other way, since the next couple of + // notches after a reversal (CALM) don't wind the speed up, so a couple of + // correcting notches travel a couple of notches; a spin that keeps going + // winds up again from the third. (A spell of quarter-size "hunting" + // notches ramping back up was tried here and felt like a stutter and a + // slow patch; a 700 ms spell without wind-up after a reversal was tried + // too and a spin begun inside it felt slow — Adam, 2026-10-16.) + const CALM = 2; // notches after a reversal without wind-up + let calmLeft = 0; // (lastDir/lastMoveAt: the tick's, above) let smoothUntil = 0; // a trackpad's events were just seen: hands off window.addEventListener('wheel', (e) => { if (e.ctrlKey || e.shiftKey || e.defaultPrevented) return; @@ -6680,7 +6682,7 @@ if (INTENT_URI) { // to the OLD elapsed time made the first reverse step jump. Give the // notch a small response now, then coast the rest of its travel. stop(); - calmUntil = now + CALM; + calmLeft = CALM; const first = dir * Math.min(16, Math.abs(px * 3 / TAU) * 16); window.scrollBy({ top: first, behavior: 'instant' }); lastDir = dir; lastMoveAt = now; @@ -6690,7 +6692,7 @@ if (INTENT_URI) { // goes, the more each turn adds (up to 2.5x), so keeping the wheel // turning winds the speed up instead of settling at a stroll. From // rest a notch is the same push as ever. - const gain = now < calmUntil ? 1 : 1 + Math.min(1.5, Math.abs(v) / 4); + const gain = calmLeft-- > 0 ? 1 : 1 + Math.min(1.5, Math.abs(v) / 4); coast(v + (px * 3 * gain) / TAU, TAU); } }, { passive: false }); -- cgit v1.2.3