diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 39abdd97b24..361f79edb1b 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -379,12 +379,13 @@ function useScrollToBottom() { // for auto-scroll const scrollRef = useRef(null); const [autoScroll, setAutoScroll] = useState(true); - + const config = useAppConfig(); + let isAutoScrollEnabled: boolean = config.autoScrollMessage; function scrollDomToBottom() { const dom = scrollRef.current; if (dom) { requestAnimationFrame(() => { - setAutoScroll(true); + setAutoScroll(isAutoScrollEnabled); dom.scrollTo(0, dom.scrollHeight); }); } @@ -960,7 +961,8 @@ function _Chat() { } setHitBottom(isHitBottom); - setAutoScroll(isHitBottom); + let isAutoScrollEnabled: boolean = config.autoScrollMessage; + setAutoScroll(isAutoScrollEnabled); }; function scrollToBottom() { diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 84ae7edf651..0c1b61d2b7f 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -825,6 +825,21 @@ export function Settings() { } > + + + updateConfig( + (config) => + (config.autoScrollMessage = e.currentTarget.checked), + ) + } + > + diff --git a/app/locales/ar.ts b/app/locales/ar.ts index b58c3a2e8e5..770428ca3a8 100644 --- a/app/locales/ar.ts +++ b/app/locales/ar.ts @@ -135,6 +135,10 @@ const ar: PartialLocaleType = { Title: "عرض معاينة الـ Send", SubTitle: "معاينة Markdown في فقاعة", }, + AutoScrollMessage: { + Title: "الرد التلقائي للتمرير", + SubTitle: "تمرير الرسالة أثناء الرد", + }, Mask: { Splash: { Title: "شاشة تظهر الأقنعة", diff --git a/app/locales/bn.ts b/app/locales/bn.ts index 6dfb0da9bc4..927c74ceca4 100644 --- a/app/locales/bn.ts +++ b/app/locales/bn.ts @@ -161,6 +161,10 @@ const bn: PartialLocaleType = { Title: "প্রিভিউ বুলবুল প্রেরণ করুন", SubTitle: "বুলবুলে মার্কডাউন প্রিভিউ করুন", }, + AutoScrollMessage: { + Title: "অটো-স্ক্রল উত্তর", + SubTitle: "উত্তর দেওয়ার সময় বার্তা স্ক্রল করুন", + }, Mask: { Splash: { Title: "মাস্ক স্প্ল্যাশ স্ক্রিন", diff --git a/app/locales/cn.ts b/app/locales/cn.ts index dfb9aafa204..dfbf5ccf3c7 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -175,6 +175,10 @@ const cn = { Title: "预览气泡", SubTitle: "在预览气泡中预览 Markdown 内容", }, + AutoScrollMessage: { + Title: "自动滚动回复", + SubTitle: "滚动消息以进行回复", + }, AutoGenerateTitle: { Title: "自动生成标题", SubTitle: "根据对话内容生成合适的标题", diff --git a/app/locales/cs.ts b/app/locales/cs.ts index c1a84430fb3..7f7532bea1e 100644 --- a/app/locales/cs.ts +++ b/app/locales/cs.ts @@ -91,6 +91,10 @@ const cs: PartialLocaleType = { Title: "Odesílat chatovací bublinu s náhledem", SubTitle: "Zobrazit v náhledu bubliny", }, + AutoScrollMessage: { + Title: "Automatické rolování odpovědi", + SubTitle: "Rolovat zprávu při odpovídání", + }, Mask: { Splash: { Title: "Úvodní obrazovka Masek", diff --git a/app/locales/de.ts b/app/locales/de.ts index 2fe871bc9f0..69a5a7f9672 100644 --- a/app/locales/de.ts +++ b/app/locales/de.ts @@ -91,6 +91,10 @@ const de: PartialLocaleType = { Title: "Vorschau-Bubble senden", SubTitle: "Preview markdown in bubble", }, + AutoScrollMessage: { + Title: "Auto-Scroll-Antwort", + SubTitle: "Nachricht beim Antworten scrollen", + }, Mask: { Splash: { Title: "Mask Splash Screen", diff --git a/app/locales/en.ts b/app/locales/en.ts index 892a846a42e..0e2e6c3c99a 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -177,6 +177,10 @@ const en: LocaleType = { Title: "Send Preview Bubble", SubTitle: "Preview markdown in bubble", }, + AutoScrollMessage: { + Title: "Auto-Scroll Reply", + SubTitle: "Scroll the message during reply", + }, AutoGenerateTitle: { Title: "Auto Generate Title", SubTitle: "Generate a suitable title based on the conversation content", diff --git a/app/locales/es.ts b/app/locales/es.ts index 7d742d536e5..00a5b4d0930 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -91,6 +91,10 @@ const es: PartialLocaleType = { Title: "Enviar burbuja de vista previa", SubTitle: "Preview markdown in bubble", }, + AutoScrollMessage: { + Title: "Respuesta con Auto-Desplazamiento", + SubTitle: "Desplazar el mensaje durante la respuesta", + }, Mask: { Splash: { Title: "Mask Splash Screen", diff --git a/app/locales/fr.ts b/app/locales/fr.ts index 944754d62a7..83658dbf7e4 100644 --- a/app/locales/fr.ts +++ b/app/locales/fr.ts @@ -135,6 +135,10 @@ const fr: PartialLocaleType = { Title: "Aperçu de l'envoi dans une bulle", SubTitle: "Aperçu du Markdown dans une bulle", }, + AutoScrollMessage: { + Title: "Réponse défilement automatique", + SubTitle: "Faire défiler le message lors de la réponse", + }, Mask: { Splash: { Title: "Écran de masque", diff --git a/app/locales/id.ts b/app/locales/id.ts index 571156a5776..95976fac8de 100644 --- a/app/locales/id.ts +++ b/app/locales/id.ts @@ -200,6 +200,10 @@ const id: PartialLocaleType = { Title: "Pratinjau Obrolan", SubTitle: "Pratinjau Obrolan dengan markdown", }, + AutoScrollMessage: { + Title: "Balasan Auto-Scroll", + SubTitle: "Gulir pesan saat membalas", + }, Mask: { Splash: { Title: "Layar Pembuka Masks", @@ -369,8 +373,8 @@ const id: PartialLocaleType = { }, Exporter: { Description: { - Title: "Hanya pesan setelah menghapus konteks yang akan ditampilkan" - }, + Title: "Hanya pesan setelah menghapus konteks yang akan ditampilkan", + }, Model: "Model", Messages: "Pesan", Topic: "Topik", diff --git a/app/locales/it.ts b/app/locales/it.ts index 7f0a95846c2..08b21d97ffc 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -91,6 +91,10 @@ const it: PartialLocaleType = { Title: "Anteprima di digitazione", SubTitle: "Preview markdown in bubble", }, + AutoScrollMessage: { + Title: "Risposta Auto-Scroll", + SubTitle: "Scorri il messaggio durante la risposta", + }, Mask: { Splash: { Title: "Mask Splash Screen", diff --git a/app/locales/jp.ts b/app/locales/jp.ts index dcbd0f2821b..d44b2334fd4 100644 --- a/app/locales/jp.ts +++ b/app/locales/jp.ts @@ -142,6 +142,10 @@ const jp: PartialLocaleType = { Title: "プレビューバブルの送信", SubTitle: "プレビューバブルでマークダウンコンテンツをプレビュー", }, + AutoScrollMessage: { + Title: "オートスクロール返信", + SubTitle: "返信中にメッセージをスクロール", + }, Mask: { Splash: { Title: "キャラクターページ", diff --git a/app/locales/ko.ts b/app/locales/ko.ts index 844459fc4ea..79348ff1d49 100644 --- a/app/locales/ko.ts +++ b/app/locales/ko.ts @@ -92,6 +92,10 @@ const ko: PartialLocaleType = { Title: "미리 보기 버블 전송", SubTitle: "버블에서 마크다운 미리 보기", }, + AutoScrollMessage: { + Title: "자동 스크롤 답장", + SubTitle: "답장하는 동안 메시지 스크롤", + }, Mask: { Splash: { Title: "마스크 시작 화면", diff --git a/app/locales/no.ts b/app/locales/no.ts index 3a0e61107a4..e4bbf6d502a 100644 --- a/app/locales/no.ts +++ b/app/locales/no.ts @@ -82,6 +82,10 @@ const no: PartialLocaleType = { SendKey: "Send nøkkel", Theme: "Tema", TightBorder: "Stram innramming", + AutoScrollMessage: { + Title: "Automatisk rulling av svar", + SubTitle: "Rull meldingen under svar", + }, Prompt: { Disable: { Title: "Skru av autofullfør", diff --git a/app/locales/pt.ts b/app/locales/pt.ts index 85226ed507d..95cba38d86f 100644 --- a/app/locales/pt.ts +++ b/app/locales/pt.ts @@ -177,6 +177,10 @@ const pt: PartialLocaleType = { Title: "Bolha de Pré-visualização de Envio", SubTitle: "Pré-visualizar markdown na bolha", }, + AutoScrollMessage: { + Title: "Resposta de rolagem automática", + SubTitle: "Rolar a mensagem enquanto responde", + }, AutoGenerateTitle: { Title: "Gerar Título Automaticamente", SubTitle: "Gerar um título adequado baseado no conteúdo da conversa", diff --git a/app/locales/ru.ts b/app/locales/ru.ts index d12cf3e4258..6530500a8f2 100644 --- a/app/locales/ru.ts +++ b/app/locales/ru.ts @@ -91,6 +91,10 @@ const ru: PartialLocaleType = { Title: "Отправить предпросмотр", SubTitle: "Предварительный просмотр markdown в пузыре", }, + AutoScrollMessage: { + Title: "Автопрокрутка ответа", + SubTitle: "Прокрутка сообщения во время ответа", + }, Mask: { Splash: { Title: "Экран заставки маски", diff --git a/app/locales/sk.ts b/app/locales/sk.ts index 025519e775b..62a869c9caa 100644 --- a/app/locales/sk.ts +++ b/app/locales/sk.ts @@ -179,6 +179,10 @@ const sk: PartialLocaleType = { Title: "Bublina náhľadu odoslania", SubTitle: "Náhľad markdownu v bubline", }, + AutoScrollMessage: { + Title: "Odpoveď s automatickým posúvaním", + SubTitle: "Posúvať správu počas odpovedania", + }, AutoGenerateTitle: { Title: "Automaticky generovať názov", SubTitle: "Generovať vhodný názov na základe obsahu konverzácie", diff --git a/app/locales/tr.ts b/app/locales/tr.ts index 524c1b2c546..50f3b5e298d 100644 --- a/app/locales/tr.ts +++ b/app/locales/tr.ts @@ -91,6 +91,10 @@ const tr: PartialLocaleType = { Title: "Mesaj Önizleme Balonu", SubTitle: "Preview markdown in bubble", }, + AutoScrollMessage: { + Title: "Otomatik Kaydırma Yanıtı", + SubTitle: "Yanıt verirken mesajı kaydır", + }, Mask: { Splash: { Title: "Mask Splash Screen", diff --git a/app/locales/tw.ts b/app/locales/tw.ts index af47e30ff71..17e4ba64c5a 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -88,6 +88,10 @@ const tw: PartialLocaleType = { Title: "預覽氣泡", SubTitle: "在預覽氣泡中預覽 Markdown 內容", }, + AutoScrollMessage: { + Title: "自動滾動回覆", + SubTitle: "回覆時滾動訊息", + }, Mask: { Splash: { Title: "面具啟動頁面", diff --git a/app/locales/vi.ts b/app/locales/vi.ts index 3d95b566497..ef91ef4ef7c 100644 --- a/app/locales/vi.ts +++ b/app/locales/vi.ts @@ -91,6 +91,10 @@ const vi: PartialLocaleType = { Title: "Gửi bong bóng xem trước", SubTitle: "Xem trước nội dung markdown bằng bong bóng", }, + AutoScrollMessage: { + Title: "Trả lời Tự động Cuộn", + SubTitle: "Cuộn tin nhắn khi trả lời", + }, Mask: { Splash: { Title: "Mask Splash Screen", diff --git a/app/store/config.ts b/app/store/config.ts index 20bf664df56..8418943d028 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -34,6 +34,7 @@ export const DEFAULT_CONFIG = { theme: Theme.Auto as Theme, tightBorder: !!getClientConfig()?.isApp, sendPreviewBubble: true, + autoScrollMessage: true, enableAutoGenerateTitle: true, sidebarWidth: DEFAULT_SIDEBAR_WIDTH,