This commit is contained in:
TactfulBean 2023-03-30 15:01:37 +08:00
parent 0c872090e3
commit 5193df86ae
6 changed files with 5222 additions and 7657 deletions

View File

@ -102,7 +102,7 @@ export function ChatList() {
state.currentSessionIndex,
state.selectSession,
state.removeSession,
]
],
);
return (
@ -196,7 +196,7 @@ export function Chat(props: {
setPromptHints(promptStore.search(text));
},
100,
{ leading: true, trailing: true }
{ leading: true, trailing: true },
);
const onPromptSelect = (prompt: Prompt) => {
@ -210,7 +210,7 @@ export function Chat(props: {
if (!dom) return;
const paddingBottomNum: number = parseInt(
window.getComputedStyle(dom).paddingBottom,
10
10,
);
dom.scrollTop = dom.scrollHeight - dom.offsetHeight + paddingBottomNum;
};
@ -300,7 +300,7 @@ export function Chat(props: {
preview: true,
},
]
: []
: [],
)
.concat(
userInput.length > 0
@ -312,7 +312,7 @@ export function Chat(props: {
preview: true,
},
]
: []
: [],
);
// auto scroll
@ -340,7 +340,7 @@ export function Chat(props: {
const newTopic = prompt(Locale.Chat.Rename, session.topic);
if (newTopic && newTopic !== session.topic) {
chatStore.updateCurrentSession(
(session) => (session.topic = newTopic!)
(session) => (session.topic = newTopic!),
);
}
}}
@ -585,7 +585,7 @@ export function Home() {
state.newSession,
state.currentSessionIndex,
state.removeSession,
]
],
);
const loading = !useHasHydrated();
const [showSideBar, setShowSideBar] = useState(true);
@ -612,7 +612,15 @@ export function Home() {
<div className={styles["sidebar-header"]}>
<div className={styles["sidebar-title"]}>ChatGPT Next</div>
<div className={styles["sidebar-sub-title"]}>
Build your own AI assistant.
<a href="https://vercel.com/">
<img src="https://img.shields.io/badge/Vercel-000000?logo=Vercel" />
</a>
<a href="https://github.com/Yidadaa/ChatGPT-Next-Web/stars">
<img src="https://img.shields.io/github/stars/Yidadaa/ChatGPT-Next-Web?logo=github" />
</a>
<a href="https://github.com/Yidadaa/ChatGPT-Next-Web/fork">
<img src="https://img.shields.io/github/forks/Yidadaa/ChatGPT-Next-Web?logo=github" />
</a>
</div>
<div className={styles["sidebar-logo"]}>
<ChatGptIcon />

View File

@ -320,7 +320,7 @@ export function Settings(props: { closeSettings: () => void }) {
>
<input
value={accessStore.accessCode}
type="password"
type="text"
placeholder={Locale.Settings.AccessCode.Placeholder}
onChange={(e) => {
accessStore.updateCode(e.currentTarget.value);

View File

@ -1,5 +1,6 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import isMobile from "is-mobile";
import { type ChatCompletionResponseMessage } from "openai";
import {
@ -117,6 +118,11 @@ export function filterConfig(config: ModelConfig): Partial<ModelConfig> {
return config;
}
let TIGHTBORDER = true;
if (isMobile()) {
TIGHTBORDER = false;
}
const DEFAULT_CONFIG: ChatConfig = {
historyMessageCount: 4,
compressMessageLengthThreshold: 1000,
@ -125,7 +131,7 @@ const DEFAULT_CONFIG: ChatConfig = {
avatar: "1f603",
fontSize: 14,
theme: Theme.Auto as Theme,
tightBorder: false,
tightBorder: TIGHTBORDER,
disablePromptHint: false,

View File

@ -174,7 +174,6 @@ input[type="range"]::-webkit-slider-thumb:hover {
width: 24px;
}
input[type="password"],
input[type="number"],
input[type="text"] {
appearance: none;
@ -247,3 +246,10 @@ pre {
}
}
}
@font-face {
font-family: "ZhuZiAWan";
src: url("https://npm.elemecdn.com/anzhiyu-blog@2.0.4/fonts/ZhuZiAWan.woff2");
}
* {
font-family: ZhuZiAWan;
}

View File

@ -17,6 +17,7 @@
"emoji-picker-react": "^4.4.7",
"eventsource-parser": "^0.1.0",
"fuse.js": "^6.6.2",
"is-mobile": "^4.0.0",
"next": "^13.2.3",
"node-fetch": "^3.3.1",
"openai": "^3.2.1",

12836
yarn.lock

File diff suppressed because it is too large Load Diff