diff --git a/app/components/home.tsx b/app/components/home.tsx index 828ee191634..d25b5f5cb0d 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -178,6 +178,7 @@ export function Chat(props: { showSideBar?: () => void }) { state.currentSession(), state.currentSessionIndex, ]); + const fontSize = useChatStore((state) => state.config.fontSize); const inputRef = useRef(null); const [userInput, setUserInput] = useState(""); @@ -406,6 +407,7 @@ export function Chat(props: { showSideBar?: () => void }) { ) : (
onRightClick(e, message)} > diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 2eb8a066572..44a67dd56d4 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -226,6 +226,26 @@ export function Settings(props: { closeSettings: () => void }) { + + + updateConfig( + (config) => + (config.fontSize = Number.parseInt(e.currentTarget.value)) + ) + } + > + +
`当前版本:${x}`, IsLatest: "已是最新版本", diff --git a/app/locales/en.ts b/app/locales/en.ts index 8eb379c2b13..8d0701fabb2 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -55,6 +55,10 @@ const en: LocaleType = { }, }, Avatar: "Avatar", + FontSize: { + Title: "Font Size", + SubTitle: "Adjust font size of chat content", + }, Update: { Version: (x: string) => `Version: ${x}`, IsLatest: "Latest version", diff --git a/app/locales/tw.ts b/app/locales/tw.ts index 65145d898cf..58c077e1d6b 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -53,6 +53,10 @@ const tw: LocaleType = { }, }, Avatar: "大頭貼", + FontSize: { + Title: "字型大小", + SubTitle: "聊天內容的字型大小", + }, Update: { Version: (x: string) => `當前版本:${x}`, IsLatest: "已是最新版本", diff --git a/app/store/app.ts b/app/store/app.ts index 6759afb807b..8a978c0a470 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -31,12 +31,12 @@ export enum Theme { } export interface ChatConfig { - maxToken?: number; historyMessageCount: number; // -1 means all compressMessageLengthThreshold: number; sendBotMessages: boolean; // send bot's message or not submitKey: SubmitKey; avatar: string; + fontSize: number; theme: Theme; tightBorder: boolean; @@ -123,6 +123,7 @@ const DEFAULT_CONFIG: ChatConfig = { sendBotMessages: true as boolean, submitKey: SubmitKey.CtrlEnter as SubmitKey, avatar: "1f603", + fontSize: 14, theme: Theme.Auto as Theme, tightBorder: false,