From 4d3fdbdd80777c516d11cfedb03f2e2776476d2a Mon Sep 17 00:00:00 2001 From: reece00 <37351410+reece00@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:35:51 +0800 Subject: [PATCH 1/4] The mobile terminal ishitbottom does not perform -10 --- app/components/chat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 9a9488dd2..dfda4055b 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -935,7 +935,7 @@ function _Chat() { const isTouchTopEdge = e.scrollTop <= edgeThreshold; const isTouchBottomEdge = bottomHeight >= e.scrollHeight - edgeThreshold; - const isHitBottom = bottomHeight >= e.scrollHeight - 10; + const isHitBottom = bottomHeight >= e.scrollHeight - (isMobileScreen ? 0 : 10); const prevPageMsgIndex = msgRenderIndex - CHAT_PAGE_SIZE; const nextPageMsgIndex = msgRenderIndex + CHAT_PAGE_SIZE; From 0113d4499b310b1e507ffb9738dd85585bd88336 Mon Sep 17 00:00:00 2001 From: B0zal Date: Wed, 23 Aug 2023 21:14:43 +0700 Subject: [PATCH 2/4] [Feature] Better JSON Exporter #2692 [+] A view looks better [+] auto minify json when click a copy in markdown and download Co-Authored-By: wangwentong-lunaon <39506652+wangwentong-lunaon@users.noreply.github.com> Co-Authored-By: Yifei Zhang Co-Authored-By: B0zal <48602426+kfear1337@users.noreply.github.com> --- app/components/exporter.tsx | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/app/components/exporter.tsx b/app/components/exporter.tsx index 604b8823d..2e3cd84aa 100644 --- a/app/components/exporter.tsx +++ b/app/components/exporter.tsx @@ -565,21 +565,32 @@ export function MarkdownPreviewer(props: { ); } +// modified by BackTrackZ now it's looks better + export function JsonPreviewer(props: { messages: ChatMessage[]; topic: string; }) { - const msgs = props.messages.map((m) => ({ - role: m.role, - content: m.content, - })); - const mdText = "\n" + JSON.stringify(msgs, null, 2) + "\n"; + const msgs = { + messages: [ + { + role: "system", + content: "You are an assistant that " + props.topic, + }, + ...props.messages.map((m) => ({ + role: m.role, + content: m.content, + })), + ], + }; + const mdText = "```json\n" + JSON.stringify(msgs, null, 2) + "\n```"; + const minifiedJson = JSON.stringify(msgs); const copy = () => { - copyToClipboard(JSON.stringify(msgs, null, 2)); + copyToClipboard(minifiedJson); }; const download = () => { - downloadAs(JSON.stringify(msgs, null, 2), `${props.topic}.json`); + downloadAs(JSON.stringify(msgs), `${props.topic}.json`); }; return ( @@ -587,12 +598,12 @@ export function JsonPreviewer(props: { -
-
{mdText}
+
+
); -} +} \ No newline at end of file From 8cac51abbefcb6e939f1190d50eb4b966680542a Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Thu, 24 Aug 2023 10:54:28 +0800 Subject: [PATCH 3/4] chore: #2699 Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e1f42e1a0..25801e643 100644 --- a/README.md +++ b/README.md @@ -230,8 +230,8 @@ yarn dev docker pull yidadaa/chatgpt-next-web docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="your-password" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=your-password \ yidadaa/chatgpt-next-web ``` @@ -239,9 +239,9 @@ You can start service behind a proxy: ```shell docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="your-password" \ - -e PROXY_URL="http://localhost:7890" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=your-password \ + -e PROXY_URL=http://localhost:7890 \ yidadaa/chatgpt-next-web ``` From d8b6ebf6cbcfcad7865f51e4a75e912a9aa87d8f Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Thu, 24 Aug 2023 11:09:17 +0800 Subject: [PATCH 4/4] fix: #2699 remove double quotes in readme --- README_CN.md | 10 +++++----- README_ES.md | 10 +++++----- README_JA.md | 10 +++++----- README_KO.md | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README_CN.md b/README_CN.md index 568cd229a..1111540e9 100644 --- a/README_CN.md +++ b/README_CN.md @@ -135,8 +135,8 @@ BASE_URL=https://chatgpt1.nextweb.fun/api/proxy docker pull yidadaa/chatgpt-next-web docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="页面访问密码" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=页面访问密码 \ yidadaa/chatgpt-next-web ``` @@ -144,10 +144,10 @@ docker run -d -p 3000:3000 \ ```shell docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="页面访问密码" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=页面访问密码 \ --net=host \ - -e PROXY_URL="http://127.0.0.1:7890" \ + -e PROXY_URL=http://127.0.0.1:7890 \ yidadaa/chatgpt-next-web ``` diff --git a/README_ES.md b/README_ES.md index 34e9678f9..a5787a996 100644 --- a/README_ES.md +++ b/README_ES.md @@ -130,8 +130,8 @@ Antes de empezar a escribir código, debe crear uno nuevo en la raíz del proyec docker pull yidadaa/chatgpt-next-web docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="页面访问密码" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=your-password \ yidadaa/chatgpt-next-web ``` @@ -139,10 +139,10 @@ También puede especificar proxy: ```shell docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="页面访问密码" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=your-password \ --net=host \ - -e PROXY_URL="http://127.0.0.1:7890" \ + -e PROXY_URL=http://127.0.0.1:7890 \ yidadaa/chatgpt-next-web ``` diff --git a/README_JA.md b/README_JA.md index 6018a1b01..72a0d5373 100644 --- a/README_JA.md +++ b/README_JA.md @@ -196,8 +196,8 @@ yarn dev docker pull yidadaa/chatgpt-next-web docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="your-password" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=your-password \ yidadaa/chatgpt-next-web ``` @@ -205,9 +205,9 @@ docker run -d -p 3000:3000 \ ```shell docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="your-password" \ - -e PROXY_URL="http://localhost:7890" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=your-password \ + -e PROXY_URL=http://localhost:7890 \ yidadaa/chatgpt-next-web ``` diff --git a/README_KO.md b/README_KO.md index 86fba5115..519dd9d9b 100644 --- a/README_KO.md +++ b/README_KO.md @@ -135,8 +135,8 @@ BASE_URL=https://chatgpt1.nextweb.fun/api/proxy docker pull yidadaa/chatgpt-next-web docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="페이지 접근 비밀번호" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=페이지 접근 비밀번호 \ yidadaa/chatgpt-next-web ``` @@ -144,10 +144,10 @@ docker run -d -p 3000:3000 \ ```shell docker run -d -p 3000:3000 \ - -e OPENAI_API_KEY="sk-xxxx" \ - -e CODE="페이지 접근 비밀번호" \ + -e OPENAI_API_KEY=sk-xxxx \ + -e CODE=페이지 접근 비밀번호 \ --net=host \ - -e PROXY_URL="http://127.0.0.1:7890" \ + -e PROXY_URL=http://127.0.0.1:7890 \ yidadaa/chatgpt-next-web ```