diff --git a/.claude/settings.local.json b/.claude/settings.local.json index d26fa39..02cd01c 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -6,7 +6,9 @@ "Bash(cmd.exe /c \"cd /d d:\\\\_projects\\\\gitea\\\\jama\\\\frontend && npm run build 2>&1\")", "Bash(cmd.exe /c \"cd /d d:\\\\_projects\\\\gitea\\\\jama\\\\frontend && npm run build\")", "Bash(powershell.exe -Command \"cd ''d:\\\\_projects\\\\gitea\\\\jama\\\\frontend''; & ''C:\\\\Program Files\\\\nodejs\\\\npm.cmd'' run build 2>&1\")", - "Bash(powershell.exe -Command \"Get-Command npm -ErrorAction SilentlyContinue; \\(Get-Command node -ErrorAction SilentlyContinue\\).Source\")" + "Bash(powershell.exe -Command \"Get-Command npm -ErrorAction SilentlyContinue; \\(Get-Command node -ErrorAction SilentlyContinue\\).Source\")", + "Bash(npm run:*)", + "Bash(*)" ] } } diff --git a/frontend/src/components/ChatWindow.jsx b/frontend/src/components/ChatWindow.jsx index 003042a..c746708 100644 --- a/frontend/src/components/ChatWindow.jsx +++ b/frontend/src/components/ChatWindow.jsx @@ -39,6 +39,10 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess return () => window.removeEventListener('resize', onResize); }, []); + const scrollToBottom = useCallback((smooth = false) => { + messagesEndRef.current?.scrollIntoView({ behavior: smooth ? 'smooth' : 'auto' }); + }, []); + // On mobile, when the soft keyboard opens the visual viewport shrinks but the // messages-container scroll position stays where it was, leaving the latest // messages hidden behind the keyboard. Scroll to bottom whenever the visual @@ -68,10 +72,6 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess }; }, []); - const scrollToBottom = useCallback((smooth = false) => { - messagesEndRef.current?.scrollIntoView({ behavior: smooth ? 'smooth' : 'auto' }); - }, []); - useEffect(() => { if (!group) { setMessages([]); return; } setMessages([]);