From 57dc81d39c67d97a47d9ac62cc2067ff4bfd92f4 Mon Sep 17 00:00:00 2001 From: EricYangXD Date: Wed, 5 Apr 2023 18:50:55 +0800 Subject: [PATCH 01/11] feat:personal changes --- app/constant.ts | 4 ++-- app/locales/index.ts | 24 +++++++++++++----------- app/store/app.ts | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/constant.ts b/app/constant.ts index 169a5eee52a..ca27851242f 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -1,5 +1,5 @@ -export const OWNER = "Yidadaa"; -export const REPO = "ChatGPT-Next-Web"; +export const OWNER = "EricYangXD"; +export const REPO = "ChatGPT-Next"; export const REPO_URL = `https://github.com/${OWNER}/${REPO}`; export const ISSUE_URL = `https://github.com/${OWNER}/${REPO}/issues`; export const UPDATE_URL = `${REPO_URL}#%E4%BF%9D%E6%8C%81%E6%9B%B4%E6%96%B0-keep-updated`; diff --git a/app/locales/index.ts b/app/locales/index.ts index 5c41eeb77f9..b93700c02f9 100644 --- a/app/locales/index.ts +++ b/app/locales/index.ts @@ -42,17 +42,19 @@ export function getLang(): Lang { const lang = getLanguage(); - if (lang.includes("zh") || lang.includes("cn")) { - return "cn"; - } else if (lang.includes("tw")) { - return "tw"; - } else if (lang.includes("es")) { - return "es"; - } else if (lang.includes("it")) { - return "it"; - } else { - return "en"; - } + // if (lang.includes("zh") || lang.includes("cn")) { + // return "cn"; + // } else if (lang.includes("tw")) { + // return "tw"; + // } else if (lang.includes("es")) { + // return "es"; + // } else if (lang.includes("it")) { + // return "it"; + // } else { + // return "en"; + // } + + return "en"; } export function changeLang(lang: Lang) { diff --git a/app/store/app.ts b/app/store/app.ts index d01e3cdd589..ea048e62b5a 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -123,8 +123,8 @@ const DEFAULT_CONFIG: ChatConfig = { historyMessageCount: 4, compressMessageLengthThreshold: 1000, sendBotMessages: true as boolean, - submitKey: SubmitKey.CtrlEnter as SubmitKey, - avatar: "1f603", + submitKey: SubmitKey.Enter as SubmitKey, + avatar: "1F92B", fontSize: 14, theme: Theme.Auto as Theme, tightBorder: false, From 88fcbf3576cbf920aa0def978a077667e40dfe8d Mon Sep 17 00:00:00 2001 From: EricYangXD Date: Wed, 5 Apr 2023 19:00:38 +0800 Subject: [PATCH 02/11] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 40386a0053f..d6582664317 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# attention please + +This project is forked from [ChatGPT-Next-Web](https://github.com/Yidadaa/ChatGPT-Next-Web), and changed somewhere as personal like, thanks to [Yidadaa](https://github.com/Yidadaa) and some other developers' hard working and finally I have my own ChatGPT assistant now. Also, I should thank [Vercel](https://vercel.com/), Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration. Thanks again. +
预览 From 7f2d309f891b26185f05c3365f5f38cf06b4ed6f Mon Sep 17 00:00:00 2001 From: EricYangXD Date: Wed, 5 Apr 2023 23:19:15 +0800 Subject: [PATCH 03/11] Update app.ts --- app/store/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/app.ts b/app/store/app.ts index ea048e62b5a..6ebe6f285f3 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -124,7 +124,7 @@ const DEFAULT_CONFIG: ChatConfig = { compressMessageLengthThreshold: 1000, sendBotMessages: true as boolean, submitKey: SubmitKey.Enter as SubmitKey, - avatar: "1F92B", + avatar: "1f92b", fontSize: 14, theme: Theme.Auto as Theme, tightBorder: false, From dc66753c3623fdff780bdf184d9f6c9302f0358d Mon Sep 17 00:00:00 2001 From: "eric.yang" Date: Fri, 7 Apr 2023 14:00:42 +0800 Subject: [PATCH 04/11] feat: add copy function in user's chatbox & adjust styles --- app/components/chat.tsx | 11 +++++++ app/components/home.module.scss | 53 +++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index dabe103c12d..88e853c4bbc 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -648,6 +648,17 @@ export function Chat(props: {
)} + {isUser && + !(message.preview || message.content.length === 0) && ( +
+
copyToClipboard(message.content)} + > + {Locale.Chat.Actions.Copy} +
+
+ )} {!isUser && !message.preview && (
diff --git a/app/components/home.module.scss b/app/components/home.module.scss index abef999a5ba..bcf2d777b75 100644 --- a/app/components/home.module.scss +++ b/app/components/home.module.scss @@ -2,22 +2,23 @@ @import "../styles/animation.scss"; @mixin container { - background-color: var(--white); border: var(--border-in-light); - border-radius: 20px; + border-radius: 4px; box-shadow: var(--shadow); color: var(--black); - background-color: var(--white); - min-width: 600px; - min-height: 480px; - max-width: 900px; - + background: #c7edcc; //rgb(199,237,204);//#7c9d42;// var(--white); + min-width: 800px; + min-height: 600px; + //max-width: 90%; display: flex; overflow: hidden; box-sizing: border-box; - width: var(--window-width); height: var(--window-height); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + -o-border-radius: 4px; } .container { @@ -44,7 +45,7 @@ width: var(--sidebar-width); box-sizing: border-box; padding: 20px; - background-color: var(--second); + background: var(--second); display: flex; flex-direction: column; box-shadow: inset -2px 0px 2px 0px rgb(0, 0, 0, 0.05); @@ -227,6 +228,7 @@ .chat-message-user { display: flex; flex-direction: row-reverse; + position: relative; } .chat-message-container { @@ -247,6 +249,39 @@ .chat-message-user > .chat-message-container { align-items: flex-end; + .chat-message-top-actions-user { + display: flex; + position: absolute; + right: 0px; + bottom: -26px; + transition: all ease 0.3s; + font-size: 12px; + opacity: 0; + pointer-events: none; + flex-direction: row-reverse; + .chat-message-top-actions { + opacity: 0.5; + color: var(--black); + white-space: nowrap; + left: unset; + right: 10px; + cursor: pointer; + &:hover { + opacity: 1; + } + &:not(:first-child) { + margin-right: 10px; + } + } + &:hover { + opacity: 1; + } + } + &:hover { + .chat-message-top-actions-user{ + opacity: 1; + } + } } .chat-message-avatar { From 1fbfe26e9070b9be3d8083ad8f4365879dd03fd8 Mon Sep 17 00:00:00 2001 From: "eric.yang" Date: Mon, 15 May 2023 17:22:22 +0800 Subject: [PATCH 05/11] fix: the name DEFAULT_CONFIG is defined multiple times --- app/store/chat.ts | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index 598ccf61870..66c049fe3cb 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -98,28 +98,6 @@ export const ModalConfigValidator = { }, }; -const DEFAULT_CONFIG: ChatConfig = { - historyMessageCount: 4, - compressMessageLengthThreshold: 1000, - sendBotMessages: true as boolean, - submitKey: SubmitKey.Enter as SubmitKey, - avatar: "1f92b", - fontSize: 14, - theme: Theme.Auto as Theme, - tightBorder: false, - sendPreviewBubble: true, - sidebarWidth: 300, - - disablePromptHint: false, - - modelConfig: { - model: "gpt-3.5-turbo", - temperature: 1, - max_tokens: 2000, - presence_penalty: 0, - }, -}; - export interface ChatStat { tokenCount: number; wordCount: number; From d98945b776fd3b8bb9c0ce398ddf85e9fe1be34f Mon Sep 17 00:00:00 2001 From: "eric.yang" Date: Tue, 23 May 2023 11:10:42 +0800 Subject: [PATCH 06/11] style: adjust .chat-body css --- app/components/home.module.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/home.module.scss b/app/components/home.module.scss index 74f0538c2af..217ccbdd05a 100644 --- a/app/components/home.module.scss +++ b/app/components/home.module.scss @@ -332,9 +332,9 @@ .chat-body { flex: 1; - overflow: auto; + overflow-x: hidden; + overflow-y: scroll; padding: 20px; - padding-bottom: 40px; position: relative; overscroll-behavior: none; } From f22395aa40a896450e65c8eb42fbecafff5d0ecb Mon Sep 17 00:00:00 2001 From: "eric.yang" Date: Fri, 26 May 2023 13:00:30 +0800 Subject: [PATCH 07/11] feat: use meta/command + enter as default to chat --- app/store/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/config.ts b/app/store/config.ts index 6802a402ba1..13356e98163 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -17,7 +17,7 @@ export enum Theme { } export const DEFAULT_CONFIG = { - submitKey: SubmitKey.CtrlEnter as SubmitKey, + submitKey: SubmitKey.MetaEnter as SubmitKey, avatar: "1f603", fontSize: 14, theme: Theme.Auto as Theme, From dbaab459ff0fc6685666b2df5c4354abb381f3f7 Mon Sep 17 00:00:00 2001 From: "eric.yang" Date: Wed, 14 Jun 2023 17:16:28 +0800 Subject: [PATCH 08/11] feat: add title and revert changes --- app/components/chat.tsx | 11 --------- app/components/home.module.scss | 41 --------------------------------- app/components/new-chat.tsx | 7 +++++- app/store/config.ts | 2 +- 4 files changed, 7 insertions(+), 54 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 18b2bb71e5c..d0916201fc1 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -878,17 +878,6 @@ export function Chat() {
)}
- {isUser && - !(message.preview || message.content.length === 0) && ( -
-
copyToClipboard(message.content)} - > - {Locale.Chat.Actions.Copy} -
-
- )} {!isUser && !message.preview && (
diff --git a/app/components/home.module.scss b/app/components/home.module.scss index 2e90cf503ff..4d655c21b54 100644 --- a/app/components/home.module.scss +++ b/app/components/home.module.scss @@ -6,7 +6,6 @@ background: #c7edcc; //rgb(199,237,204);//#7c9d42;// var(--white); min-width: 800px; min-height: 600px; - //max-width: 90%; display: flex; overflow: hidden; box-sizing: border-box; @@ -27,12 +26,9 @@ --window-width: 100vw; --window-height: var(--full-height); --window-content-width: calc(100% - var(--sidebar-width)); - @include container(); - max-width: 100vw; max-height: var(--full-height); - border-radius: 0; border: 0; } @@ -377,43 +373,6 @@ } } -.chat-message-user > .chat-message-container { - align-items: flex-end; - .chat-message-top-actions-user { - display: flex; - position: absolute; - right: 0px; - bottom: -26px; - transition: all ease 0.3s; - font-size: 12px; - opacity: 0; - pointer-events: none; - flex-direction: row-reverse; - .chat-message-top-actions { - opacity: 0.5; - color: var(--black); - white-space: nowrap; - left: unset; - right: 10px; - cursor: pointer; - &:hover { - opacity: 1; - } - &:not(:first-child) { - margin-right: 10px; - } - } - &:hover { - opacity: 1; - } - } - &:hover { - .chat-message-top-actions-user{ - opacity: 1; - } - } -} - .chat-message-avatar { margin-top: 20px; } diff --git a/app/components/new-chat.tsx b/app/components/new-chat.tsx index 30041c5c17e..b37357040d7 100644 --- a/app/components/new-chat.tsx +++ b/app/components/new-chat.tsx @@ -30,7 +30,12 @@ function MaskItem(props: { mask: Mask; onClick?: () => void }) { return (
-
{props.mask.name}
+
+ {props.mask.name} +
); } diff --git a/app/store/config.ts b/app/store/config.ts index 7b71d3fcfdf..6c654ebe9e0 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -132,7 +132,7 @@ export function limitNumber( export function limitModel(name: string) { return ALL_MODELS.some((m) => m.name === name && m.available) ? name - : "gpt-3.5-turbo"; + : "gpt-3.5-turbo-0613"; } export const ModalConfigValidator = { From 3de0ed39e933a576508fcd4bbd10fa7f0d1f9ab9 Mon Sep 17 00:00:00 2001 From: "eric.yang" Date: Wed, 5 Jul 2023 12:48:55 +0800 Subject: [PATCH 09/11] bugfix --- app/client/api.ts | 2 +- app/constant.ts | 48 +++++++++++++++++++++++------------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/client/api.ts b/app/client/api.ts index 08c4bb92ac4..6a8fb266f07 100644 --- a/app/client/api.ts +++ b/app/client/api.ts @@ -6,7 +6,7 @@ import { ChatGPTApi } from "./platforms/openai"; export const ROLES = ["system", "user", "assistant"] as const; export type MessageRole = (typeof ROLES)[number]; -export const Models = ["gpt-3.5-turbo", "gpt-4"] as const; +export const Models = ["gpt-3.5-turbo"] as const; export type ChatModel = ModelType; export interface RequestMessage { diff --git a/app/constant.ts b/app/constant.ts index 465e2d48710..efdb5e85ce2 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -64,30 +64,30 @@ Current model: {{model}} Current time: {{time}}`; export const DEFAULT_MODELS = [ - { - name: "gpt-4", - available: false, - }, - { - name: "gpt-4-0314", - available: false, - }, - { - name: "gpt-4-0613", - available: false, - }, - { - name: "gpt-4-32k", - available: false, - }, - { - name: "gpt-4-32k-0314", - available: false, - }, - { - name: "gpt-4-32k-0613", - available: false, - }, + // { + // name: "gpt-4", + // available: false, + // }, + // { + // name: "gpt-4-0314", + // available: false, + // }, + // { + // name: "gpt-4-0613", + // available: false, + // }, + // { + // name: "gpt-4-32k", + // available: false, + // }, + // { + // name: "gpt-4-32k-0314", + // available: false, + // }, + // { + // name: "gpt-4-32k-0613", + // available: false, + // }, { name: "gpt-3.5-turbo", available: true, From fa939d7b3ea7f693b3303c83e55249df6df97575 Mon Sep 17 00:00:00 2001 From: EricYangXD Date: Fri, 12 Jan 2024 11:58:14 +0800 Subject: [PATCH 10/11] Update new-chat.tsx --- app/components/new-chat.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/components/new-chat.tsx b/app/components/new-chat.tsx index 67bdfc6dc78..12304465e1b 100644 --- a/app/components/new-chat.tsx +++ b/app/components/new-chat.tsx @@ -21,15 +21,13 @@ function MaskItem(props: { mask: Mask; onClick?: () => void }) { return (
- +
*/} Date: Thu, 20 Jun 2024 09:39:17 +0800 Subject: [PATCH 11/11] fix isMacOS --- app/store/config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/store/config.ts b/app/store/config.ts index 2899839b186..ec73943d310 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -7,6 +7,7 @@ import { StoreKey, } from "../constant"; import { createPersistStore } from "../utils/store"; +import { isMacOS } from "../utils"; export type ModelType = (typeof DEFAULT_MODELS)[number]["name"];