mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
fix scroll to bottom on alert
This commit is contained in:
1 parent
c38113c9b8
commit
ff95c13f84
1 file changed
+9
@@ -302,6 +302,15 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
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.`);
|
||||
|
||||
Reference in new issue
Block a user