diff --git a/src/components/Shakespeare/ChatPane.tsx b/src/components/Shakespeare/ChatPane.tsx index ba574047..0a0a6aef 100644 --- a/src/components/Shakespeare/ChatPane.tsx +++ b/src/components/Shakespeare/ChatPane.tsx @@ -302,6 +302,15 @@ export const ChatPane = forwardRef(({ const aiModelAlert = useAIModelErrorAlert(messages); const consoleAlert = useConsoleErrorAlert(); + // Scroll to bottom when alerts appear + useEffect(() => { + if (aiModelAlert.hasError || consoleAlert.hasError) { + setTimeout(() => { + scrollToBottom(); + }, 50); + } + }, [aiModelAlert.hasError, consoleAlert.hasError, scrollToBottom]); + const suggestErrorFix = useCallback((errorMessage: string, errorCount: number) => { const errorText = errorCount === 1 ? 'this error' : 'these errors'; setInput(`The user gets ${errorText} in the app now: ${errorMessage}\n\nCan you identify the problem and create a concise fix.`);