From 9698d701647530040069a459418202e2840cc555 Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Tue, 24 Mar 2026 23:47:17 -0400 Subject: [PATCH] =?UTF-8?q?scroll=20buffer=20in=20room=5Fscroll.html=20ape?= =?UTF-8?q?rture=20fine-tuned=20so=20that=20'What=20happens=20next?= =?UTF-8?q?=E2=80=A6=3F'=20can=20always=20be=20reached=20by=20scrolling=20?= =?UTF-8?q?on=20a=20fresh=20page=20reload,=20even=20if=20the=20user=20was?= =?UTF-8?q?=20at=20the=20very=20end=20of=20the=20scroll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_partials/_applet-billboard-scroll.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/templates/apps/billboard/_partials/_applet-billboard-scroll.html b/src/templates/apps/billboard/_partials/_applet-billboard-scroll.html index 830c189..d7787d6 100644 --- a/src/templates/apps/billboard/_partials/_applet-billboard-scroll.html +++ b/src/templates/apps/billboard/_partials/_applet-billboard-scroll.html @@ -11,22 +11,21 @@ // Inline scripts can run before nested flex heights are computed, producing // wrong scrollHeight/clientHeight values (symptom: incorrect marginTop on mobile). requestAnimationFrame(function() { - // Push buffer so its top aligns with the bottom of the aperture when all - // events fit within the viewport (no natural scrolling). var buffer = scroll.querySelector('.scroll-buffer'); if (buffer) { + // Push buffer so its top aligns with the bottom of the aperture when all + // events fit within the viewport (no natural scrolling needed). var eventsHeight = scroll.scrollHeight - buffer.offsetHeight; var gap = scroll.clientHeight - eventsHeight; if (gap > 0) { buffer.style.marginTop = gap + 'px'; } - } - // Only restore if there's a meaningful saved position — avoids a - // no-op scrollTop assignment (0→0) that can fire a spurious scroll - // event and reset the debounce timer in tests / headless browsers. - if ({{ scroll_position }} > 0) { - scroll.scrollTop = Math.max(0, {{ scroll_position }} - scroll.clientHeight); + // Always land with the buffer's top flush against the bottom edge — + // the user must scroll down to reveal "What happens next…?" + // Reading offsetTop here forces a synchronous reflow so the margin + // set above is already reflected in the value. + scroll.scrollTop = Math.max(0, buffer.offsetTop - scroll.clientHeight); } });