mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat(frontend): add an app-wide font size preference
This commit is contained in:
1 parent
55f5864675
commit
f0fc5e6ed7
9 files changed
+99
-5
No files matched your search
@@ -4,6 +4,7 @@ import { MANAGER_COLOR_THEME_ID, OPENCODE_THEMES, isColorThemeId } from '@openco
|
||||
import { UserPreferencesSchema } from '@opencode-manager/shared/schemas'
|
||||
|
||||
const themePreferenceSchema = UserPreferencesSchema.pick({ theme: true })
|
||||
const fontSizePreferenceSchema = UserPreferencesSchema.pick({ fontSize: true })
|
||||
import { Loader2 } from 'lucide-react'
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
||||
@@ -106,6 +107,34 @@ export function GeneralSettings() {
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
|
||||
<div className="min-w-0 space-y-0.5">
|
||||
<Label htmlFor="fontSize">Font size</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Scale text and spacing across the app
|
||||
</p>
|
||||
</div>
|
||||
<Select
|
||||
value={preferences?.fontSize ?? 'medium'}
|
||||
onValueChange={(value) => {
|
||||
const parsedFontSize = fontSizePreferenceSchema.safeParse({ fontSize: value })
|
||||
if (parsedFontSize.success && parsedFontSize.data.fontSize) {
|
||||
updateSettings({ fontSize: parsedFontSize.data.fontSize })
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger id="fontSize" className="w-full shrink-0 sm:w-40">
|
||||
<SelectValue placeholder="Select a font size" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="small">Small</SelectItem>
|
||||
<SelectItem value="medium">Default</SelectItem>
|
||||
<SelectItem value="large">Large</SelectItem>
|
||||
<SelectItem value="xlarge">Extra large</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="divide-y divide-border">
|
||||
<div className="flex items-start justify-between gap-4 py-3">
|
||||
<div className="min-w-0 space-y-0.5">
|
||||
|
||||
Reference in new issue
Block a user