From 518291f51816c01ed0c9f77d16cee015d5584593 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 23:45:17 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/collections.$collectionId.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/routes/collections.$collectionId.tsx b/src/routes/collections.$collectionId.tsx index 3b63c37..dddfe24 100644 --- a/src/routes/collections.$collectionId.tsx +++ b/src/routes/collections.$collectionId.tsx @@ -61,6 +61,8 @@ import { Tag, } from "lucide-react"; import { toast } from "sonner"; +import { spawnNextCollectionWorkflowTask } from "@/lib/workflow-chain"; +import { ApplyCollectionWorkflowDialog } from "@/components/collections/apply-collection-workflow-dialog"; export const Route = createFileRoute("/collections/$collectionId")({ component: CollectionDetailRoute, @@ -224,8 +226,15 @@ function CollectionDetailRoute() { done_at: next ? new Date().toISOString() : null, }) .eq("id", t.id); - if (error) toast.error("Could not update", { description: error.message }); - else refreshTasks(); + if (error) { + toast.error("Could not update", { description: error.message }); + return; + } + if (next) { + // Auto-spawn the next workflow task in the chain (if any) + await spawnNextCollectionWorkflowTask(t.id); + } + refreshTasks(); }; const deleteTask = async (id: string) => {