From ecdd47af36f535d8846ea602c7583fc4a2fcf391 Mon Sep 17 00:00:00 2001 From: Egor Date: Sun, 26 Oct 2025 15:05:37 -0700 Subject: [PATCH] better UX to enable/disable button than hide/show it based on state values --- .../screens/Launch/ModelFileField.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/screens/Launch/ModelFileField.tsx b/src/components/screens/Launch/ModelFileField.tsx index e4b0de2..d084d44 100644 --- a/src/components/screens/Launch/ModelFileField.tsx +++ b/src/components/screens/Launch/ModelFileField.tsx @@ -37,7 +37,7 @@ export const ModelFileField = ({ const [analysisError, setAnalysisError] = useState(); const getHelperText = () => { - if (!value.trim()) return undefined; + if (validationState === 'neutral') return undefined; if (validationState === 'invalid') { return 'Enter a valid URL or file path'; @@ -47,7 +47,7 @@ export const ModelFileField = ({ }; const handleAnalyzeModel = async () => { - if (!value.trim()) return; + if (validationState === 'neutral' || validationState === 'invalid') return; setAnalysisModalOpened(true); setAnalysisLoading(true); @@ -97,13 +97,22 @@ export const ModelFileField = ({ )} - {showAnalyze && value.trim() && validationState !== 'invalid' && ( - + {showAnalyze && ( +