fix(ui): draw no run state on the canvas for a run without a pinned definition

This commit is contained in:
sam committed 2026-10-18 23:50:03 +11:00
1 parent e43405c1c2
commit 0867da0760
1 file changed
+7 -3
+7 -3
View File
@@ -85,7 +85,11 @@ const localError = ref("");
const { runs, error: runsError, loading: runsLoading, watched, watchedRun, stages, attempt, pick, follow, refresh } = useWorkflowRuns(selected);
const stepTab = ref("definition");
const graph = computed(() => withRuns(workflowGraph(yaml.value), stages.value));
// A run without a pinned definition cannot be matched to the drawn steps, so
// the canvas draws the definition alone.
const unpinned = computed(() => Boolean(watchedRun.value && !watchedRun.value.workflow_definition_yaml));
const drawnStages = computed(() => unpinned.value ? [] : stages.value);
const graph = computed(() => withRuns(workflowGraph(yaml.value), drawnStages.value));
function toggle(key: string): void {
open.value = open.value === key ? null : key;
const run = graph.value.nodes.find((node) => JSON.stringify(node.data.path ?? null) === open.value)?.data.run;
@@ -445,7 +449,7 @@ function syncScroll(event: Event): void {
<p>Could not load recent runs: {{ runsError }}</p>
<Button type="button" variant="outline" size="sm" @click="refresh">Retry runs</Button>
</div>
<p v-if="view === 'canvas' && watchedRun && !watchedRun.workflow_definition_yaml" class="text-xs text-fg-muted" role="status">No workflow snapshot was recorded for this run.</p>
<p v-if="view === 'canvas' && unpinned" class="text-xs text-fg-muted" role="status">No workflow snapshot was recorded for this run.</p>
<!-- Kept mounted so an Archie turn started here still finishes, unlocks the
editor and loads its draft when the operator switches tabs. -->
<TabsContent value="canvas" force-mount class="space-y-2 data-[state=inactive]:hidden">
@@ -459,7 +463,7 @@ function syncScroll(event: Event): void {
class="h-auto min-h-0 flex-1"
:inert="archieWorking"
:yaml="yaml"
:stages="stages"
:stages="drawnStages"
:open="open"
:triggers="triggers"
:types="stepTypeNames"