diff --git a/app/components/chat.tsx b/app/components/chat.tsx index b6920964..4ab61644 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -4,7 +4,7 @@ import { memo, useState, useRef, useEffect, useLayoutEffect } from "react"; import SendWhiteIcon from "../icons/send-white.svg"; import BrainIcon from "../icons/brain.svg"; import ExportIcon from "../icons/export.svg"; -import MenuIcon from "../icons/menu.svg"; +import ReturnIcon from "../icons/return.svg"; import CopyIcon from "../icons/copy.svg"; import DownloadIcon from "../icons/download.svg"; import LoadingIcon from "../icons/three-dots.svg"; @@ -404,6 +404,7 @@ export function Chat(props: { // submit user input const onUserSubmit = () => { + if (userInput.length <= 0) return; setIsLoading(true); chatStore.onUserInput(userInput).then(() => setIsLoading(false)); setUserInput(""); @@ -420,7 +421,6 @@ export function Chat(props: { // check if should send message const onInputKeyDown = (e: React.KeyboardEvent) => { if (shouldSubmit(e)) { - setAutoScroll(true); onUserSubmit(); e.preventDefault(); } @@ -507,13 +507,10 @@ export function Chat(props: { return (
-
+
{ + onClickCapture={() => { const newTopic = prompt(Locale.Chat.Rename, session.topic); if (newTopic && newTopic !== session.topic) { chatStore.updateCurrentSession( @@ -531,7 +528,7 @@ export function Chat(props: {
} + icon={} bordered title={Locale.Chat.Actions.ChatList} onClick={props?.showSideBar} @@ -667,7 +664,7 @@ export function Chat(props: { onInput={(e) => onInput(e.currentTarget.value)} value={userInput} onKeyDown={onInputKeyDown} - onFocus={() => setAutoScroll(isMobileScreen())} + onFocus={() => setAutoScroll(true)} onBlur={() => { setAutoScroll(false); setTimeout(() => setPromptHints([]), 500); @@ -679,7 +676,6 @@ export function Chat(props: { text={Locale.Chat.Send} className={styles["chat-input-send"]} noDark - disabled={!userInput} onClick={onUserSubmit} />
diff --git a/app/icons/return.svg b/app/icons/return.svg new file mode 100644 index 00000000..eba5e78f --- /dev/null +++ b/app/icons/return.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file