Skip to content

A reload keeps the place it was on - #11

Merged
nicolasdb merged 1 commit into
devfrom
claude/reload-keeps-place
Oct 24, 2026
Merged

nicolasdb merged 1 commit into
devfrom
claude/reload-keeps-place

Conversation

@nicolasdb

Copy link
Copy Markdown
Owner

Reloading on #/p/dashboard/now.md sent you back to the pod root.

Why: with restorePreviousSession, a reload re-activates the session by a silent round trip through the provider (prompt=none). The provider sends the browser back to the redirect URL, which has no fragment, since OIDC refuses one. So the hash route was lost. The Inrupt library saves location.href before the round trip and emits sessionRestore with it, but nothing was listening.

Change: completeLogin listens for EVENTS.SESSION_RESTORED and calls history.replaceState back to that address before the first render. restoredAddress accepts same-origin addresses only, because the value comes from localStorage. It has tests.

No new button: a reload now does what you expected.

Manual test (test.nicolasdb.eu): open a file in Places, reload, and you should stay on that file. Also check the first sign-in still lands on #/.

🤖 Generated with Claude Code

A reload re-activates the session through the provider, which sends the
browser back to the redirect URL without its fragment, so every reload
landed on the home screen (#/). The library hands the old address back
with the sessionRestore event; completeLogin now puts it back, same
origin only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicolasdb
nicolasdb merged commit 2a1fcbf into dev Oct 24, 2026
6 checks passed
@nicolasdb
nicolasdb deleted the claude/reload-keeps-place branch October 24, 2026 12:32
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