fix: redesign run not found page and fix switching to the right workspace (#11374)

* fix: redesign run not found page and clear stale not-found on workspace switch

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor: use design-system Button for workspace rows on run not found page

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Diego Imbert
2026-09-28 17:23:59 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 60ef82196e
commit d9c7d71f07
2 changed files with 47 additions and 19 deletions
@@ -411,6 +411,8 @@
errorIteration = 0
currentId = testId
scriptProgress = undefined
notfound = false
loadError = undefined
// Replay mode: feed recorded events instead of real SSE
const replay = getActiveReplay()
@@ -727,6 +729,9 @@
}),
noLogs
)
// The completed-job branch below returns before the end of this block.
notfound = false
loadError = undefined
callbacks?.change?.(job)
}
@@ -41,8 +41,11 @@
Share2,
Globe,
Users,
Play
Play,
SearchX,
ArrowRight
} from 'lucide-svelte'
import WorkspaceIcon from '$lib/components/workspace/WorkspaceIcon.svelte'
import { forLater } from '$lib/forLater'
import { isJobResolvable } from '$lib/utils'
@@ -751,30 +754,50 @@
</div>
</div>
{:else if notfound || (job?.workspace_id != undefined && $workspaceStore != undefined && job?.workspace_id != $workspaceStore)}
<div class="max-w-7xl px-4 mx-auto w-full">
<div class="flex flex-col gap-6">
<h1 class="text-red-400 mt-6 text-2xl font-semibold"
>Job {page.params.run} not found in {$workspaceStore}</h1
>
<h2 class="text-primary text-lg font-semibold">Are you in the right workspace?</h2>
<div class="flex flex-col gap-2">
{#each $userWorkspaces as workspace}
<div>
{@const currentWorkspace = $userWorkspaces.find((w) => w.id === $workspaceStore)}
{@const otherWorkspaces = $userWorkspaces.filter((w) => w.id !== $workspaceStore)}
<div class="max-w-lg px-4 mx-auto w-full py-16">
<div class="flex flex-col items-center text-center gap-3">
<div class="rounded-full bg-surface-secondary p-3">
<SearchX size={24} class="text-secondary" />
</div>
<h1 class="text-lg font-semibold text-emphasis">Run not found</h1>
<p class="text-xs text-secondary">
No run with ID
<span class="font-mono text-emphasis break-all">{page.params.run}</span>
exists in
<span class="font-semibold text-emphasis">{currentWorkspace?.name ?? $workspaceStore}</span
>. It may belong to another workspace, or it may have been deleted.
</p>
</div>
{#if otherWorkspaces.length > 0}
<div class="mt-8 flex flex-col gap-2">
<h2 class="text-xs font-semibold text-emphasis">Look in another workspace</h2>
<div
class="flex flex-col rounded-md border border-light bg-surface-tertiary divide-y divide-border-light overflow-hidden"
>
{#each otherWorkspaces as workspace (workspace.id)}
<Button
variant="default"
variant="subtle"
unifiedSize="md"
on:click={() => {
goto(`/run/${page.params.run}?workspace=${workspace.id}`)
}}
btnClasses="h-auto justify-start text-left gap-3 px-3 py-2 rounded-none"
endIcon={{ icon: ArrowRight, classes: 'text-hint' }}
onClick={() => goto(`/run/${page.params.run}?workspace=${workspace.id}`)}
>
See in {workspace.name}
<WorkspaceIcon workspaceColor={workspace.color} padding="p-1" size={12} />
<div class="flex flex-col min-w-0 grow">
<span class="text-xs font-semibold text-emphasis truncate">{workspace.name}</span>
<span class="text-2xs text-secondary truncate">{workspace.id}</span>
</div>
</Button>
</div>
{/each}
<div>
<Button href="{base}/runs" unifiedSize="md" variant="accent">Go to runs page</Button>
{/each}
</div>
</div>
{/if}
<div class="mt-6 flex justify-center">
<Button href="{base}/runs" unifiedSize="md" variant="default">Go to runs page</Button>
</div>
</div>
{:else}