feat(ui): Build with Archie runs on the chat system, floats over the canvas and keeps its conversation

Each workflow has its own persisted conversation, rendered like the chat panel.
The canvas and YAML go read-only while Archie works instead of inert. The code
block highlighter loads Go and TOML and drops jsx, tsx and vue.
This commit is contained in:
sam committed 2026-10-19 02:43:54 +11:00
1 parent ab2b50045f
commit 808551aeb0
21 files changed
+264 -252

No files matched your search

+8 -11
View File
@@ -39,7 +39,7 @@ import { useWorkflowHistory } from "./workflow-history";
import { revisionOfRun, type WorkflowRevision } from "./workflow-revisions";
import { deleteStep, duplicateStep, insertStep, moveStep, normalizeStepIDs, replaceStep, revertWorkflowChange, stepAt, workflowChanges, workflowField, type StepPath } from "./workflow-edit";
import ChangeList from "@/components/ChangeList.vue";
import CoBuilder from "./CoBuilder.vue";
import ArchieBuilder from "./ArchieBuilder.vue";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
import { useWorkflowRuns } from "./workflow-runs";
import { useWorkflowTriggers } from "./workflow-triggers";
@@ -225,7 +225,7 @@ async function dropDraft(target: string): Promise<void> {
await workflows.putDraft(target, undefined);
}
// Edits made while Archie works would be overwritten by its draft, so the
// editor is locked until the turn ends.
// canvas and YAML go read-only until the turn ends; viewing stays open.
const archieWorking = ref(false);
// Archie works from the saved draft, so pending edits are written first.
async function flushDraft(): Promise<void> {
@@ -444,13 +444,12 @@ function syncScroll(event: Event): void {
<p v-if="restartError" role="alert" class="absolute bottom-16 left-14 z-10 max-w-xl rounded-md border border-danger/40 bg-card px-3 py-2 text-sm text-danger shadow-lg">{{ restartError }}</p>
<WorkflowCanvas
class="h-auto min-h-0 flex-1"
:inert="archieWorking"
:yaml="canvasYaml"
:stages="drawnStages"
:open="open"
:triggers="triggers"
:types="stepTypeNames"
:readonly="!!pinnedYaml"
:readonly="!!pinnedYaml || archieWorking"
:restartable="restartable"
:problems="pinnedYaml ? undefined : nodeProblems"
:title="parsed.ok ? parsed.id : id"
@@ -474,7 +473,7 @@ function syncScroll(event: Event): void {
<div v-if="data.run && watchedRun && stepTab === 'run'" class="max-h-[32rem] overflow-y-auto">
<StepRun :task="watchedRun" :attempt="attempt" :stage="data.run" :stages="stages" />
</div>
<fieldset v-else :disabled="!!pinnedYaml" class="min-w-0">
<fieldset v-else :disabled="!!pinnedYaml || archieWorking" class="min-w-0">
<StepEditor
:key="open ?? ''"
:yaml="canvasYaml"
@@ -488,12 +487,9 @@ function syncScroll(event: Event): void {
</template>
</template>
</WorkflowCanvas>
<!-- Below the canvas rather than over it: nodes run to the bottom edge,
so a floating bar hid the last step. -->
<div class="flex shrink-0 justify-center px-3 pt-2">
<CoBuilder
<div class="pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center px-3">
<ArchieBuilder
v-if="selected"
:key="selected"
:workflow="selected"
:before-send="flushDraft"
@proposed="takeProposal"
@@ -507,7 +503,7 @@ function syncScroll(event: Event): void {
</TabsContent>
<TabsContent value="performance" class="grid gap-4 max-md:min-h-0 max-md:overflow-y-auto"><slot name="performance" /></TabsContent>
<TabsContent value="runs" class="max-md:min-h-0 max-md:overflow-y-auto"><slot name="runs" /></TabsContent>
<TabsContent value="yaml" :inert="archieWorking" class="max-md:min-h-0 max-md:overflow-y-auto">
<TabsContent value="yaml" class="max-md:min-h-0 max-md:overflow-y-auto">
<!--
A gutter and a highlighted layer behind the live textarea, so the YAML
is numbered and coloured where it is edited rather than in a second,
@@ -554,6 +550,7 @@ function syncScroll(event: Event): void {
v-model="yaml"
name="workflow-yaml"
required
:readonly="archieWorking"
class="relative min-h-96 resize-y max-md:h-full max-md:min-h-0 max-md:resize-none rounded-none border-0 bg-transparent py-3 pr-3 pl-14 text-[13px] leading-6 text-transparent caret-foreground shadow-none md:text-[13px] focus-visible:ring-0"
spellcheck="false"
wrap="off"