From 3e6c88dd108f843f1a85cc7dd2565bee1f7caae2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 4 Sep 2026 07:26:29 -0700 Subject: TEMP: scroll trace records only while moving (+700ms tail) so flick motion survives in the buffer regardless of read timing Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- src/app.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/app.js b/src/app.js index 77df9c1..bd8c495 100644 --- a/src/app.js +++ b/src/app.js @@ -3195,6 +3195,7 @@ function dlog(s) { // (a stutter that isn't a dropped frame). try { let _lastFrame = performance.now(); + let _lastSl = -1, _movingUntil = 0; window.__scroll = []; const _fw = (t) => { const gap = t - _lastFrame; _lastFrame = t; @@ -3202,8 +3203,14 @@ try { try { const el = document.querySelector('.bal-carousel'); if (el) { - window.__scroll.push([Math.round(t), Math.round(el.scrollLeft), Math.round(gap)]); - if (window.__scroll.length > 400) window.__scroll.shift(); + const sl = Math.round(el.scrollLeft); + // record only while the scroll is actually moving (or just moved), so + // idle frames don't shift the flick motion out of the buffer + if (sl !== _lastSl) { _lastSl = sl; _movingUntil = t + 700; } + if (t < _movingUntil) { + window.__scroll.push([Math.round(t), sl, Math.round(gap)]); + if (window.__scroll.length > 800) window.__scroll.shift(); + } } } catch {} requestAnimationFrame(_fw); -- cgit v1.2.3