From be4144fab32b340595efb9a005841716e9920103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AB=E3=82=99=E3=82=AA=E3=82=AB=E3=82=99=E3=82=AA?= Date: Tue, 4 Apr 2023 05:37:35 +0800 Subject: [PATCH 1/3] [opt] Optimize the display of exported chat history content. --- app/components/chat.tsx | 4 +++- app/locales/cn.ts | 2 ++ app/locales/en.ts | 2 ++ app/locales/es.ts | 2 ++ app/locales/it.ts | 2 ++ app/locales/tw.ts | 2 ++ 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 7aa8bfec6..6cd229cc3 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -60,7 +60,9 @@ function exportMessages(messages: Message[], topic: string) { `# ${topic}\n\n` + messages .map((m) => { - return m.role === "user" ? `## ${m.content}` : m.content.trim(); + return m.role === "user" + ? `## ${Locale.Export.MessageFromYou}:\n${m.content}` + : `## ${Locale.Export.MessageFromChatGPT}:\n${m.content.trim()}`; }) .join("\n\n"); const filename = `${topic}.md`; diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 49bcce235..11e9d044f 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -33,6 +33,8 @@ const cn = { Title: "导出聊天记录为 Markdown", Copy: "全部复制", Download: "下载文件", + MessageFromYou: "来自你的消息", + MessageFromChatGPT: "来自 ChatGPT 的消息", }, Memory: { Title: "历史记忆", diff --git a/app/locales/en.ts b/app/locales/en.ts index ae8e88c2d..af8201503 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -35,6 +35,8 @@ const en: LocaleType = { Title: "All Messages", Copy: "Copy All", Download: "Download", + MessageFromYou: "Message From You", + MessageFromChatGPT: "Message From ChatGPT", }, Memory: { Title: "Memory Prompt", diff --git a/app/locales/es.ts b/app/locales/es.ts index f3714ef3b..5c73b608b 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -35,6 +35,8 @@ const es: LocaleType = { Title: "Todos los mensajes", Copy: "Copiar todo", Download: "Descargar", + MessageFromYou: "Mensaje de ti", + MessageFromChatGPT: "Mensaje de ChatGPT", }, Memory: { Title: "Historial de memoria", diff --git a/app/locales/it.ts b/app/locales/it.ts index c4736c1e0..ce87796d1 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -35,6 +35,8 @@ const it: LocaleType = { Title: "Tutti i messaggi", Copy: "Copia tutto", Download: "Scarica", + MessageFromYou: "Messaggio da te", + MessageFromChatGPT: "Messaggio da ChatGPT", }, Memory: { Title: "Prompt di memoria", diff --git a/app/locales/tw.ts b/app/locales/tw.ts index fff2f15dc..b33ace2f6 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -34,6 +34,8 @@ const tw: LocaleType = { Title: "匯出聊天記錄為 Markdown", Copy: "複製全部", Download: "下載檔案", + MessageFromYou: "來自你的訊息", + MessageFromChatGPT: "來自 ChatGPT 的訊息", }, Memory: { Title: "上下文記憶 Prompt", From 0508b0080f845862140e395a479058d66e452fb0 Mon Sep 17 00:00:00 2001 From: kakawanyifan Date: Tue, 4 Apr 2023 16:33:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?linkTarget=3D{'=5Fblank'}=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E5=AF=B9=E4=BA=8E=E5=AF=B9=E8=AF=9D=E6=A1=86=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E9=93=BE=E6=8E=A5=EF=BC=8C=E4=BC=9A=E5=9C=A8=E6=96=B0?= =?UTF-8?q?=E7=9A=84tab=E9=A1=B5=E6=89=93=E5=BC=80=EF=BC=8C=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=E6=9B=B4=E5=A5=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/markdown.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 88e0f66f7..25991d742 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -67,6 +67,7 @@ export function Markdown(props: { content: string }) { components={{ pre: PreCode, }} + linkTarget={'_blank'} > {props.content} From 8ba1dedcea3c53c13fe52963f3c73b3e8942a9c8 Mon Sep 17 00:00:00 2001 From: MaYuKe Date: Tue, 4 Apr 2023 23:32:19 +0800 Subject: [PATCH 3/3] Update settings.tsx Update parameter `step` of historyMessageCount to 1. --- app/components/settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 4645f3191..02c4415d7 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -417,7 +417,7 @@ export function Settings(props: { closeSettings: () => void }) { value={config.historyMessageCount} min="0" max="25" - step="2" + step="1" onChange={(e) => updateConfig( (config) =>