Repository navigation
docs: correct scroll-snap guidance (native CSS Snap over JS scroll-jacking) - #175
Merged
Merged
Conversation
…acking docs/interaction-gotchas.md previously steered readers toward driving a full-viewport deck with JS (intercept wheel/touch, animate to the next index). The 003 prototype proved that inverts the right answer: a hand-rolled scroll-jacker inescapably fights the platform's own scroll momentum — a macOS trackpad most of all (one swipe = ~40+ inertial, not-reliably-cancelable wheel events with no momentum-phase signal), giving a sluggish/flickering start no tuning removes. Native CSS Scroll Snap fixed it in less code (owner confirmed 'works perfectly'). - Rewrite 'Scroll-snap <-> programmatic scroll' with a headline rule (use native snap; don't hand-roll wheel/touch scroll-jacking) + a working native-deck CSS snippet. - Clarify that native snap gives one-panel-per-flick for wheel/trackpad/touch by itself; JS is needed ONLY for the keyboard (a thin scrollIntoView layer that COEXISTS with mandatory snap — they don't fight). The 'hiccup' is specifically JS-animated scroll vs mandatory snap, an argument to stop animating the scroll yourself, not to drop snap. - Add the library findings from the discovery (fullPage.js GPLv3 + Mac bug; Swiper MIT but Mac 'jumps 2 slides') and why none is warranted here. - Convert single-asterisk italics to underscores repo-wide in this file (markdownlint MD049). Screen-only guidance; the PDF/print flow is unaffected. Verified: Super-Linter clean; claims/consistency reviewed. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
brunogbv
enabled auto-merge (squash)
July 4, 2026 15:26
|
🔺 Vercel preview: https://cv-qwv8fu759-bruno-valerios-projects.vercel.app commit |
This was referenced Jul 4, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
docs/interaction-gotchas.md(added in #165) steered readers toward driving a full-viewport section"deck" with JavaScript — intercept
wheel/touch, animatescrollTopto the next index. The 003prototype proved that inverts the right answer. A hand-rolled scroll-jacker inescapably fights the
platform's own scroll momentum, most visibly a macOS trackpad (one two-finger swipe emits ~40+
inertial, not-reliably-cancelable
wheelevents with no momentum-phase signal), producing asluggish/flickering start that no amount of tuning removes. Switching to native CSS Scroll Snap
fixed it in less code, and the owner confirmed it "works perfectly."
Left as-is, the doc would actively mislead the next interaction-heavy change (incl. the pending 003
re-spec) into rebuilding the scroll-jacker.
What changed
hand-roll wheel/touch scroll-jacking) and a working native-deck CSS snippet.
(
mandatory+scroll-snap-stop: alwayson uniform viewport-height panels); JS is needed onlyfor the keyboard — a thin
scrollIntoViewlayer that coexists with mandatory snap (they don'tfight). The "hiccup" is specifically JS-animated scroll vs mandatory snap: an argument to stop
animating the scroll yourself, not to abandon snap.
MIT but Mac "jumps 2 slides") and why none is warranted here.
run had skipped the rule on a
re2module load error).Scope / safety
Documentation only; guidance is screen-only and the PDF/print flow is unaffected. Verified locally:
make lintgreen (Super-Linter, real exit 0); technical claims + internal/architecture.mdconsistency reviewed (all citations from the 003 discovery's primary sources — caniuse, vendor
license pages, upstream issue trackers).
References
003-proto, PR [PROTOTYPE — do not merge] Reference restyle + section-snap + summary/detail #156) trackpad-feel work.