diff --git a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsx b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsx index 74b478a6..fd6bbc43 100644 --- a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowNodeLibraryPanel.tsx @@ -11,14 +11,6 @@ import { WorkflowBlockNode } from "../nodes"; import { WorkflowBlockIcon } from "../nodes/WorkflowBlockIcon"; import { AddNodeProps } from "../Workspace"; import { Input } from "@/components/ui/input"; -import { useNodes } from "@xyflow/react"; -import { AppNode } from "../nodes"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; const enableCodeBlock = import.meta.env.VITE_ENABLE_CODE_BLOCK?.toLowerCase() === "true"; @@ -287,7 +279,6 @@ function WorkflowNodeLibraryPanel({ onNodeClick, first, }: Props) { - const nodes = useNodes() as Array; const workflowPanelData = useWorkflowPanelStore( (state) => state.workflowPanelState.data, ); @@ -300,27 +291,6 @@ function WorkflowNodeLibraryPanel({ const [search, setSearch] = useState(""); const inputRef = useRef(null); - // Determine parent context to check if certain blocks should be disabled - const parentNode = workflowPanelData?.parent - ? nodes.find((n) => n.id === workflowPanelData.parent) - : null; - const parentType = parentNode?.type; - - // Check if a node type should be disabled based on parent context - const isBlockDisabled = ( - nodeType: NonNullable, - ): { disabled: boolean; reason: string } => { - // Disable conditional inside conditional - if (nodeType === "conditional" && parentType === "conditional") { - return { - disabled: true, - reason: - "We're working on supporting nested conditionals. Soon you'll be able to use this feature!", - }; - } - return { disabled: false, reason: "" }; - }; - useEffect(() => { // Focus the input when the panel becomes active if (workflowPanelActive && inputRef.current) { @@ -416,17 +386,11 @@ function WorkflowNodeLibraryPanel({
{filteredItems.length > 0 ? ( filteredItems.map((item) => { - const { disabled, reason } = isBlockDisabled(item.nodeType); const itemContent = (
{ - if (disabled) return; onNodeClick({ nodeType: item.nodeType, next: workflowPanelData?.next ?? null, @@ -457,20 +421,6 @@ function WorkflowNodeLibraryPanel({
); - // Wrap with tooltip if disabled - if (disabled) { - return ( - - - {itemContent} - -

{reason}

-
-
-
- ); - } - return itemContent; }) ) : ( diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts index a11ea28a..68ea0e9e 100644 --- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts +++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts @@ -1925,6 +1925,11 @@ function findNextBlockLabel( return null; } + // If this node itself is a conditional, prefer its own merge label + if (currentNode.type === "conditional") { + return currentNode.data.mergeLabel ?? null; + } + const conditionalNodeId = currentNode.data.conditionalNodeId; if (!conditionalNodeId) { return null;