From 4a9754b3c3d04a155ddbfcb45642d3afe975c735 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Tue, 28 Jul 2026 04:00:55 -0500 Subject: [PATCH] feat(desktop): default UI zoom to Appearance 90% preset Land on the exact 90% scale so the settings control shows a selection on fresh installs, instead of five Ctrl+- steps (~91%) between presets. --- apps/desktop/e2e/fixtures.ts | 8 ++++---- apps/desktop/electron/zoom.test.ts | 6 +++--- apps/desktop/electron/zoom.ts | 8 ++++---- apps/desktop/src/app/settings/appearance-settings.tsx | 8 ++++---- apps/desktop/src/store/zoom.ts | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/desktop/e2e/fixtures.ts b/apps/desktop/e2e/fixtures.ts index 75d51f6ea2ef..fee8e4197032 100644 --- a/apps/desktop/e2e/fixtures.ts +++ b/apps/desktop/e2e/fixtures.ts @@ -121,10 +121,10 @@ export function createSandbox(prefix: string): Sandbox { ) // Pin Chromium actual-size zoom (level 0) for the suite. Fresh installs - // ship DEFAULT_ZOOM_LEVEL ≈ -0.5 (~91%), but Playwright click hit-testing - // and the committed visual baselines were calibrated at 100%. Without this - // file every sandbox would inherit the product default and fail pointer - // interception + snapshot diffs. + // ship DEFAULT_ZOOM_LEVEL at the Appearance 90% preset, but Playwright + // click hit-testing and the committed visual baselines were calibrated at + // 100%. Without this file every sandbox would inherit the product default + // and fail pointer interception + snapshot diffs. fs.writeFileSync( path.join(userDataDir, 'zoom-state.json'), JSON.stringify({ zoomLevel: 0 }, null, 2), diff --git a/apps/desktop/electron/zoom.test.ts b/apps/desktop/electron/zoom.test.ts index c310db45f240..7fbb291a24bd 100644 --- a/apps/desktop/electron/zoom.test.ts +++ b/apps/desktop/electron/zoom.test.ts @@ -26,10 +26,10 @@ test('storage key stays stable so persisted zoom survives upgrades', () => { assert.equal(ZOOM_STORAGE_KEY, 'hermes:desktop:zoomLevel') }) -test('default zoom is five Ctrl/Cmd+- steps out from Chromium 0', () => { +test('default zoom matches the Appearance 90% preset', () => { assert.equal(ZOOM_STEP, 0.1) - assert.equal(DEFAULT_ZOOM_LEVEL, -0.5) - assert.equal(zoomLevelToPercent(DEFAULT_ZOOM_LEVEL), 91) + assert.equal(zoomLevelToPercent(DEFAULT_ZOOM_LEVEL), 90) + assert.equal(DEFAULT_ZOOM_LEVEL, percentToZoomLevel(90)) }) test('clampZoomLevel rejects garbage and enforces bounds', () => { diff --git a/apps/desktop/electron/zoom.ts b/apps/desktop/electron/zoom.ts index 0e2131b2a639..ee3d57648896 100644 --- a/apps/desktop/electron/zoom.ts +++ b/apps/desktop/electron/zoom.ts @@ -5,8 +5,8 @@ * Chromium actual-size baseline); Chromium's internal unit is the zoom level, * where factor = 1.2 ^ level. * - * Our shipped default is five Ctrl/Cmd+- steps out from Chromium 0 — a slightly - * tighter UI that still lands near the 90% Appearance preset. + * Our shipped default is the Appearance 90% preset — tight enough to feel + * denser than Chromium 100%, and selected in the UI Scale control on first run. */ export const ZOOM_STORAGE_KEY = 'hermes:desktop:zoomLevel' @@ -18,8 +18,8 @@ const MAX_ZOOM_LEVEL = 9 /** Half Chromium's default step; matching the shortcuts and View menu. */ export const ZOOM_STEP = 0.1 -/** Five Ctrl/Cmd+- presses from Chromium 0 (~91%). Fresh installs + Actual Size. */ -export const DEFAULT_ZOOM_LEVEL = -5 * ZOOM_STEP +/** Appearance 90% preset. Fresh installs + Actual Size / Ctrl+0. */ +export const DEFAULT_ZOOM_LEVEL = Math.log(0.9) / Math.log(ZOOM_FACTOR_BASE) export function clampZoomLevel(value) { if (!Number.isFinite(value)) { diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsx index 617646061cd1..530870d13b25 100644 --- a/apps/desktop/src/app/settings/appearance-settings.tsx +++ b/apps/desktop/src/app/settings/appearance-settings.tsx @@ -65,10 +65,10 @@ function ThemePreview({ name, mode }: { name: string; mode: 'light' | 'dark' }) } // UI scale presets, as zoom percentages. 100 is Chromium's actual-size -// baseline; the shipped default is five Ctrl/Cmd+- steps out (~91%). Ids -// double as the percent values sent to the main process. A Cmd/Ctrl +/- -// step landing between presets highlights nothing, and the row description -// keeps showing the exact current percent. +// baseline; the shipped default is the 90% preset. Ids double as the percent +// values sent to the main process. A Cmd/Ctrl +/- step landing between +// presets highlights nothing, and the row description keeps showing the +// exact current percent. const UI_SCALE_PRESETS = ['90', '100', '110', '125', '150', '175'] as const type UiScalePreset = (typeof UI_SCALE_PRESETS)[number] diff --git a/apps/desktop/src/store/zoom.ts b/apps/desktop/src/store/zoom.ts index d2258e05097d..821563acc4b0 100644 --- a/apps/desktop/src/store/zoom.ts +++ b/apps/desktop/src/store/zoom.ts @@ -10,9 +10,9 @@ import { atom } from 'nanostores' -// Mirror DEFAULT_ZOOM_LEVEL (-0.5 ≈ 91%) so Appearance doesn't flash 100% before +// Mirror DEFAULT_ZOOM_LEVEL (90%) so Appearance doesn't flash 100% before // the main-process zoom.get() resolves. Keep in sync with electron/zoom.ts. -export const $zoomPercent = atom(91) +export const $zoomPercent = atom(90) export function setZoomPercent(percent: number): void { window.hermesDesktop?.zoom?.setPercent(percent)