From 90c152c0899769f36824a8c48e210fc2f67e9fc1 Mon Sep 17 00:00:00 2001 From: Ammar Date: Thu, 9 Oct 2025 11:54:10 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Auto-grow=20chat=20input=20t?= =?UTF-8?q?o=2050vh=20with=20scroll=20for=20long=20content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplified chat input UX by removing manual resize dragger in favor of auto-growing textarea based on content. Changes: - VimTextArea: max-height 200px → 50vh - Auto-resize logic now uses window.innerHeight * 0.5 - Removed ResizeHandle component and all drag logic - Updated focusMessageInput and editingMessage effects Result: Input grows naturally as you type, scrolls at 50% viewport height. No manual resizing needed. --- src/components/ChatInput.tsx | 4 ++-- src/components/VimTextArea.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ChatInput.tsx b/src/components/ChatInput.tsx index 31e39d116..83e82760b 100644 --- a/src/components/ChatInput.tsx +++ b/src/components/ChatInput.tsx @@ -322,7 +322,7 @@ export const ChatInput: React.FC = ({ element.selectionStart = cursor; element.selectionEnd = cursor; element.style.height = "auto"; - element.style.height = Math.min(element.scrollHeight, 200) + "px"; + element.style.height = Math.min(element.scrollHeight, window.innerHeight * 0.5) + "px"; }); }, []); @@ -358,7 +358,7 @@ export const ChatInput: React.FC = ({ setTimeout(() => { if (inputRef.current) { inputRef.current.style.height = "auto"; - inputRef.current.style.height = Math.min(inputRef.current.scrollHeight, 200) + "px"; + inputRef.current.style.height = Math.min(inputRef.current.scrollHeight, window.innerHeight * 0.5) + "px"; inputRef.current.focus(); } }, 0); diff --git a/src/components/VimTextArea.tsx b/src/components/VimTextArea.tsx index d189ad9ae..3c29d28a0 100644 --- a/src/components/VimTextArea.tsx +++ b/src/components/VimTextArea.tsx @@ -45,7 +45,7 @@ const StyledTextArea = styled.textarea<{ font-size: 13px; resize: none; min-height: 32px; - max-height: 200px; + max-height: 50vh; overflow-y: auto; caret-color: ${(props) => (props.vimMode === "normal" ? "transparent" : "#ffffff")}; @@ -123,7 +123,7 @@ export const VimTextArea = React.forwardRef Date: Thu, 9 Oct 2025 13:46:01 -0500 Subject: [PATCH 2/2] fix fmt --- src/components/ChatInput.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ChatInput.tsx b/src/components/ChatInput.tsx index 9fbccceee..b6b170b37 100644 --- a/src/components/ChatInput.tsx +++ b/src/components/ChatInput.tsx @@ -358,7 +358,8 @@ export const ChatInput: React.FC = ({ setTimeout(() => { if (inputRef.current) { inputRef.current.style.height = "auto"; - inputRef.current.style.height = Math.min(inputRef.current.scrollHeight, window.innerHeight * 0.5) + "px"; + inputRef.current.style.height = + Math.min(inputRef.current.scrollHeight, window.innerHeight * 0.5) + "px"; inputRef.current.focus(); } }, 0);