From 72edbadc375df36bdb910090935ce71baa5f7a9e Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 3 Sep 2026 23:12:15 -0700 Subject: Critical fix: the commit-threshold change I just shipped threw on every drag release. My new travel-fraction variable was also named 'moved', colliding with the drag-started flag of the same name in the enclosing scope — a temporal-dead-zone ReferenceError that threw up() before it could commit or even snap back, so a release did nothing. Renamed to 'travelled'. (This is what made 4f0e444's drags dead.) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- src/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/app.js b/src/app.js index 725cf4c..fa2f966 100644 --- a/src/app.js +++ b/src/app.js @@ -3506,10 +3506,10 @@ function balanceCard() { const pitch = kids[1] ? (kids[1].offsetLeft - kids[0].offsetLeft) : el.clientWidth || 1; const fromCenter = kids[fromIdx].offsetLeft + kids[fromIdx].offsetWidth / 2; const nowCenter = el.scrollLeft + el.clientWidth / 2; - const moved = (nowCenter - fromCenter) / pitch; // + = toward higher index + const travelled = (nowCenter - fromCenter) / pitch; // + = toward higher index let dir = 0; if (Math.abs(vel) > 0.12) dir = vel < 0 ? 1 : -1; // quick flick - else if (Math.abs(moved) > 0.15) dir = moved > 0 ? 1 : -1; // pulled ~a sixth of a card + else if (Math.abs(travelled) > 0.15) dir = travelled > 0 ? 1 : -1; // pulled ~a sixth of a card const best = Math.max(0, Math.min(kids.length - 1, fromIdx + dir)); const k = kids[best]; if (k) el.scrollTo({ left: k.offsetLeft + k.offsetWidth / 2 - el.clientWidth / 2, behavior: 'smooth' }); -- cgit v1.2.3