Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ui-desktop/electron/zoom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ test('storage key stays stable so persisted zoom survives upgrades', () => {
assert.equal(ZOOM_STORAGE_KEY, 'clawcodex:desktop:zoomLevel')
})

test('default zoom matches the Appearance 90% preset', () => {
test('default zoom matches the Appearance 100% preset', () => {
assert.equal(ZOOM_STEP, 0.1)
assert.equal(zoomLevelToPercent(DEFAULT_ZOOM_LEVEL), 90)
assert.equal(DEFAULT_ZOOM_LEVEL, percentToZoomLevel(90))
assert.equal(zoomLevelToPercent(DEFAULT_ZOOM_LEVEL), 100)
assert.equal(DEFAULT_ZOOM_LEVEL, percentToZoomLevel(100))
})

test('clampZoomLevel rejects garbage and enforces bounds', () => {
Expand Down
10 changes: 6 additions & 4 deletions ui-desktop/electron/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
* Chromium actual-size baseline); Chromium's internal unit is the zoom level,
* where factor = 1.2 ^ level.
*
* 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.
* Our shipped default is the Appearance 100% preset — Chromium's actual-size
* baseline. The reference implementation shipped a denser 90%, which reads
* too small on typical displays; users who prefer dense can pick 90% in the
* UI Scale control (or Ctrl/Cmd+-), and the choice persists.
*/

export const ZOOM_STORAGE_KEY = 'clawcodex:desktop:zoomLevel'
Expand All @@ -18,8 +20,8 @@ const MAX_ZOOM_LEVEL = 9
/** Half Chromium's default step; matching the shortcuts and View menu. */
export const ZOOM_STEP = 0.1

/** Appearance 90% preset. Fresh installs + Actual Size / Ctrl+0. */
export const DEFAULT_ZOOM_LEVEL = Math.log(0.9) / Math.log(ZOOM_FACTOR_BASE)
/** Appearance 100% preset. Fresh installs + Actual Size / Ctrl+0. */
export const DEFAULT_ZOOM_LEVEL = 0

export function clampZoomLevel(value) {
if (!Number.isFinite(value)) {
Expand Down
2 changes: 1 addition & 1 deletion ui-desktop/src/app/settings/appearance-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ 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 the 90% preset. Ids double as the percent
// baseline and the shipped default. 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.
Expand Down
Loading