From c43f502ffb39e84f4839d5dbfc4a93d3f12ce658 Mon Sep 17 00:00:00 2001 From: waleed Date: Thu, 12 Feb 2026 11:23:14 -0800 Subject: [PATCH] fix(tool-input): render uncovered tool params alongside subblocks The SubBlock-first rendering path was hard-returning after rendering subblocks, so tool params without matching subblocks (like inputMapping for workflow tools) were never rendered. Now renders subblocks first, then any remaining displayParams not covered by subblocks via the legacy ParameterWithLabel fallback. Co-Authored-By: Claude Opus 4.6 --- .../components/tool-input/tool-input.tsx | 47 +++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) 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 2cf1305bb..9d166e605 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 @@ -1771,9 +1771,15 @@ export const ToolInput = memo(function ToolInput({ {/* Tool parameters */} {(() => { + const renderedElements: React.ReactNode[] = [] + // SubBlock-first rendering for registry tools if (useSubBlocks && displaySubBlocks.length > 0) { - return displaySubBlocks.map((sb) => { + const coveredParamIds = new Set( + displaySubBlocks.map((sb) => sb.canonicalParamId || sb.id) + ) + + displaySubBlocks.forEach((sb) => { const effectiveParamId = sb.canonicalParamId || sb.id // Compute canonical toggle for basic/advanced mode switching @@ -1808,7 +1814,7 @@ export const ToolInput = memo(function ToolInput({ ? sb : { ...sb, title: formatParameterLabel(effectiveParamId) } - return ( + renderedElements.push( ) }) + + // Render remaining tool params not covered by subblocks + // (e.g. inputMapping for workflow tools with custom UI) + const uncoveredParams = displayParams.filter( + (param) => + !coveredParamIds.has(param.id) && evaluateParameterCondition(param, tool) + ) + + uncoveredParams.forEach((param) => { + renderedElements.push( + + {(wandControlRef: React.MutableRefObject) => + renderParameterInput( + param, + tool.params?.[param.id] || '', + (value) => handleParamChange(toolIndex, param.id, value), + toolIndex, + toolContextValues as Record, + wandControlRef + ) + } + + ) + }) + + return renderedElements } // Fallback: legacy ToolParameterConfig-based rendering @@ -1831,8 +1872,6 @@ export const ToolInput = memo(function ToolInput({ evaluateParameterCondition(param, tool) ) - const renderedElements: React.ReactNode[] = [] - filteredParams.forEach((param) => { renderedElements.push(