Skip to content

feat(desktop): add UI scale setting to appearance settings (salvage #60249) - #60457

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-c66aab38
Jul 7, 2026
Merged

feat(desktop): add UI scale setting to appearance settings (salvage #60249)#60457
teknium1 merged 2 commits into
mainfrom
hermes/hermes-c66aab38

Conversation

@teknium1

@teknium1 teknium1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a "UI Scale" row to the desktop app's Settings > Appearance so the whole interface can be resized without knowing the Ctrl/Cmd zoom shortcuts — an accessibility win for low-vision users.

Salvage of #60249 by @Adolanium onto current main, with his authorship preserved via cherry-pick. Fixes #60248.

Changes

  • apps/desktop/electron/zoom.cjs: pure zoom helpers (clampZoomLevel, percent ↔ zoom-level conversion, storage key) extracted from main.cjs so the menu, shortcuts, and settings UI share one clamped scale.
  • apps/desktop/electron/main.cjs: hermes:zoom:get / hermes:zoom:set-percent IPC endpoints (scoped to the asking window) + a hermes:zoom:changed broadcast from setAndPersistZoomLevel so an open settings dialog live-follows keyboard zoom.
  • apps/desktop/electron/preload.cjs + src/global.d.ts: hermesDesktop.zoom bridge.
  • apps/desktop/src/store/zoom.ts: nanostore mirroring the current percent.
  • apps/desktop/src/app/settings/appearance-settings.tsx: UI Scale segmented control (90–175% presets) between Theme and Window Translucency. Values between presets (shortcut-only) highlight nothing; the description always shows the exact percent.
  • i18n: uiScaleTitle / uiScaleDesc in en, ja, zh, zh-hant + types.
  • Tests: electron/zoom.test.cjs (7 tests), registered in test:desktop:platforms.
  • Follow-up commit (ours): dropped the two PR screenshot PNGs the original committed into apps/desktop/pr-assets/.

Validation

Check Result
node --test electron/zoom.test.cjs 7/7 pass
npm run typecheck (apps/desktop) clean
Base staleness vs origin/main 0 commits behind

Related PRs

Duplicate cluster addressed by this salvage: #40868 (@liuhao1024, Jun 6), #47034 (@dongseok0, Jun 16), #49902 (@namredips, Jun 21) each proposed an Appearance-settings scale control earlier — credit to all three for identifying the gap; this implementation was chosen as the cleanest (single main-process-owned scale, live shortcut sync, unit tests).

Infographic

UI Scale in Appearance Settings

@teknium1
teknium1 requested a review from a team July 7, 2026 19:46
@teknium1
teknium1 merged commit ee66ff2 into main Jul 7, 2026
22 checks passed
@teknium1
teknium1 deleted the hermes/hermes-c66aab38 branch July 7, 2026 20:04
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add a UI scale control to desktop settings

3 participants