feat(ui): the workflow canvas watches a run live: each step shows its state, duration and error, and the view follows the step in progress

This commit is contained in:
sam committed 2026-10-05 00:34:06 +11:00
1 parent dfff9f6b11
commit 720cd7a6f0
7 files changed
+270 -81

No files matched your search

+19 -2
View File
@@ -9,6 +9,7 @@ import { Spinner } from "@/components/ui/spinner";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import WorkflowCanvas from "./WorkflowCanvas.vue";
import { useWorkflowRuns } from "./workflow-runs";
import {
cloneControlPlaneValue,
removeWorkflowDefinition,
@@ -39,6 +40,8 @@ const id = ref("");
const yaml = ref("");
const localError = ref("");
const { runs, watched, stages, pick } = useWorkflowRuns(selected);
const shippedEntry = computed(() =>
shipped.value.definitions.find((entry) => entry.id === id.value),
);
@@ -139,8 +142,22 @@ function syncScroll(event: Event): void {
>{{ parsed.ok ? "✓" : "✕" }} {{ validationLabel(parsed) }}</span
>
</div>
<TabsContent value="canvas">
<WorkflowCanvas :yaml="yaml" />
<TabsContent value="canvas" class="space-y-2">
<label class="flex items-center gap-2 text-sm">
<span class="text-muted-foreground">Watching</span>
<select
:value="watched"
class="h-8 max-w-md min-w-60 rounded-md border border-input bg-background px-2 text-sm"
@change="pick(($event.target as HTMLSelectElement).value)"
>
<option value="">No run, definition only</option>
<option v-for="run in runs" :key="run.id" :value="String(run.id)">
#{{ run.id }} {{ run.title || "untitled" }}{{ run.status ? ` · ${run.status}` : "" }}
</option>
</select>
<span v-if="!runs.length" class="text-xs text-fg-subtle">This workflow has not run yet.</span>
</label>
<WorkflowCanvas :yaml="yaml" :stages="stages" />
</TabsContent>
<TabsContent value="yaml">
<!--