From 8fc7c0bb608db81999de08987f26e0b81eea668c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 20 Dec 2025 20:36:19 -0600 Subject: [PATCH] ChatInput is also disabled while settings are loading --- src/components/Shakespeare/ChatInput.tsx | 10 ++++++---- src/components/Shakespeare/ChatPane.tsx | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Shakespeare/ChatInput.tsx b/src/components/Shakespeare/ChatInput.tsx index f5f869a3..935e9a3b 100644 --- a/src/components/Shakespeare/ChatInput.tsx +++ b/src/components/Shakespeare/ChatInput.tsx @@ -11,6 +11,7 @@ import { ModelSelector } from '@/components/ModelSelector'; interface ChatInputProps { isLoading: boolean; isConfigured: boolean; + isLoadingSettings: boolean; providerModel: string; onProviderModelChange: (model: string) => void; onSend: (input: string, files: File[]) => void; @@ -33,6 +34,7 @@ interface ChatInputProps { export const ChatInput = memo(function ChatInput({ isLoading, isConfigured, + isLoadingSettings, providerModel, onProviderModelChange, onSend, @@ -113,7 +115,7 @@ export const ChatInput = memo(function ChatInput({ : t('selectModelFirst') } className="flex-1 resize-none border-0 bg-transparent px-4 py-3 text-sm focus-visible:ring-0 focus-visible:ring-offset-0 placeholder:text-muted-foreground" - disabled={isLoading || (isConfigured && !providerModel.trim())} + disabled={isLoadingSettings || isLoading || (isConfigured && !providerModel.trim())} rows={1} aria-label="Chat message input" style={{ @@ -134,7 +136,7 @@ export const ChatInput = memo(function ChatInput({ onFileSelect={handleFileSelect} onFileRemove={handleFileRemove} selectedFiles={attachedFiles} - disabled={isLoading} + disabled={isLoadingSettings || isLoading} multiple={true} /> @@ -183,7 +185,7 @@ export const ChatInput = memo(function ChatInput({ diff --git a/src/components/Shakespeare/ChatPane.tsx b/src/components/Shakespeare/ChatPane.tsx index 8ee21fd2..8b09de53 100644 --- a/src/components/Shakespeare/ChatPane.tsx +++ b/src/components/Shakespeare/ChatPane.tsx @@ -104,7 +104,7 @@ export const ChatPane = forwardRef(({ const isBuildLoading = externalIsBuildLoading || false; const scrollAreaRef = useRef(null); const aiSettings = useAISettings(); - const { isConfigured, settings, addRecentlyUsedModel } = aiSettings; + const { isConfigured, settings, addRecentlyUsedModel, isLoading: isLoadingSettings } = aiSettings; const [providerModel, setProviderModel] = useState(() => { // Initialize with first recently used model if available, otherwise empty return settings.recentlyUsedModels?.[0] || ''; @@ -788,6 +788,7 @@ export const ChatPane = forwardRef(({