feat: reuse existing tabs when opening sessions instead of always creating new ones
Use named window targets (session-{id}, instance-{id}) instead of _blank:
- use-instance-actions.ts: window.open(..., 'session-{id}') for programmatic opens
- session-card.tsx: <a target='session-{id}'> for direct link opens (mobile + desktop)
- workspace-instance-chips.tsx: <a target='instance-{id}'> for chip links
- instance-list.tsx: <a target='instance-{id}'> for instance open links
Browser behavior: if a tab with that target name exists, it navigates/focuses
that tab instead of opening a new one.
Quality gates: tsc --noEmit pass, npm run build pass, 80/80 tests pass
This commit is contained in:
@@ -138,7 +138,7 @@ export function SessionCard({
|
||||
)}
|
||||
{session.url && (
|
||||
<p className="session-card-url">
|
||||
<a href={session.url} target="_blank" rel="noopener noreferrer">
|
||||
<a href={session.url} target={`session-${session.id}`} rel="noopener noreferrer">
|
||||
{session.url}
|
||||
</a>
|
||||
</p>
|
||||
@@ -158,7 +158,7 @@ export function SessionCard({
|
||||
{openHref ? (
|
||||
<a
|
||||
href={openHref}
|
||||
target="_blank"
|
||||
target={`session-${session.id}`}
|
||||
rel="noopener noreferrer"
|
||||
className="secondary-button mobile-primary"
|
||||
>
|
||||
@@ -215,7 +215,7 @@ export function SessionCard({
|
||||
{openHref ? (
|
||||
<a
|
||||
href={openHref}
|
||||
target="_blank"
|
||||
target={`session-${session.id}`}
|
||||
rel="noopener noreferrer"
|
||||
className="secondary-button small"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user