Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/renderer/components/InputBox/InputBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const InputBox = forwardRef<InputBoxRef, InputBoxProps>(
const { height: viewportHeight } = useViewportSize()
const pasteLongTextAsAFile = useSettingsStore((state) => state.pasteLongTextAsAFile)
const shortcuts = useSettingsStore((state) => state.shortcuts)
const inputBoxFontSize = useSettingsStore((state) => state.inputBoxFontSize)
const widthFull = useUIStore((s) => s.widthFull) || fullWidth
const saveBlob = useSaveBlob()

Expand Down Expand Up @@ -917,7 +918,7 @@ const InputBox = forwardRef<InputBoxRef, InputBoxProps>(
<Flex align="flex-end" gap={4}>
<Textarea
unstyled={true}
styles={{ input: { fontSize: 14 } }}
styles={{ input: { fontSize: inputBoxFontSize } }}
classNames={{
root: 'flex-1',
wrapper: 'flex-1',
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@
"Focus on the Input Box and Enter Web Browsing Mode": "Focus on the Input Box and Enter Web Browsing Mode",
"Follow System": "Follow System",
"Font Size": "Font Size",
"Chat Font Size": "Chat Font Size",
"Input Box Font Size": "Input Box Font Size",
"For general conversations, please click": "For general conversations, please click",
"Format": "Format",
"Free trial available": "Free trial available",
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/i18n/locales/zh-Hans/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@
"Focus on the Input Box and Enter Web Browsing Mode": "聚焦到输入框并进入联网问答模式",
"Follow System": "跟随系统",
"Font Size": "字体大小",
"Chat Font Size": "聊天字体大小",
"Input Box Font Size": "输入框字体大小",
"For general conversations, please click": "如需进行常规对话,请点击",
"Format": "格式",
"Free trial available": "免费试用Chatbox AI",
Expand Down
24 changes: 23 additions & 1 deletion src/renderer/routes/settings/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function RouteComponent() {

{/* Font Size */}
<Stack>
<Text>{t('Font Size')}</Text>
<Text>{t('Chat Font Size')}</Text>
<LazySlider
step={1}
min={10}
Expand All @@ -118,6 +118,28 @@ export function RouteComponent() {
/>
</Stack>

{/* Input Box Font Size */}
<Stack>
<Text>{t('Input Box Font Size')}</Text>
<LazySlider
step={1}
min={10}
max={22}
maw={320}
marks={[
{
value: 14,
},
]}
value={settings.inputBoxFontSize}
onChange={(val) =>
setSettings({
inputBoxFontSize: val,
})
}
/>
</Stack>

{/* Startup Page */}
<Stack>
<Text>{t('Startup Page')}</Text>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/stores/atoms/settingsAtoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const userAvatarKeyAtom = focusAtom(settingsAtom, (optic) => optic.prop('
export const defaultAssistantAvatarKeyAtom = focusAtom(settingsAtom, (optic) => optic.prop('defaultAssistantAvatarKey'))
export const themeAtom = focusAtom(settingsAtom, (optic) => optic.prop('theme'))
export const fontSizeAtom = focusAtom(settingsAtom, (optic) => optic.prop('fontSize'))
export const inputBoxFontSizeAtom = focusAtom(settingsAtom, (optic) => optic.prop('inputBoxFontSize'))
export const spellCheckAtom = focusAtom(settingsAtom, (optic) => optic.prop('spellCheck'))
export const allowReportingAndTrackingAtom = focusAtom(settingsAtom, (optic) => optic.prop('allowReportingAndTracking'))
export const enableMarkdownRenderingAtom = focusAtom(settingsAtom, (optic) => optic.prop('enableMarkdownRendering'))
Expand Down
1 change: 1 addition & 0 deletions src/shared/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export function settings(): Settings {
theme: Theme.System,
language: 'en',
fontSize: 14,
inputBoxFontSize: 14,
spellCheck: true,

defaultPrompt: getDefaultPrompt(),
Expand Down
1 change: 1 addition & 0 deletions src/shared/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export const SettingsSchema = GlobalSessionSettingsSchema.extend({
]),
languageInited: z.boolean().optional(),
fontSize: z.number().catch(14),
inputBoxFontSize: z.number().catch(14),
spellCheck: z.boolean().optional(),

startupPage: z.enum(['home', 'session']).optional(),
Expand Down