Skip to content

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

Closed
Adolanium wants to merge 1 commit into
NousResearch:mainfrom
Adolanium:feat/desktop-ui-scale-setting
Closed

feat(desktop): add UI scale setting to appearance settings#60249
Adolanium wants to merge 1 commit into
NousResearch:mainfrom
Adolanium:feat/desktop-ui-scale-setting

Conversation

@Adolanium

@Adolanium Adolanium commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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%):

UI Scale row at 100%

After selecting 175%:

UI Scale row at 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

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • New apps/desktop/electron/zoom.cjs: the pure zoom helpers (clampZoomLevel, the storage key, percent to zoom level conversion) extracted from main.cjs so 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 a hermes:zoom:changed broadcast from setAndPersistZoomLevel so any open settings UI stays in sync with keyboard driven changes. The persistence and restore logic is untouched.
  • apps/desktop/electron/preload.cjs and apps/desktop/src/global.d.ts: the hermesDesktop.zoom bridge (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.
  • i18n: uiScaleTitle and uiScaleDesc in en, ja, zh, zh-hant and types.ts. The preset labels are plain percentages and need no translation.
  • Tests: apps/desktop/electron/zoom.test.cjs, registered in the test:desktop:platforms script.
  • Screenshots in apps/desktop/pr-assets/.

How to Test

  1. Run the desktop app in dev mode, open Settings > Appearance.
  2. Click through the UI Scale presets. The whole app resizes immediately and the row description shows the current percent.
  3. With the dialog still open, press Ctrl (Cmd on macOS) with + or - a few times. The highlight follows the value when it matches a preset and clears when it lands in between. Ctrl with 0 returns to 100% and the highlight snaps back to the 100% preset.
  4. Restart the app. The chosen scale is restored through the same localStorage path the shortcuts have always used.
  5. Run the unit tests:
    cd apps/desktop
    node --test electron/zoom.test.cjs
    
    7 pass (clamping, the percent to level conversion in both directions, roundtrip stability of every preset, monotonicity, and bounds).

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 typecheck and eslint pass on the touched files.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Windows 11

Note 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, eslint on the touched files).

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A

@Adolanium
Adolanium requested a review from a team July 7, 2026 13:10
@alt-glitch alt-glitch added type/feature New feature or request comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have labels Jul 7, 2026
@teknium1

teknium1 commented Jul 7, 2026

Copy link
Copy Markdown
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!

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

3 participants