fix(desktop): default UI Scale to 100% and keep chat text at 110%
Fresh installs opened at 90% window zoom, and View > Actual Size (Ctrl/Cmd+0) reset to 90% rather than actual size. Ship 100% as the default UI Scale; Chat Text Size keeps its 110% default.
This commit is contained in:
committed by
brooklyn!
parent
db48af245a
commit
75dfe26cea
@@ -346,7 +346,7 @@ so glass and message-bubble transparency do not reveal scrolling text.
|
||||
|
||||
## Chat typography
|
||||
|
||||
Appearance → Typography keeps **UI Scale** as whole-window zoom (90% by
|
||||
Appearance → Typography keeps **UI Scale** as whole-window zoom (100% by
|
||||
default). **Chat Text Size** is a separate desktop-local multiplier (110% by
|
||||
default) on conversation text and the composer editor, including floating and
|
||||
inline-edit composers.
|
||||
|
||||
@@ -133,11 +133,10 @@ export function createSandbox(prefix: string): Sandbox {
|
||||
'utf8',
|
||||
)
|
||||
|
||||
// Pin Chromium actual-size zoom (level 0) for the suite. Fresh installs
|
||||
// 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.
|
||||
// Pin Chromium actual-size zoom (level 0) for the suite. Playwright click
|
||||
// hit-testing and the committed visual baselines were calibrated at 100%,
|
||||
// so the suite must not drift if the product default (DEFAULT_ZOOM_LEVEL)
|
||||
// ever moves off 100% again.
|
||||
fs.writeFileSync(
|
||||
path.join(userDataDir, 'zoom-state.json'),
|
||||
JSON.stringify({ zoomLevel: 0 }, null, 2),
|
||||
|
||||
@@ -44,6 +44,10 @@ test('level 0 is exactly 100 percent (Chromium actual-size baseline)', () => {
|
||||
assert.equal(percentToZoomLevel(100), 0)
|
||||
})
|
||||
|
||||
test('fresh installs and Actual Size (Ctrl/Cmd+0) land on 100 percent', () => {
|
||||
assert.equal(zoomLevelToPercent(DEFAULT_ZOOM_LEVEL), 100)
|
||||
})
|
||||
|
||||
test('percentToZoomLevel rejects garbage by falling back to the shipped default', () => {
|
||||
assert.equal(percentToZoomLevel(NaN), DEFAULT_ZOOM_LEVEL)
|
||||
assert.equal(percentToZoomLevel(0), DEFAULT_ZOOM_LEVEL)
|
||||
|
||||
@@ -15,7 +15,8 @@ const MAX_ZOOM_LEVEL = 9
|
||||
/** Half Chromium's default step; matching the shortcuts and View menu. */
|
||||
export const ZOOM_STEP = 0.1
|
||||
|
||||
export const DEFAULT_ZOOM_LEVEL = Math.log(0.9) / Math.log(ZOOM_FACTOR_BASE)
|
||||
/** 100%: Chromium actual size, so View → Actual Size (Ctrl/Cmd+0) means it. */
|
||||
export const DEFAULT_ZOOM_LEVEL = 0
|
||||
|
||||
export function clampZoomLevel(value) {
|
||||
if (!Number.isFinite(value)) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import { atom } from 'nanostores'
|
||||
|
||||
export const $zoomPercent = atom<number>(90)
|
||||
export const $zoomPercent = atom<number>(100)
|
||||
|
||||
export function setZoomPercent(percent: number): void {
|
||||
window.hermesDesktop?.zoom?.setPercent(percent)
|
||||
|
||||
Reference in New Issue
Block a user