feat(desktop): add UI scale setting to appearance settings - #60249
Closed
Adolanium wants to merge 1 commit into
Closed
feat(desktop): add UI scale setting to appearance settings#60249Adolanium wants to merge 1 commit into
Adolanium wants to merge 1 commit into
Conversation
1 task
Contributor
|
Merged via PR #60457 with your commit cherry-picked onto current main — your authorship is preserved in git log. The only change on top was dropping the two screenshot PNGs from apps/desktop/pr-assets/ (we keep PR screenshots out of the tree; hotlinking from your fork branch in the PR body is perfect). Clean work — main-process-owned scale, live shortcut sync, and tests made this the pick of the cluster. Thanks! |
This was referenced Jul 7, 2026
This was referenced Jul 28, 2026
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.
What does this PR do?
Adds a UI Scale row to Settings > Appearance so the size of the whole interface can be changed without knowing the Cmd/Ctrl zoom shortcuts. The row offers preset percentages (90 to 175) and drives the exact same clamped zoom level as the existing shortcuts and View menu items, so the two paths can never disagree. Every zoom change is also broadcast back to the renderer, which means the highlighted preset follows along live when someone uses Ctrl and + while the settings dialog is open. A value that lands between presets (only reachable via the shortcuts) highlights nothing, and the row description always shows the exact current percent.
The motivation is accessibility. The zoom feature already existed and persisted across restarts, but nothing in the UI exposed it. People with low vision are exactly the users least likely to discover browser style keyboard shortcuts.
Default (100%):
After selecting 175%:
Related Issue
Fixes #40166
Fixes #47499
Fixes #48336
Fixes #53411
Fixes #60248
#40166 is the canonical request for a font size / zoom control in the desktop app. The others were triaged as the same cluster: #47499 (zoom and scale controls for high-DPI and vision needs), #48336 (no discoverable UI scaling), #53411 (larger fonts for seniors without changing the OS display scale), and #60248 (my report, filed before I found the canonical one).
Type of Change
Changes Made
apps/desktop/electron/zoom.cjs: the pure zoom helpers (clampZoomLevel, the storage key, percent to zoom level conversion) extracted frommain.cjsso the menu items, the keyboard shortcuts, and the settings UI all share one scale.apps/desktop/electron/main.cjs: two IPC endpoints (hermes:zoom:get,hermes:zoom:set-percent) that act on the window that asked, plus ahermes:zoom:changedbroadcast fromsetAndPersistZoomLevelso any open settings UI stays in sync with keyboard driven changes. The persistence and restore logic is untouched.apps/desktop/electron/preload.cjsandapps/desktop/src/global.d.ts: thehermesDesktop.zoombridge (get,setPercent,onChanged).apps/desktop/src/store/zoom.ts: a nanostore mirroring the current percent from the main process for the settings UI.apps/desktop/src/app/settings/appearance-settings.tsx: the UI Scale row, placed between Theme and Window Translucency.uiScaleTitleanduiScaleDescinen,ja,zh,zh-hantandtypes.ts. The preset labels are plain percentages and need no translation.apps/desktop/electron/zoom.test.cjs, registered in thetest:desktop:platformsscript.apps/desktop/pr-assets/.How to Test
Verified live in the dev app on Windows 11: preset clicks resize instantly, the keyboard shortcuts move the highlight while the dialog is open, and Ctrl with 0 resets to the 100% preset.
npm run typecheckandeslintpass on the touched files.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passNote on the pytest item: this change is desktop only and does not touch the Python side. The desktop checks pass (
node --test electron/zoom.test.cjs,npm run typecheck,eslinton the touched files).Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A