next: closing someone's stories returns to their profile, not Home
MergedThis pull updates the vendored HUD to 2d75abe. It adds a closing guard to the pager's close(), and a left guard to the shell's back(), so a repeated close takes only one history step. The diff is small and matches the cause the body describes: close() could run twice inside the 300 ms animation, and each run called history.back(). I read the whole diff. It touches three files and I read all of them. I did not run anything.
One thing to check upstream in HUD, not here: left is never cleared. If navigation.here returns the same object when someone goes back, then forward to that entry, and then back again, that second back would be ignored. The same would happen if an in-stack up() kept the same entry object. I could not confirm either from the diff. enter() builds a new Here object each time, so I expect here changes in the normal cases. It's worth a quick manual check of back, forward, then back.
vendor/hud is meant to come from just vendor-hud, and the COMMIT bump matches that.
Taken: every history entry the shell comes to now clears the remembered one (HUD 18ee0da, vendored in d…), so back, forward, back steps back even if a router hands back the same state object. SvelteKit parses page.state afresh for each entry, so it was not hit in practice. The shell SSR test now goes back, forward to the pager entry, and closes it again. An in-stack up() replaces the entry, so here changes there too.
Since my approval, the vendored HUD moved to 18ee0da. The only change is in Shell.svelte, where the effect that runs when navigation.here changes now resets left. That answers my earlier question: back, forward, back no longer leaves the second back ignored. A repeated close from the same entry is still ignored, because left stays set until here changes. The approval stands. I didn't run anything.
- next: closing someone's stories returns to their profile, not Home
- main
What changes
Closing someone's stories returns to their profile. Tapping a profile's ringed picture opens their stories in the pager. Closing it (✕, Escape, a drag down, or the last story running out) now returns to exactly the screen it was opened over, at the same scroll, one history entry back. The browser's back from the pager does the same, and Back again goes to whatever was under the profile. Before, if a second close arrived before the first had landed, it went back two entries, which for a profile pushed over Home meant Home's feed.
This is vendor/hud at HUD 2d75abe (app/shell).
Why
The cause: the pager's
close()had no guard. Every call animated, then ranonclose→ the shell'sback()→history.back(). Asking twice within the 300 ms the close animates went back twice. Ways that happens:onend→ past the last page →close()) while ✕ is tapped. Slides' timer re-firesonendwhenever its effect re-runs once full.Evidence: in Chromium, signed in through a stand-in HUD, on
/profile/gabrielpm.bsky.social(who has a story), ✕ then Escape on the pager landed on/with 1 level. The new shell SSR test, run against the old shell, fails the same way: "a screen pushed over Home: closed, it is at / with 1 levels, not back at /stories with 2".The fix is in two places, so any repeated close is safe:
closing).back()takes one step per history entry: a second back asked from the same entry before the first lands does nothing.How it was checked
npm run unit(17 pass), the renderer and shell SSR tests, and the docs lint. The shell SSR test adds the pager opened from Home's root, from a screen pushed over Home, and from that screen loaded again (the server's two levels). Each is closed by ✕, ✕ and Escape at once, and by the browser's back. All return to the screen the pager was opened over, one entry back.StoryPagercloses throughShell.closeStories(), which is guarded (stories != nil) and only clears the full-screen cover. It never touches the navigation path, so the pushedLevelScreenstays. No change needed.node check-apps.mjs, svelte-check,node --test src/lib/*.test.tsandnpm run buildinnext/.Shortcomings
onendonce full is left as it is in the renderer. The pager and the shell now ignore the repeats.