From f10d59061caae0c73157d301f681f9634d0414b6 Mon Sep 17 00:00:00 2001 From: chenzhen Date: Mon, 20 May 2024 16:22:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A8=A1=E5=9E=8B=E4=B8=8E=E9=A2=84=E8=AE=BE=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=90=8D=E9=87=8D=E5=A4=8D=E6=97=B6,=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E7=A1=AE=E5=B0=86=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=AE=A4=E5=AE=9A=E4=B8=BAopenai=E6=B8=A0?= =?UTF-8?q?=E9=81=93=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/model.ts b/app/utils/model.ts index 056fff2e98d..8267816649b 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -2,7 +2,7 @@ import { LLMModel } from "../client/api"; const customProvider = (modelName: string) => ({ id: modelName, - providerName: "", + providerName: "*OpenAI", providerType: "custom", }); @@ -49,7 +49,7 @@ export function collectModelTable( name, displayName: displayName || name, available, - provider: modelTable[name]?.provider ?? customProvider(name), // Use optional chaining + provider: customProvider(name), // Use optional chaining }; } }); From c5925ab95170a6e101ab2e8a9016c674c574f4bd Mon Sep 17 00:00:00 2001 From: chenzhen Date: Thu, 6 Jun 2024 15:11:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=B9=A0=E6=83=AF=E5=BE=AE=E8=B0=83=E4=B8=80=E4=B8=8BUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/chat.module.scss | 12 +++++- app/components/chat.tsx | 68 ++++++++++++++++++--------------- app/components/sidebar.tsx | 2 +- app/constant.ts | 4 +- 4 files changed, 51 insertions(+), 35 deletions(-) diff --git a/app/components/chat.module.scss b/app/components/chat.module.scss index e7619e92b89..10265fc4d27 100644 --- a/app/components/chat.module.scss +++ b/app/components/chat.module.scss @@ -87,6 +87,14 @@ } } + &[data-expanded="true"] { + width: var(--full-width) !important; /* 始终保持展开状态 */ + .text { + opacity: 1; + transform: translate(0); + } + } + .text, .icon { display: flex; @@ -458,7 +466,7 @@ width: $calc-image-width; height: $calc-image-width; } - + .chat-message-item-image { max-width: calc(100vw/3*2); } @@ -624,4 +632,4 @@ .chat-input-send { bottom: 30px; } -} \ No newline at end of file +} diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 06119250465..130ba4d0044 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -341,6 +341,7 @@ function ChatAction(props: { text: string; icon: JSX.Element; onClick: () => void; + isExpanded?: boolean; }) { const iconRef = useRef(null); const textRef = useRef(null); @@ -360,6 +361,9 @@ function ChatAction(props: { }); } + useEffect(() => { + updateWidth(); + }, [props.icon, props.text]); return (
{props.icon} @@ -520,21 +525,21 @@ export function ChatActions(props: { icon={props.uploading ? : } /> )} - - {theme === Theme.Auto ? ( - - ) : theme === Theme.Light ? ( - - ) : theme === Theme.Dark ? ( - - ) : null} - - } - /> + {/**/} + {/* {theme === Theme.Auto ? (*/} + {/* */} + {/* ) : theme === Theme.Light ? (*/} + {/* */} + {/* ) : theme === Theme.Dark ? (*/} + {/* */} + {/* ) : null}*/} + {/* */} + {/* }*/} + {/*/>*/} } - onClick={() => { - chatStore.updateCurrentSession((session) => { - if (session.clearContextIndex === session.messages.length) { - session.clearContextIndex = undefined; - } else { - session.clearContextIndex = session.messages.length; - session.memoryPrompt = ""; // will clear memory - } - }); - }} - /> - - setShowModelSelector(true)} text={currentModel} icon={} /> +
+ } + onClick={() => { + chatStore.updateCurrentSession((session) => { + if (session.clearContextIndex === session.messages.length) { + session.clearContextIndex = undefined; + } else { + session.clearContextIndex = session.messages.length; + session.memoryPrompt = ""; // will clear memory + } + }); + }} + /> +
{showModelSelector && (
- Build your own AI assistant. + Build your own AI assistant. (by chenzhen)
diff --git a/app/constant.ts b/app/constant.ts index 9f1d87161ae..97baf6e7073 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -1,4 +1,4 @@ -export const OWNER = "Yidadaa"; +export const OWNER = "imaiya"; export const REPO = "ChatGPT-Next-Web"; export const REPO_URL = `https://github.com/${OWNER}/${REPO}`; export const ISSUE_URL = `https://github.com/${OWNER}/${REPO}/issues`; @@ -149,7 +149,7 @@ const openaiModels = [ "gpt-4o", "gpt-4o-2024-05-13", "gpt-4-vision-preview", - "gpt-4-turbo-2024-04-09" + "gpt-4-turbo-2024-04-09", ]; const googleModels = [ From 3cd5418c78069733c49c7efc122eb0ca9ece3ccc Mon Sep 17 00:00:00 2001 From: chenzhen Date: Tue, 25 Jun 2024 19:07:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BB=A5=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=20-=20=E5=B0=86=20sendPreviewBubble=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=20false=EF=BC=8C=E4=BB=A5=E7=A6=81=E7=94=A8=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=B0=94=E6=B3=A1=E3=80=82=20-=20=E5=B0=86=20dontShow?= =?UTF-8?q?MaskSplashScreen=20=E8=AE=BE=E7=BD=AE=E4=B8=BA=20true=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E9=9A=90=E8=97=8F=E5=88=9B=E5=BB=BA=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E9=97=AA=E5=B1=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/store/config.ts b/app/store/config.ts index 94cfcd8ecaa..d79a10fd889 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -34,13 +34,13 @@ export const DEFAULT_CONFIG = { fontSize: 14, theme: Theme.Auto as Theme, tightBorder: !!config?.isApp, - sendPreviewBubble: true, + sendPreviewBubble: false, enableAutoGenerateTitle: true, sidebarWidth: DEFAULT_SIDEBAR_WIDTH, disablePromptHint: false, - dontShowMaskSplashScreen: false, // dont show splash screen when create chat + dontShowMaskSplashScreen: true, // dont show splash screen when create chat hideBuiltinMasks: false, // dont add builtin masks customModels: "",