Files
archie/ui/src/workflows/RunWorkflowButton.vue
T
sam 1f4910a651 feat(workflows): test-run unsaved drafts and browse workflow version history
A test run pins a validated draft, runs with forge and push writes
suppressed and recorded per step, and is excluded from workflow stats.
The History tab lists revisions that changed a workflow, diffs them as
YAML and on the canvas, restores into the editor, and ties runs to the
revision they used.
2026-10-13 12:27:40 +11:00

44 lines
1.4 KiB
Vue

<script setup lang="ts">
import { ref } from "vue";
import { FlaskConical, Play } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import NewTaskForm from "@/tasks/NewTaskForm.vue";
defineProps<{
workflow: string;
disabled?: boolean;
/** The unsaved definition to test-run; absent runs the stored one. */
draft?: string;
}>();
const emit = defineEmits<{ started: [taskId: number] }>();
const open = ref(false);
function started(taskId: number): void {
open.value = false;
emit("started", taskId);
}
</script>
<template>
<Dialog v-model:open="open">
<DialogTrigger as-child>
<Button
type="button"
size="sm"
variant="outline"
:disabled="disabled"
:title="draft !== undefined ? 'Run this draft once without touching the forge' : disabled ? 'Save your changes first' : undefined"
>
<component :is="draft !== undefined ? FlaskConical : Play" data-icon="inline-start" /> {{ draft !== undefined ? "Test" : "Run" }}</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[640px]">
<DialogHeader>
<DialogTitle>{{ draft !== undefined ? "Test" : "Run" }} {{ workflow }}</DialogTitle>
</DialogHeader>
<NewTaskForm v-if="open" :workflow="workflow" :draft="draft" @started="started" @cancel="open = false" />
</DialogContent>
</Dialog>
</template>