feat(desktop): add font-size preference to Appearance settings (#3938) - #4061
Open
iroiro147 wants to merge 1 commit into
Open
feat(desktop): add font-size preference to Appearance settings (#3938)#4061iroiro147 wants to merge 1 commit into
iroiro147 wants to merge 1 commit into
Conversation
…#3938) Adds a user-controllable font scale (85%-130% of default) to the Appearance settings panel, letting users improve readability on high-DPI or unusually-scaled displays. - fontScalePreference: useSyncExternalStore-backed preference store persisted in localStorage under buzz.ui.fontScale; exports typed clamps and presets - FontScaleApplier: mounted in main.tsx, applies the scale as a document root font-size multiplier (cascades into all rem units) - FontSizeSetting: settings card with +/- buttons plus range slider mirroring the ThreadLayoutSetting visual vocabulary - Tests: pin clamp, NaN handling, localStorage round-trip Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Buzz Desktop (Linux, Tauri) has no way to adjust the base font/text size in the chat view. High-DPI or unusually-scaled displays render the default size poorly, with no user-side workaround (#3938).
Fix
Adds an adjustable font-size preference to Settings → Appearance, persisted locally and applied globally as a document-root font-size multiplier:
shared/lib/fontScalePreference.ts—useSyncExternalStore-backed preference store persisted tolocalStorageunderbuzz.ui.fontScale. Clamps to 85%–130% with named presets; modeled directly onthreadViewModePreference.shared/ui/FontScaleApplier.tsx— mounted once inmain.tsxinsideThemeProvider; applies the scale asfont-size: ${scale * 16}pxon<html>, cascading into every rem-based token.features/settings/ui/FontSizeSetting.tsx— settings card with stepper buttons (+/-) plus a range slider, visually mirroringThreadLayoutSetting(sameSettingsOptionGroup/SettingsOptionRowvocabulary).localStorageround-trip.Test plan
pnpm typecheckcleanpnpm exec biome checkclean across all touched filesfontScalePreference.test.mjs(4 tests) pins clamp, NaN, persistence behaviorpnpm test— 3910 passing, no regressionsCloses #3938.