From c188cc3a0bb86ac378b994e977ce73702154bf1f Mon Sep 17 00:00:00 2001 From: Reece Date: Tue, 28 Oct 2025 21:05:55 +0000 Subject: [PATCH] revert base params, clean top gap --- .../src/core/components/layout/Workbench.tsx | 2 +- .../hooks/tools/shared/useBaseParameters.ts | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/frontend/src/core/components/layout/Workbench.tsx b/frontend/src/core/components/layout/Workbench.tsx index dd7db2a5a..55e360675 100644 --- a/frontend/src/core/components/layout/Workbench.tsx +++ b/frontend/src/core/components/layout/Workbench.tsx @@ -186,7 +186,7 @@ export default function Workbench() { className="flex-1 min-h-0 relative z-10 workbench-scrollable " style={{ transition: 'opacity 0.15s ease-in-out', - paddingTop: currentView === 'viewer' ? '0' : activeFiles.length > 0 ? '3.5rem' : '0', + paddingTop: 0, }} > {renderMainContent()} diff --git a/frontend/src/core/hooks/tools/shared/useBaseParameters.ts b/frontend/src/core/hooks/tools/shared/useBaseParameters.ts index 7dd021752..941f8cdd2 100644 --- a/frontend/src/core/hooks/tools/shared/useBaseParameters.ts +++ b/frontend/src/core/hooks/tools/shared/useBaseParameters.ts @@ -34,17 +34,16 @@ export function useBaseParameters(config: BaseParametersConfig): BaseParam }, [parameters, config.validateFn]); const endpointName = config.endpointName; - const isStringEndpoint = typeof endpointName === "string"; - - const getEndpointNameString = useCallback(() => { - return endpointName as string; - }, [endpointName]); - - const getEndpointNameFunction = useCallback(() => { - return (endpointName as (params: T) => string)(parameters); - }, [endpointName, parameters]); - - const getEndpointName = isStringEndpoint ? getEndpointNameString : getEndpointNameFunction; + let getEndpointName: () => string; + if (typeof endpointName === "string") { + getEndpointName = useCallback(() => { + return endpointName; + }, []); + } else { + getEndpointName = useCallback(() => { + return endpointName(parameters); + }, [parameters]); + } return { parameters,