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 | c5ea2232f117adda740c7e3b8366e9f10f14d3cb (patch) | |
| tree | 39df64c85d8b2ae13506b1db9bf1264dda84992e /src/features/workspaces/ui/WorkspaceCard.svelte | |
| parent | 4ac993df443db0ecbcdf7c13e39c987b8d1ef28b (diff) | |
| download | dispatch-web-c5ea2232f117adda740c7e3b8366e9f10f14d3cb.tar.gz dispatch-web-c5ea2232f117adda740c7e3b8366e9f10f14d3cb.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> |
