You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the Workbench surface, switch to the target Workbench:
/sql?ws=a -> /sql?ws=b
Update the last-used workspace only after the target resolves successfully.
For a modest list, use the normal menu. If the list exceeds a reasonable threshold (approximately 8-10), provide search/filter rather than an unbounded menu.
Keyboard navigation, focus restoration, Escape, and outside-click behavior must match existing menu accessibility.
Dirty-draft switching policy
Editor tabs are runtime session state and must not leak across workspaces.
When switching away from a workspace:
No dirty/unsaved tabs
Switch immediately.
Dirty or unsaved tabs exist
Show a confirmation dialog with exactly these outcomes:
Stay: cancel navigation and preserve all state.
Discard and switch: discard the current workspace's runtime tab drafts and navigate in the same tab.
Open target workspace in new tab: leave the current tab untouched and open the selected workspace URL in a new browser tab.
Do not silently carry tabs or savedId bindings into the target workspace.
The dialog should summarize the number of affected tabs. It need not provide per-tab save controls in the first version.
New workspace flow
The selector and File menu may both invoke the same command, but there must be one implementation.
Require typing the immutable workspace key to enable deletion. This is justified because deletion is unrecoverable.
Post-delete behavior:
Deleting a non-active workspace
Close/return to management list.
Active workspace and URL are unchanged.
Deleting the active workspace
If other workspaces exist, choose the deterministic first workspace sorted by display name/key and navigate with history.replaceState() so Back does not reopen the deleted workspace.
If no workspace remains, create a default workspace and replace the URL with its key.
Clear/update last-used preference.
Other browser tabs
A tab later observing that its addressed workspace was deleted must show Workspace not found. It must not silently substitute another workspace.
If dirty drafts exist in the active workspace being deleted, the delete confirmation itself is sufficient warning; deletion discards them after the typed-key confirmation.
Import/export semantics
Import workspace…
Read and validate a portable workspace bundle.
Create a new local workspace; never replace the active workspace.
Remint local workspace identity.
Prompt for/derive a unique key when the imported name/key conflicts.
After successful import, navigate to the imported workspace.
Apply dirty-draft switching confirmation before leaving the current workspace.
Export workspace…
Export the selected/current workspace as the existing portable bundle format.
From Manage Workspaces, export the row's workspace without switching to it.
Superseded by #452.#452 unified the File menu across every work surface and
settled its contents, ordering, labels, availability rules and trigger behaviour.
The target-menu block and requirements that used to live here are obsolete — #452's ## Target menu and ## Availability rules are now the source of truth,
and src/core/file-menu-model.ts is the one implementation of them.
What #452 already delivered from this section: Open workspace… → Import
workspace… with create-new (not replace-active) semantics; destructive
whole-workspace replacement gone from the primary UX; the same New workspace
command shared with the header; Markdown/SQL downloads preserved (renamed Download Library as Markdown/SQL); dashboard navigation kept out of the File
menu. The "no separate Dashboard file menu" question is also settled — there is
exactly one File menu, and Dashboard import/export are rows in it, enabled only
against an exact active Dashboard.
This issue must not reintroduce a second File menu, a surface-provided File
button, or a per-surface row set. It continues to own the workspace SELECTOR
and the workspace-management dialog only. A selector and the File menu may still
invoke the same command, but there must remain one implementation of each.
Workspace-not-found management
The Workspace not found state from #407 should offer:
open workspace selector;
create new workspace;
navigate to an existing workspace.
It must not create or select a replacement automatically for an explicit missing ws URL.
Accessibility and responsive behavior
Workspace dropdown has an accessible name containing the current workspace name.
Current item uses semantic checked/selected state where supported.
All dialogs trap focus and restore it on close.
Destructive action is visually and semantically distinguished.
Header controls remain usable on narrow screens; labels may collapse but accessible names remain.
Do not implement hover-dependent nested submenus.
Tests
Add unit/UI/integration coverage for at least:
Selector lists multiple workspaces alphabetically and marks current.
Selecting a workspace updates URL and last-used preference.
Dashboard surface and view mode are preserved while switching.
Clean workspace switch happens immediately.
Dirty switch supports Stay, Discard and switch, and Open in new tab.
Runtime tabs and saved bindings do not carry into another workspace.
New workspace validates name/key, creates, and navigates.
Rename changes name only and preserves URL key.
Manage dialog summaries show correct query/dashboard counts.
Delete non-active workspace leaves current workspace unchanged.
Delete active workspace replaces URL with deterministic fallback.
Delete last workspace creates a default workspace.
Typed-key confirmation gates permanent deletion.
Import workspace creates a new workspace instead of replacing active.
Import key conflicts are resolved explicitly.
Export from a non-active row does not switch workspace.
Goal
Add the user-facing multi-workspace workflow on top of #406 and #407:
Dependencies
/sql?ws=...&surface=...&mode=...routing.Product decisions
Header structure
Target conceptual layout:
The exact responsive styling should reuse current header/menu primitives.
Workspace selector dropdown
Example:
Requirements:
wsURL parameter.Dirty-draft switching policy
Editor tabs are runtime session state and must not leak across workspaces.
When switching away from a workspace:
No dirty/unsaved tabs
Switch immediately.
Dirty or unsaved tabs exist
Show a confirmation dialog with exactly these outcomes:
Do not silently carry tabs or
savedIdbindings into the target workspace.The dialog should summarize the number of affected tabs. It need not provide per-tab save controls in the first version.
New workspace flow
The selector and File menu may both invoke the same command, but there must be one implementation.
Dialog fields:
Behavior:
/sql?ws=<new-key>in the current tab.Manage Workspaces dialog
Provide a dedicated management surface listing all local workspaces.
Each row shows:
DashboardorNo dashboardstatus;Example:
Requirements:
Rename behavior
Rename changes only the display
name.idorkey.The existing click-to-rename title behavior may be retained or replaced, but there should be one rename command and consistent validation.
Delete behavior
Deletion is permanent; there is no trash.
Confirmation dialog:
Require typing the immutable workspace key to enable deletion. This is justified because deletion is unrecoverable.
Post-delete behavior:
Deleting a non-active workspace
Deleting the active workspace
history.replaceState()so Back does not reopen the deleted workspace.Other browser tabs
A tab later observing that its addressed workspace was deleted must show Workspace not found. It must not silently substitute another workspace.
If dirty drafts exist in the active workspace being deleted, the delete confirmation itself is sufficient warning; deletion discards them after the typed-key confirmation.
Import/export semantics
Import workspace…
Export workspace…
Import queries…
File menu rework
Workspace-not-found management
The Workspace not found state from #407 should offer:
It must not create or select a replacement automatically for an explicit missing
wsURL.Accessibility and responsive behavior
Tests
Add unit/UI/integration coverage for at least:
File menu contains the settled operation names/order and preserves downloads/history.— delivered by Unify File menu across Query and Dashboard surfaces #452.Acceptance criteria
Non-goals