Skip to content

The agent that grows with you

Desktop opens new installs at a screen-sized window and 110% zoom (#127448)

Siddharth Balyan666f313d1d3a
diff --git a/apps/desktop/e2e/core/harness.ts b/apps/desktop/e2e/core/harness.ts
index 85f2c1df0f1..d9634ab3a76 100644
--- a/apps/desktop/e2e/core/harness.ts
+++ b/apps/desktop/e2e/core/harness.ts
@@ -495,7 +495,7 @@ export async function waitForInteractive(app: ElectronApplication, page: Page, t
if (cs.position === 'fixed') {
const r = node.getBoundingClientRect()
- if (r.left <= 0 && r.top <= 0 && r.right >= window.innerWidth && r.bottom >= window.innerHeight) {
+ if (r.left <= 1 && r.top <= 1 && r.right >= window.innerWidth - 1 && r.bottom >= window.innerHeight - 1) {
return false
}
}
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 7c85312f489..4af3c1294a3 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -589,6 +589,7 @@ import {
bindGeometryPersistence,
computeWindowOptions,
debounce,
+ firstLaunchSize,
sanitizeWindowState,
MIN_HEIGHT as WINDOW_MIN_HEIGHT,
MIN_WIDTH as WINDOW_MIN_WIDTH
@@ -13794,7 +13795,10 @@ const instanceWindows = new Set<any>()
// pure cascade math lives in session-windows.ts (instanceWindowBounds).
function nextInstanceBounds(source: BrowserWindow | null = BrowserWindow.getFocusedWindow() || mainWindow) {
const displays = screen.getAllDisplays()
- const fallback = computeWindowOptions(readWindowState(), displays)
+ const fallback = computeWindowOptions(
+ readWindowState() ?? firstLaunchSize(screen.getPrimaryDisplay().workArea),
+ displays
+ )
const base = source && !source.isDestroyed() ? source.getBounds() : null
return instanceWindowBounds(base, fallback, displays)
@@ -14887,7 +14891,10 @@ function createWindow() {
const icon = getAppIconPath()
const savedWindowState = readWindowState()
mainWindow = new BrowserWindow({
- ...computeWindowOptions(savedWindowState, screen.getAllDisplays()),
+ ...computeWindowOptions(
+ savedWindowState ?? firstLaunchSize(screen.getPrimaryDisplay().workArea),
+ screen.getAllDisplays()
+ ),
minWidth: WINDOW_MIN_WIDTH,
minHeight: WINDOW_MIN_HEIGHT,
title: 'Hermes',
diff --git a/apps/desktop/electron/window-state.test.ts b/apps/desktop/electron/window-state.test.ts
index 2b6b4054b02..772f61d0f3f 100644
--- a/apps/desktop/electron/window-state.test.ts
+++ b/apps/desktop/electron/window-state.test.ts
@@ -13,8 +13,6 @@ import {
bindGeometryPersistence,
computeWindowOptions,
debounce,
- DEFAULT_HEIGHT,
- DEFAULT_WIDTH,
matchingWorkArea,
MIN_HEIGHT,
MIN_WIDTH,
@@ -89,10 +87,6 @@ test('matchingWorkArea rejects off-screen, slivers, and bad input', () => {
// ─── computeWindowOptions ──────────────────────────────────────────────────
-test('computeWindowOptions falls back to defaults with no saved state', () => {
- assert.deepEqual(computeWindowOptions(null, PRIMARY), { width: DEFAULT_WIDTH, height: DEFAULT_HEIGHT })
-})
-
test('computeWindowOptions restores an on-screen position', () => {
const saved = sanitizeWindowState({ x: 200, y: 100, width: 1400, height: 900 })
assert.deepEqual(computeWindowOptions(saved, PRIMARY), { width: 1400, height: 900, x: 200, y: 100 })
diff --git a/apps/desktop/electron/window-state.ts b/apps/desktop/electron/window-state.ts
index ba780156abd..2ece182bd98 100644
--- a/apps/desktop/electron/window-state.ts
+++ b/apps/desktop/electron/window-state.ts
@@ -6,11 +6,6 @@
* live `screen` displays.
*/
-// Defaults mirror the historical hardcoded BrowserWindow size; MIN_* mirror its
-// minWidth/minHeight so a restored size never undershoots what the live window
-// allows. A fresh install (no saved state) is byte-identical to before.
-const DEFAULT_WIDTH = 1220
-const DEFAULT_HEIGHT = 800
const MIN_WIDTH = 400
const MIN_HEIGHT = 620
@@ -92,16 +87,20 @@ interface WindowOptions {
y?: number
}
-// Sanitized state (or null) → BrowserWindow size/position options. Always sets
-// width/height, capped to the largest current display so a size saved on a
-// since-disconnected bigger monitor can't exceed every screen the user now has.
-// A trusted saved position is then capped and clamped to the work area it
-// meaningfully overlaps; otherwise Electron centers the window.
-function computeWindowOptions(state, displays): WindowOptions {
- const opts: WindowOptions = {
- width: finite(state?.width) ? state.width : DEFAULT_WIDTH,
- height: finite(state?.height) ? state.height : DEFAULT_HEIGHT
+interface WorkArea {
+ width: number
+ height: number
+}
+
+function firstLaunchSize(workArea: WorkArea): WindowOptions {
+ return {
+ width: Math.min(clamp(Math.round(workArea.width * 0.75), 1220, 1600), workArea.width),
+ height: Math.min(clamp(Math.round(workArea.height * 0.8), 800, 1000), workArea.height)
}
+}
+
+function computeWindowOptions(state: WindowOptions, displays): WindowOptions {
+ const opts: WindowOptions = { width: state.width, height: state.height }
const cap = (Array.isArray(displays) ? displays : []).reduce(
(m, { workArea: a } = {}) =>
@@ -116,7 +115,7 @@ function computeWindowOptions(state, displays): WindowOptions {
opts.height = clamp(opts.height, MIN_HEIGHT, cap.height)
}
- if (state && finite(state.x) && finite(state.y)) {
+ if (finite(state.x) && finite(state.y)) {
const workArea = matchingWorkArea({ x: state.x, y: state.y, width: opts.width, height: opts.height }, displays)
if (workArea) {
@@ -176,8 +175,7 @@ export {
bindGeometryPersistence,
computeWindowOptions,
debounce,
- DEFAULT_HEIGHT,
- DEFAULT_WIDTH,
+ firstLaunchSize,
GEOMETRY_EVENTS,
matchingWorkArea,
MIN_HEIGHT,
diff --git a/apps/desktop/electron/zoom.ts b/apps/desktop/electron/zoom.ts
index 434ba02b052..20471174cf5 100644
--- a/apps/desktop/electron/zoom.ts
+++ b/apps/desktop/electron/zoom.ts
@@ -4,9 +4,6 @@
* through this one clamped scale. Percent is the user-facing unit (100 = the
* 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.
*/
export const ZOOM_STORAGE_KEY = 'hermes:desktop:zoomLevel'
@@ -18,8 +15,7 @@ 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)
+export const DEFAULT_ZOOM_LEVEL = Math.log(1.1) / Math.log(ZOOM_FACTOR_BASE)
export function clampZoomLevel(value) {
if (!Number.isFinite(value)) {
diff --git a/apps/desktop/src/app/chat/right-rail/preview-input.ts b/apps/desktop/src/app/chat/right-rail/preview-input.ts
index ad6ff57911f..7b6ed80260f 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-input.ts
+++ b/apps/desktop/src/app/chat/right-rail/preview-input.ts
@@ -16,9 +16,7 @@
* device-independent pixels. The act engine measures inside the guest in CSS
* pixels, and Chromium places guest positions at css × zoom (the context-menu
* handler in preview-pane.tsx measured it live), so a rect measured in the page
- * must be scaled by the guest's zoom factor on the way back out — the shipped
- * default zoom is 90 %, and at that zoom an unscaled click lands 11 % too far
- * from the origin and silently misses its target (#116281).
+ * must be scaled by the guest's zoom factor on the way back out (#116281).
*/
import { $rightRailActiveTabId } from '@/store/layout'
diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsx
index fd9b5ddf76f..fca1c10454e 100644
--- a/apps/desktop/src/app/settings/appearance-settings.tsx
+++ b/apps/desktop/src/app/settings/appearance-settings.tsx
@@ -169,11 +169,6 @@ 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
-// 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
const ids = SETTING_IDS.appearance
type UiScalePreset = (typeof UI_SCALE_PRESETS)[number]
diff --git a/apps/desktop/src/store/zoom.ts b/apps/desktop/src/store/zoom.ts
index 81816fb01d9..cabfe7e089d 100644
--- a/apps/desktop/src/store/zoom.ts
+++ b/apps/desktop/src/store/zoom.ts
@@ -10,9 +10,7 @@
import { atom } from 'nanostores'
-// 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<number>(90)
+export const $zoomPercent = atom<number>(110)
export function setZoomPercent(percent: number): void {
window.hermesDesktop?.zoom?.setPercent(percent)