Skip to content

docs: correct scroll-snap guidance (native CSS Snap over JS scroll-jacking) - #175

Merged
brunogbv merged 1 commit into
mainfrom
docs/scroll-snap-correction
Jul 4, 2026
Merged

brunogbv merged 1 commit into
mainfrom
docs/scroll-snap-correction

Conversation

@brunogbv

@brunogbv brunogbv commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Context

docs/interaction-gotchas.md (added in #165) steered readers toward driving a full-viewport section
"deck" with JavaScript — intercept wheel/touch, animate scrollTop 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, most visibly a macOS trackpad (one two-finger swipe emits ~40+
inertial, not-reliably-cancelable wheel events with no momentum-phase signal), producing a
sluggish/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

  • Rewrote "Scroll-snap ↔ programmatic scroll" with a headline rule (use native snap; do not
    hand-roll wheel/touch scroll-jacking) and a working native-deck CSS snippet.
  • Clarified that native snap gives one-panel-per-flick for wheel/trackpad/touch by itself
    (mandatory + scroll-snap-stop: always on uniform viewport-height panels); 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 abandon snap.
  • Added the library findings from the discovery (fullPage.js GPLv3 + Mac trackpad bug; Swiper
    MIT but Mac "jumps 2 slides") and why none is warranted here.
  • Converted single-asterisk italics → underscores in this file (markdownlint MD049; the prior lint
    run had skipped the rule on a re2 module load error).

Scope / safety

Documentation only; guidance is screen-only and the PDF/print flow is unaffected. Verified locally:
make lint green (Super-Linter, real exit 0); technical claims + internal/architecture.md
consistency reviewed (all citations from the 003 discovery's primary sources — caniuse, vendor
license pages, upstream issue trackers).

References

…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]>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🔺 Vercel preview: https://cv-qwv8fu759-bruno-valerios-projects.vercel.app

commit 1f712f5 · updated 2026-07-04 15:26 UTC

@brunogbv
brunogbv merged commit 1ee7603 into main Jul 4, 2026
13 checks passed
@brunogbv
brunogbv deleted the docs/scroll-snap-correction branch July 4, 2026 15:27

This branch was successfully deployed

1 active deployment
preview-pr-175 — 1f712f59 Deployed Jul 4, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant