Skip to content

[pull] main from freeCodeCamp:main - #276

Merged
pull[bot] merged 12 commits into
homebase-garage:mainfrom
freeCodeCamp:main
Aug 16, 2026
Merged

[pull] main from freeCodeCamp:main#276
pull[bot] merged 12 commits into
homebase-garage:mainfrom
freeCodeCamp:main

Conversation

@pull

@pull pull Bot commented Aug 16, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

simon04 added 12 commits August 15, 2026 12:42
State IDs were assigned with a pre-increment, so the first entry got ID 1
instead of 0. That made isIntialState() never match (canGoBack() was always
true) and left isLastState() off by one (canGoForward() was always true),
so the mobile back/forward buttons were never disabled.

isInitialPopState() also read this.initialPath, which was only ever set as
an instance property, so the static read was always undefined and the guard
never fired. Capture the load-time path in a static field instead.
The app restores scroll positions itself in app.views.Content, keyed by
history state ID. On the mobile layout the scroll element is the document
itself, so the browser's automatic restoration targets the same element and
runs asynchronously around popstate, racing with (and overriding) the
restore scheduled in beforeRoute.

Little is given up by opting out: on full page reloads, where the app has no
cached positions, the content is still being fetched when the browser would
restore, so the offset clamps to 0 anyway.
A single history entry can be dispatched more than once. On the second
dispatch the route context is already the one being navigated to, so
cacheScrollPosition() no longer bailed out and stored the on-screen scroll
position -- the position of the page being entered -- over the position
saved for that state when it was left.

Going back from an in-page anchor was the visible symptom: the cached
position of the anchored view replaced the position the user had scrolled
to, so the restore became a no-op and the content never moved.

Fixes #2445.
@pull pull Bot locked and limited conversation to collaborators Aug 16, 2026
@pull pull Bot added the ⤵️ pull label Aug 16, 2026
@pull
pull Bot merged commit cf5688f into homebase-garage:main Aug 16, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant