feat(hub): restore dock open/selection/route across reloads via a session store - #246
Merged
Conversation
…on store Introduce a per-tab `DockSessionStorage` (open, selectedId, route) distinct from the browser-shared `DockPanelStorage` geometry. `open` moves out of the panel store into this session store, joined by the selected dock id and the selected iframe dock's live address-bar route. The embedded and standalone bootstraps persist it to `sessionStorage`, and the docks context re-applies the persisted selection once the RPC handshake makes the client trusted — surviving the pre-handshake untrusted window that force-closes the panel. A restored iframe boots deep-linked to its saved route via a one-shot `consumeBootRoute`. Created with the help of an agent.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Addresses point 2 of #229 — a reload discards the dock panel's UI state, so a workflow that is reload-driven by necessity re-navigates the panel every time.
What
Introduces a new per-tab
DockSessionStorage— distinct from the browser-sharedDockPanelStoragegeometry — holding:open(moved out ofDockPanelStorage)selectedId(the currently selected dock)route(the selected iframe dock's live address-bar URL)The embedded and standalone bootstraps persist it to
sessionStorage(per-tab: two tabs against the same dev server keep their own selection). The docks context re-applies the persisted intent after the RPC auth handshake makes the client trusted, surviving the pre-handshake untrusted window in whichDock.vueforce-closes the panel (the root cause called out in the issue). A restored iframe dock boots deep-linked to its saved route via a one-shotconsumeBootRoute.Design decisions (confirmed with the requester)
sessionStorage, per-tab — selection is per-tab navigation state, not a browser-shared preference.openfully removed fromDockPanelStorage— single source of truth; the headless@devframes/hubclient host now exposespanel.sessiontoo.route= the iframe's current URL, restored as the bootsrc; non-iframe docks store no route.Notes
openfrom the publicDockPanelStoragetype is a breaking API change (the tsnapi snapshot is updated accordingly).This PR was created with the help of an agent.