Skip to content

Persist shell navigation in sessionStorage when withRouter is off - #813

Merged
govindavashishtha merged 2 commits into
mainfrom
feat/shell-storage-routing-without-router
Sep 21, 2026
Merged

govindavashishtha merged 2 commits into
mainfrom
feat/shell-storage-routing-without-router

Conversation

@govindavashishtha

Copy link
Copy Markdown
Contributor

Summary

  • When withRouter is false, shell places and per-route search params persist in sessionStorage (tfy-aui-shell-location) via a shared ShellRouteSyncCore, without mutating the host URL.
  • Pasted share links (?view=sessions, ?agentId=, …) still win on boot, then are stripped from the real URL so later reloads restore from storage.
  • withRouter=true URL behavior is unchanged; docs and a minor changeset cover the storage-mode semantics.

Test plan

  • pnpm --filter @truefoundry/trueforge-ui test (or at least ShellStorageRouteSync, ShellRouteSync, LibrarySessionShareBoot, ShellModeContext, TrueForgeUI tests)
  • Host with withRouter={false}: navigate settings / library agent tab / sessions / a session, reload — state restores; address bar stays clean
  • Paste a share link (?view=sessions or ?agentId=&sessionId=) into a withRouter={false} host — opens the right overlay, then strips query from the URL
  • Host with withRouter (e.g. frontend): deep links, Back/Forward, and share query behavior still match previous URL routing

Made with Cursor

Hosts that opt out of URL routing keep place and per-route search state across reloads without the package mutating the browser URL; pasted share links still win on boot.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8eb3e8a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@govindavashishtha
govindavashishtha merged commit c37b822 into main Sep 21, 2026
10 checks passed
@govindavashishtha
govindavashishtha deleted the feat/shell-storage-routing-without-router branch September 21, 2026 13:04
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.

2 participants