Repository navigation
fix: restore mobile swipe position when returning from external links - #139
Merged
Merged
Conversation
therealsama
force-pushed
the
fix/restore-swipe-position
branch
4 times, most recently
from
June 8, 2026 18:51
314521a to
73c13b6
Compare
On a full reload (bfcache miss), the swipe index was lost and the story collapsed to index 0. Persist a durable per-tab snapshot (viewer, story id, scrollY, and a lean story list) to sessionStorage, then on mount re-find the story by id at its prior position with its neighbors. - Add swipePosition helper + SwipePosition type (30-min TTL, lean projection omitting text, snapshot taken from the feed front through a small look-ahead so a prepended restore preserves feed order) - Recover the originating viewer (feed/domain/user) on a stateless reload in MobileItemDetailWrapper - Seed the restored list into mergedStories and freeze the restore decision at mount so the list does not collapse on first swipe - Guard the injection fetch so a restored story is never re-fetched
therealsama
force-pushed
the
fix/restore-swipe-position
branch
from
June 8, 2026 19:18
73c13b6 to
55312ee
Compare
therealsama
enabled auto-merge
June 8, 2026 19:19
kplachkov
approved these changes
Jun 8, 2026
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.
On a full reload (bfcache miss), the swipe index was lost and the story
collapsed to index 0. Persist a durable per-tab snapshot (viewer, story
id, scrollY, and a lean story list) to sessionStorage, then on mount
re-find the story by id at its prior position with its neighbors.
projection omitting text, snapshot taken from the feed front through a
small look-ahead so a prepended restore preserves feed order)
reload in MobileItemDetailWrapper
decision at mount so the list does not collapse on first swipe