From e639ccf651c35d447389bae5443c14eca56f4a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Fri, 18 Oct 2024 22:50:45 +0100 Subject: [PATCH] chore: Unleash AI chat UX adjustments --- frontend/src/component/ai/AIChat.tsx | 4 +++- frontend/src/component/ai/AIChatInput.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/ai/AIChat.tsx b/frontend/src/component/ai/AIChat.tsx index a6db132e0018..bc411e19e2e1 100644 --- a/frontend/src/component/ai/AIChat.tsx +++ b/frontend/src/component/ai/AIChat.tsx @@ -107,7 +107,9 @@ export const AIChat = () => { }; useEffect(() => { - scrollToEnd(); + requestAnimationFrame(() => { + scrollToEnd(); + }); const intersectionObserver = new IntersectionObserver( ([entry]) => { diff --git a/frontend/src/component/ai/AIChatInput.tsx b/frontend/src/component/ai/AIChatInput.tsx index ba900c16649d..a119fd8d51ba 100644 --- a/frontend/src/component/ai/AIChatInput.tsx +++ b/frontend/src/component/ai/AIChatInput.tsx @@ -81,10 +81,11 @@ export const AIChatInput = ({ placeholder='Type your message here' fullWidth multiline - maxRows={20} + maxRows={5} value={message} onChange={(e) => setMessage(e.target.value)} onKeyDown={(e) => { + e.stopPropagation(); if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send();