From b1cde0265c31140865c04537e222a787701689c8 Mon Sep 17 00:00:00 2001 From: waleed Date: Thu, 12 Feb 2026 12:24:51 -0800 Subject: [PATCH] update styling + move predeploy checks earlier for first time deploys --- .../components/deploy/hooks/use-deployment.ts | 21 +++++++++++++++++++ .../tool-input/components/tools/parameter.tsx | 5 ----- .../components/tools/sub-block-renderer.tsx | 16 ++------------ .../components/tool-input/tool-input.tsx | 4 ++-- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deployment.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deployment.ts index 1f2a350d8..b6a5d585e 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deployment.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deployment.ts @@ -1,7 +1,10 @@ import { useCallback, useState } from 'react' import { createLogger } from '@sim/logger' +import { runPreDeployChecks } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-predeploy-checks' import { useNotificationStore } from '@/stores/notifications' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' +import { mergeSubblockState } from '@/stores/workflows/utils' +import { useWorkflowStore } from '@/stores/workflows/workflow/store' const logger = createLogger('useDeployment') @@ -35,6 +38,24 @@ export function useDeployment({ return { success: true, shouldOpenModal: true } } + const { blocks, edges, loops, parallels } = useWorkflowStore.getState() + const liveBlocks = mergeSubblockState(blocks, workflowId) + const checkResult = runPreDeployChecks({ + blocks: liveBlocks, + edges, + loops, + parallels, + workflowId, + }) + if (!checkResult.passed) { + addNotification({ + level: 'error', + message: checkResult.error || 'Pre-deploy validation failed', + workflowId, + }) + return { success: false, shouldOpenModal: false } + } + setIsDeploying(true) try { const response = await fetch(`/api/workflows/${workflowId}/deploy`, { diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/parameter.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/parameter.tsx index 71d244c91..d69ad776b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/parameter.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/parameter.tsx @@ -90,11 +90,6 @@ export function ParameterWithLabel({
{showWand && diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/sub-block-renderer.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/sub-block-renderer.tsx index 6dd0cd799..d99f4f1f3 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/sub-block-renderer.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/sub-block-renderer.tsx @@ -1,6 +1,6 @@ 'use client' -import { useEffect, useMemo, useRef } from 'react' +import { useEffect, useRef } from 'react' import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value' import { SubBlock } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block' import type { SubBlockConfig as BlockSubBlockConfig } from '@/blocks/types' @@ -77,21 +77,10 @@ export function ToolSubBlockRenderer({ } }, [storeValue, toolIndex, effectiveParamId, onParamChange]) - // Determine if the parameter is optional for the user (LLM can fill it) + // Suppress SubBlock's "*" required indicator when the LLM can fill the param const visibility = subBlock.paramVisibility ?? 'user-or-llm' const isOptionalForUser = visibility !== 'user-only' - const labelSuffix = useMemo( - () => - isOptionalForUser ? ( - - (optional) - - ) : null, - [isOptionalForUser] - ) - - // Suppress SubBlock's "*" required indicator for optional-for-user params const config = { ...subBlock, id: syntheticId, @@ -105,7 +94,6 @@ export function ToolSubBlockRenderer({ isPreview={false} disabled={disabled} canonicalToggle={canonicalToggle} - labelSuffix={labelSuffix} dependencyContext={toolParams} /> ) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx index 63bba9e32..01c49e49a 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx @@ -1067,7 +1067,7 @@ export const ToolInput = memo(function ToolInput({
- Account + Account *