From d2b5202505870e549122c9e3d8136d9a6c0dcef7 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Tue, 3 Mar 2026 23:16:31 +1300 Subject: [PATCH] refactor: remove collapsible toggle from ModelParameters Always display parameters inline instead of behind a collapsible "Parameters" header. The toggle added unnecessary interaction cost. Co-Authored-By: Claude Opus 4.6 --- src/components/nodes/ModelParameters.tsx | 87 ++++++------------------ 1 file changed, 19 insertions(+), 68 deletions(-) diff --git a/src/components/nodes/ModelParameters.tsx b/src/components/nodes/ModelParameters.tsx index cdb2178f..83533ae3 100644 --- a/src/components/nodes/ModelParameters.tsx +++ b/src/components/nodes/ModelParameters.tsx @@ -65,7 +65,6 @@ export function ModelParameters({ const [schema, setSchema] = useState([]); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); - const [isExpanded, setIsExpanded] = useState(true); // Use stable selector for API keys to prevent unnecessary re-fetches const { replicateApiKey, falApiKey, kieApiKey, wavespeedApiKey } = useProviderApiKeys(); @@ -139,12 +138,12 @@ export function ModelParameters({ fetchSchema(); }, [modelId, provider, replicateApiKey, falApiKey, kieApiKey, wavespeedApiKey, onInputsLoaded]); - // Notify parent to resize node when schema loads and panel is expanded + // Notify parent to resize node when schema loads useEffect(() => { - if (isExpanded && schema.length > 0 && onExpandChange) { + if (schema.length > 0 && onExpandChange) { onExpandChange(true, schema.length); } - }, [schema, isExpanded, onExpandChange]); + }, [schema, onExpandChange]); const handleParameterChange = useCallback( (name: string, value: unknown) => { @@ -174,70 +173,22 @@ export function ModelParameters({ } return ( -
- {/* Collapsible header */} - - - {/* Parameter inputs (when expanded) */} - {isExpanded && ( -
- {error ? ( - {error} - ) : isLoading ? ( - Loading parameters... - ) : schema.length === 0 ? ( - No parameters available - ) : ( - schema.map((param) => ( - handleParameterChange(param.name, value)} - /> - )) - )} -
+
+ {error ? ( + {error} + ) : isLoading ? ( + Loading parameters... + ) : schema.length === 0 ? ( + No parameters available + ) : ( + schema.map((param) => ( + handleParameterChange(param.name, value)} + /> + )) )}
);