Skip to content

feat(hub): restore dock open/selection/route across reloads via a session store - #246

Merged
antfu merged 3 commits into
mainfrom
fluffy-doodles-show
Aug 17, 2026
Merged

feat(hub): restore dock open/selection/route across reloads via a session store#246
antfu merged 3 commits into
mainfrom
fluffy-doodles-show

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

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-shared DockPanelStorage geometry — holding:

  • open (moved out of DockPanelStorage)
  • 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 which Dock.vue force-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-shot consumeBootRoute.

Design decisions (confirmed with the requester)

  • sessionStorage, per-tab — selection is per-tab navigation state, not a browser-shared preference.
  • open fully removed from DockPanelStorage — single source of truth; the headless @devframes/hub client host now exposes panel.session too.
  • route = the iframe's current URL, restored as the boot src; non-iframe docks store no route.
  • Restore after handshake, keep the untrusted-window close-gate — the durable intent is re-applied once trust returns rather than dropping the gate.

Notes

  • Removing open from the public DockPanelStorage type is a breaking API change (the tsnapi snapshot is updated accordingly).
  • Point 1 of the issue (Node-side observability of panel activity) is out of scope for this PR.

This PR was created with the help of an agent.

…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.
@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 338b3b6
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a8297940114340008720f4f
😎 Deploy Preview https://deploy-preview-246--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
antfu merged commit 1b4b9df into main Aug 17, 2026
12 checks passed
@antfu
antfu deleted the fluffy-doodles-show branch August 17, 2026 05:15
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