fix(ui): toast on workflow enable/disable; editor toolbar wraps instead of crushing the run picker and Publish
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped

This commit is contained in:
sam committed 2026-11-09 09:26:40 +11:00
1 parent 2365e5ede9
commit fd14b8d358
5 files changed
+28 -3

No files matched your search

+2 -2
View File
@@ -392,7 +392,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
<template>
<form class="space-y-4 max-md:flex max-md:min-h-0 max-md:flex-1 max-md:flex-col" @submit.prevent="publish">
<Tabs v-model="view" class="space-y-1.5 max-md:min-h-0 max-md:flex-1">
<div class="workflow-editor-toolbar flex shrink-0 items-center gap-2 max-sm:grid max-sm:grid-cols-[1fr_auto]">
<div class="workflow-editor-toolbar flex shrink-0 flex-wrap items-center gap-2 max-sm:grid max-sm:grid-cols-[1fr_auto]">
<div v-if="$slots.title" class="flex min-w-0 shrink items-center gap-2 max-lg:hidden"><slot name="title" /></div>
<TabsList class="shrink-0 justify-start">
<TabsTrigger value="canvas">Canvas</TabsTrigger>
@@ -413,7 +413,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
/>
</div>
<div v-if="runs.length && view === 'canvas'" class="flex min-w-0 items-center gap-1 max-sm:flex-1">
<OptionSelect :model-value="watched" :options="runOptions" aria-label="Run shown on the canvas" class="min-w-0 max-w-56 max-sm:w-full *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate" @update:model-value="pick" />
<OptionSelect :model-value="watched" :options="runOptions" aria-label="Run shown on the canvas" class="min-w-32 max-w-56 max-sm:w-full *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate" @update:model-value="pick" />
<template v-if="watchedRun">
<!-- One run control keeps the row short; the run's other actions
are on the run, behind Open run in this menu. -->
+3 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { toast } from "vue-sonner";
import { Spinner } from "@/components/ui/spinner";
import { computed, onMounted, ref, shallowRef, watch } from "vue";
import { useRoute } from "vue-router";
@@ -115,9 +116,10 @@ const enabled = computed(() => data.value.definitions?.find((d) => d.id === sele
async function setEnabled(value: boolean) {
try {
await api.workflowEnabled(selected.value, value);
toast.success(`${selected.value} ${value ? "enabled" : "disabled"}`);
await load();
} catch (err) {
error.value = String((err as Error).message || err);
toast.error(`${selected.value} not ${value ? "enabled" : "disabled"}: ${(err as Error).message || err}`);
}
}
const stages = computed(() => (data.value.stages ?? []).filter((s) => s.workflow === selected.value));