Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
chore: Fix chat-input-area resize (#26824)
Davide Delbianco6e9858960d5f
diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsxindex cbfa3168e9e..8eaf2d4ebc6 100644--- a/web/app/components/base/chat/chat/chat-input-area/index.tsx+++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx@@ -83,6 +83,15 @@ const ChatInputArea = ({const historyRef = useRef([''])const [currentIndex, setCurrentIndex] = useState(-1)const isComposingRef = useRef(false)++ const handleQueryChange = useCallback(+ (value: string) => {+ setQuery(value)+ setTimeout(handleTextareaResize, 0)+ },+ [handleTextareaResize],+ )+const handleSend = () => {if (isResponding) {notify({ type: 'info', message: t('appDebug.errorMessage.waitForResponse') })@@ -101,7 +110,7 @@ const ChatInputArea = ({}if (checkInputsForm(inputs, inputsForm)) {onSend(query, files)- setQuery('')+ handleQueryChange('')setFiles([])}}@@ -131,19 +140,19 @@ const ChatInputArea = ({// When the cmd + up key is pressed, output the previous elementif (currentIndex > 0) {setCurrentIndex(currentIndex - 1)- setQuery(historyRef.current[currentIndex - 1])+ handleQueryChange(historyRef.current[currentIndex - 1])}}else if (e.key === 'ArrowDown' && !e.shiftKey && !e.nativeEvent.isComposing && e.metaKey) {// When the cmd + down key is pressed, output the next elementif (currentIndex < historyRef.current.length - 1) {setCurrentIndex(currentIndex + 1)- setQuery(historyRef.current[currentIndex + 1])+ handleQueryChange(historyRef.current[currentIndex + 1])}else if (currentIndex === historyRef.current.length - 1) {// If it is the last element, clear the input boxsetCurrentIndex(historyRef.current.length)- setQuery('')+ handleQueryChange('')}}}@@ -197,12 +206,8 @@ const ChatInputArea = ({placeholder={t('common.chat.inputPlaceholder', { botName }) || ''}autoFocusminRows={1}- onResize={handleTextareaResize}value={query}- onChange={(e) => {- setQuery(e.target.value)- setTimeout(handleTextareaResize, 0)- }}+ onChange={e => handleQueryChange(e.target.value)}onKeyDown={handleKeyDown}onCompositionStart={handleCompositionStart}onCompositionEnd={handleCompositionEnd}@@ -221,7 +226,7 @@ const ChatInputArea = ({showVoiceInput && (<VoiceInputonCancel={() => setShowVoiceInput(false)}- onConverted={text => setQuery(text)}+ onConverted={text => handleQueryChange(text)}/>)}diff --git a/web/app/components/base/chat/chat/chat-input-area/operation.tsx b/web/app/components/base/chat/chat/chat-input-area/operation.tsxindex 122dfcb6fbb..014ca6651f5 100644--- a/web/app/components/base/chat/chat/chat-input-area/operation.tsx+++ b/web/app/components/base/chat/chat/chat-input-area/operation.tsx@@ -1,3 +1,4 @@+import type { FC, Ref } from 'react'import { memo } from 'react'import {RiMicLine,@@ -18,20 +19,17 @@ type OperationProps = {speechToTextConfig?: EnableTypeonShowVoiceInput?: () => voidonSend: () => void- theme?: Theme | null+ theme?: Theme | null,+ ref?: Ref<HTMLDivElement>;}-const Operation = (- {- ref,- fileConfig,- speechToTextConfig,- onShowVoiceInput,- onSend,- theme,- }: OperationProps & {- ref: React.RefObject<HTMLDivElement>;- },-) => {+const Operation: FC<OperationProps> = ({+ ref,+ fileConfig,+ speechToTextConfig,+ onShowVoiceInput,+ onSend,+ theme,+}) => {return (<divclassName={cn(