diff --git a/app/[workspace]/project/[projectId]/build/page.tsx b/app/[workspace]/project/[projectId]/build/page.tsx index f1c20b9..8fe36f7 100644 --- a/app/[workspace]/project/[projectId]/build/page.tsx +++ b/app/[workspace]/project/[projectId]/build/page.tsx @@ -242,7 +242,7 @@ interface AgentSession { id: string; app_name: string; task: string; - status: "pending" | "running" | "done" | "failed" | "stopped"; + status: "pending" | "running" | "done" | "approved" | "failed" | "stopped"; output: Array<{ ts: string; type: string; text: string }>; changed_files: Array<{ path: string; status: string }>; error: string | null; @@ -252,10 +252,12 @@ interface AgentSession { } const STATUS_COLORS: Record = { - running: "#3d5afe", done: "#2e7d32", failed: "#c62828", stopped: "#a09a90", pending: "#d4a04a", + running: "#3d5afe", done: "#2e7d32", approved: "#1b5e20", + failed: "#c62828", stopped: "#a09a90", pending: "#d4a04a", }; const STATUS_LABELS: Record = { - running: "Running", done: "Done", failed: "Failed", stopped: "Stopped", pending: "Starting…", + running: "Running", done: "Done", approved: "Shipped", + failed: "Failed", stopped: "Stopped", pending: "Starting…", }; const FILE_STATUS_COLORS: Record = { added: "#2e7d32", modified: "#d4a04a", deleted: "#c62828" }; @@ -295,9 +297,9 @@ function AgentMode({ projectId, appName, appPath }: { projectId: string; appName const list: AgentSession[] = d.sessions ?? []; setSessions(list); setLoadingSessions(false); - // Auto-select: prefer running/pending, then the most recent + // Auto-select: prefer live session, then the most recent if (list.length > 0 && !activeSessionId) { - const live = list.find(s => s.status === "running" || s.status === "pending"); + const live = list.find(s => ["running", "pending"].includes(s.status)); const pick = live ?? list[0]; setActiveSessionId(pick.id); setActiveSession(pick); @@ -324,13 +326,13 @@ function AgentMode({ projectId, appName, appPath }: { projectId: string; appName .catch(() => {}); } } + } catch { /* network hiccup — ignore */ } }; poll(); - const interval = setInterval(() => { - poll(); - }, ["running", "pending"].includes(activeSession?.status ?? "") ? 500 : 5000); + const isLive = ["running", "pending"].includes(activeSession?.status ?? ""); + const interval = setInterval(poll, isLive ? 500 : 5000); return () => { cancelled = true; clearInterval(interval); }; }, [activeSessionId, projectId, activeSession?.status]); @@ -554,6 +556,11 @@ function AgentMode({ projectId, appName, appPath }: { projectId: string; appName ))} + {activeSession.status === "approved" && ( +
+ ✓ Auto-committed — these changes are live. +
+ )} {activeSession.status === "done" && (
{approveResult && ( @@ -648,6 +655,47 @@ function AgentMode({ projectId, appName, appPath }: { projectId: string; appName ); } + // Session auto-committed — show confirmation, offer next task + if (st === "approved") { + return ( +
+
+ + ✓ Shipped — changes committed and deployment triggered automatically. + + + +
+ {showFollowUp && ( +
+