Skip to content

fix(site): scroll-spy highlights the last guide section at page bottom#207

Merged
Exoridus merged 1 commit into
feat/v0.15from
fix/site-scroll-spy
Jun 27, 2026
Merged

fix(site): scroll-spy highlights the last guide section at page bottom#207
Exoridus merged 1 commit into
feat/v0.15from
fix/site-scroll-spy

Conversation

@Exoridus

Copy link
Copy Markdown
Owner

The "On this page" rail used an IntersectionObserver with a narrow -20% 0px -65% 0px band — a heading only went active while inside the top 20–35% of the viewport. Headings near the page bottom never scroll high enough to enter that band, so the final section(s) never activated; at the very bottom the rail stayed stuck (often on the first heading).

Replaced with a scroll-position computation: active = the last heading whose top has crossed a line ~28% down the viewport, and the last heading is forced once scrolled to the page bottom. rAF-throttled scroll/resize.

Verified via Playwright at top / middle / bottom — correct heading active in each, exactly one active at a time. (Repro before fix: at bottom active was "Scene-scoped bindings" instead of "Where to go next".)

The "On this page" rail used an IntersectionObserver with a narrow
`-20% 0px -65% 0px` band: a heading only went active while inside the top
20–35% of the viewport. Headings near the page bottom never scroll high enough
to enter that band, so the final section(s) never activated — at the very bottom
the rail stayed stuck on whichever heading was last in the band (often the first).

Replace it with a scroll-position computation: the active heading is the last one
whose top has crossed a line ~28% down the viewport, and the last heading is
forced once scrolled to the page bottom. rAF-throttled scroll/resize listeners.

Verified via Playwright at top / middle / bottom — correct heading active in each,
exactly one active at a time.
@Exoridus Exoridus merged commit a40b88c into feat/v0.15 Jun 27, 2026
@Exoridus Exoridus deleted the fix/site-scroll-spy branch June 27, 2026 16:53
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