From 8a2c0766910856d501fb332feac7374e8b49f55d Mon Sep 17 00:00:00 2001 From: mlogclub Date: Mon, 22 Jun 2026 17:14:35 +0800 Subject: [PATCH] feat: add WorkflowValidationBadge component for improved validation feedback --- .../_components/workflow-editor.tsx | 52 +++++++++++++++++-- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/web/app/dashboard/ai-workflows/_components/workflow-editor.tsx b/web/app/dashboard/ai-workflows/_components/workflow-editor.tsx index e3805b8..b0026d5 100644 --- a/web/app/dashboard/ai-workflows/_components/workflow-editor.tsx +++ b/web/app/dashboard/ai-workflows/_components/workflow-editor.tsx @@ -19,6 +19,11 @@ import { useCallback, useEffect, useMemo, useState } from "react" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover" import { ResizableHandle, ResizablePanel, @@ -217,11 +222,7 @@ export function WorkflowEditor({ -
- - {validation.valid ? "Valid draft" : `${validation.errors.length} issues`} - -
+ @@ -252,3 +253,44 @@ export function WorkflowEditor({ ) } + +function WorkflowValidationBadge({ + errors, + valid, +}: { + errors: string[] + valid: boolean +}) { + return ( +
+ {valid ? ( + Valid draft + ) : ( + + + } + > + + {errors.length} issues + + + +
Validation issues
+
    + {errors.map((error) => ( +
  • + {error} +
  • + ))} +
+
+
+ )} +
+ ) +}