From 99bf093f00168104a3ca0ed17c0855010630e771 Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Mon, 20 Jul 2026 14:48:29 +0100 Subject: [PATCH] =?UTF-8?q?feat(web):=20rebuild=20workflow=20builder=20?= =?UTF-8?q?=E2=80=94=20mockup=20styling,=20drag-and-drop,=20inputs=20inspe?= =?UTF-8?q?ctor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/app/workflows/[id]/page.tsx | 587 +++++++++++++++++++++----------- 1 file changed, 385 insertions(+), 202 deletions(-) diff --git a/web/app/workflows/[id]/page.tsx b/web/app/workflows/[id]/page.tsx index eebfa50..5f9e7e7 100644 --- a/web/app/workflows/[id]/page.tsx +++ b/web/app/workflows/[id]/page.tsx @@ -1,61 +1,29 @@ "use client"; import { useEffect, useState } from "react"; +import Link from "next/link"; import { useParams, useRouter } from "next/navigation"; import { useQuery, useQueryClient } from "@tanstack/react-query"; import { api, Workflow, WorkflowStep, WorkflowStepRef, SecretGroupSummary } from "@/lib/api"; -import { Button, Card } from "@/components/ui"; +import { Button } from "@/components/ui"; +import { EditStepModal } from "@/components/workflows/EditStepModal"; +import { EditWorkflowModal } from "@/components/workflows/EditWorkflowModal"; const inputClass = - "w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder-text-secondary/50 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"; + "w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder-text-secondary/50 focus:border-signal focus:outline-none focus:ring-1 focus:ring-signal"; -function NewStepForm({ onClose }: { onClose: () => void }) { - const queryClient = useQueryClient(); - const [name, setName] = useState(""); - const [interpreter, setInterpreter] = useState<"bash" | "powershell">("bash"); - const [script, setScript] = useState(""); - const [saving, setSaving] = useState(false); - const [error, setError] = useState(null); - - const create = async () => { - setSaving(true); - setError(null); - try { - await api.createStep({ - name: name.trim(), - description: "", - interpreter, - script, - declared_outputs: [], - secret_refs: [], - }); - queryClient.invalidateQueries({ queryKey: ["steps"] }); - onClose(); - } catch (e) { - setError((e as Error).message); - } finally { - setSaving(false); - } - }; +type DragPayload = { kind: "lib"; stepId: string } | { kind: "move"; from: number }; +function ShellBadge({ interpreter }: { interpreter: "bash" | "powershell" }) { + const isBash = interpreter === "bash"; return ( -
- {error &&
{error}
} - setName(e.target.value)} /> - -