diff options
| author | Adam Malczewski <[email protected]> | 2026-06-25 11:13:07 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-25 11:13:07 +0900 |
| commit | 84c07718aaa4224953cf7f6cf986e825c8900cd5 (patch) | |
| tree | b96ad51891b3386d06f5d2ddc05066b6eecddd9b /src/features/workspaces/ui/WorkspaceCard.svelte | |
| parent | 239e73463160e65604dbbe25c231bae597985816 (diff) | |
| download | dispatch-web-84c07718aaa4224953cf7f6cf986e825c8900cd5.tar.gz dispatch-web-84c07718aaa4224953cf7f6cf986e825c8900cd5.zip | |
feat(workspaces): open workspace in a new browser tab
The 'Open' button on a workspace card did client-side navigation
(onNavigate -> pushState), opening the workspace in the SAME tab.
Replace the JS click handler with a native anchor using target="_blank"
(+ rel=noopener noreferrer) so clicking Open opens the workspace in a
NEW browser tab. The new tab does a full load and routes to /<id> via
the existing parsePath -> App wiring.
The card no longer needs the onNavigate prop (its only navigation was
the Open button), so drop it from WorkspaceCard + WorkspacesHome and
update the card tests to assert the new-tab link attributes instead of
the onNavigate call.
Diffstat (limited to 'src/features/workspaces/ui/WorkspaceCard.svelte')
| -rw-r--r-- | src/features/workspaces/ui/WorkspaceCard.svelte | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/features/workspaces/ui/WorkspaceCard.svelte b/src/features/workspaces/ui/WorkspaceCard.svelte index 6348bb9..81d6fe3 100644 --- a/src/features/workspaces/ui/WorkspaceCard.svelte +++ b/src/features/workspaces/ui/WorkspaceCard.svelte @@ -8,11 +8,9 @@ let { ws, store, - onNavigate, }: { ws: WorkspaceEntry; store: WorkspaceStore; - onNavigate: (path: string) => void; } = $props(); // ── Title: double-click to rename inline ────────────────────────────────── @@ -79,10 +77,6 @@ await store.remove(ws.id); deleting = false; } - - function open(): void { - onNavigate(workspacePath(ws.id)); - } </script> <li class="flex flex-col gap-2 rounded-box border border-primary bg-primary/10 p-3"> @@ -163,10 +157,8 @@ <a class="btn" href={workspacePath(ws.id)} - onclick={(e) => { - e.preventDefault(); - open(); - }} + target="_blank" + rel="noopener noreferrer" > Open </a> |
