Fix a few ui edge cases - refresh occasionally crashing, chat loader over text and chat input height returning to auto (#3469)

This commit is contained in:
Zane
2025-07-16 19:06:56 -07:00
committed by GitHub
parent cd940dd6f7
commit 33c082cd5b
7 changed files with 85 additions and 13 deletions
+7 -2
View File
@@ -427,7 +427,6 @@ export default function ChatInput({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [numTokens, toolCount, tokenLimit, isTokenLimitLoaded, addAlert, clearAlerts]);
const minHeight = '1rem';
const maxHeight = 10 * 24;
// Debounced function to update actual value
@@ -456,6 +455,13 @@ export default function ChatInput({
}
}, [debouncedAutosize, displayValue]);
// Reset textarea height when displayValue is empty
useEffect(() => {
if (textAreaRef.current && displayValue === '') {
textAreaRef.current.style.height = 'auto';
}
}, [displayValue]);
const handleChange = (evt: React.ChangeEvent<HTMLTextAreaElement>) => {
const val = evt.target.value;
const cursorPosition = evt.target.selectionStart;
@@ -910,7 +916,6 @@ export default function ChatInput({
ref={textAreaRef}
rows={1}
style={{
minHeight: `${minHeight}px`,
maxHeight: `${maxHeight}px`,
overflowY: 'auto',
opacity: isRecording ? 0 : 1,