From 73d7e1d92209a5dee66a1170f7ec737cc97e5223 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Mon, 1 Jun 2026 20:47:50 +0200 Subject: [PATCH] fix(frontend): make runs-page job links use the job's workspace In the cross-workspace runs view a job can belong to a workspace other than the active one. Several job-derived links resolved to the active workspace (or, since the central sync, to a bare URL that the layout fills with the active workspace), sending users to the wrong workspace or a 404. Use job.workspace_id (fallback $workspaceStore) for: - run detail page: "Go to script/flow" (viewHref), edit link, and the runs-filter button (runsHref) - JobDetailHeader: parent-job link and all JobDetailFieldConfig getHref calls (were passed $workspaceStore) - RunBadges: script-hash link - FlowMetadata: parent/step links Same-workspace jobs are unaffected (job.workspace_id == active); foreign jobs now link correctly and the rendered hrefs are explicit for copy/middle-click/new-tab. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/lib/components/FlowMetadata.svelte | 8 ++++++-- .../src/lib/components/runs/JobDetailHeader.svelte | 10 +++++----- frontend/src/lib/components/runs/RunBadges.svelte | 2 +- .../routes/(root)/(logged)/run/[...run]/+page.svelte | 6 +++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/frontend/src/lib/components/FlowMetadata.svelte b/frontend/src/lib/components/FlowMetadata.svelte index 022fa874a2..3728ca7ffb 100644 --- a/frontend/src/lib/components/FlowMetadata.svelte +++ b/frontend/src/lib/components/FlowMetadata.svelte @@ -58,7 +58,9 @@ Step of flow - + {truncateRev(job.parent_job, 18)} @@ -68,7 +70,9 @@ Triggered by parent - + {job.parent_job} diff --git a/frontend/src/lib/components/runs/JobDetailHeader.svelte b/frontend/src/lib/components/runs/JobDetailHeader.svelte index 28519d5311..5475b58d3f 100644 --- a/frontend/src/lib/components/runs/JobDetailHeader.svelte +++ b/frontend/src/lib/components/runs/JobDetailHeader.svelte @@ -240,7 +240,7 @@ Triggered by {/if} {config.label} @@ -467,7 +467,7 @@ {#each fields as config} {@const displayValue = getDisplayValue(config, job)} {@const fullValue = getFullValue(config, job)} - {@const href = config.getHref?.(job, $workspaceStore || '')} + {@const href = config.getHref?.(job, job.workspace_id ?? $workspaceStore ?? '')}