Skip to content

feat(desktop): support Ctrl/Cmd + mouse wheel zoom (#40295) - #67029

Merged
teknium1 merged 1 commit into
mainfrom
feat/40414-wheel-zoom
Jul 18, 2026
Merged

feat(desktop): support Ctrl/Cmd + mouse wheel zoom (#40295)#67029
teknium1 merged 1 commit into
mainfrom
feat/40414-wheel-zoom

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of #40414 (@liuhao1024) — Ctrl/Cmd + mouse wheel now zooms Hermes Desktop, the standard gesture missing next to the existing keyboard shortcuts and View menu zoom. Closes #40295.

Approach (ground-truth reapply)

The original branch predates the ts-ify migration and implemented the gesture by injecting a DOM wheel listener via executeJavaScript plus a new IPC channel + preload method. Current Electron surfaces modifier+wheel natively as the main-process webContents zoom-changed event, so the salvage uses that instead — no renderer injection, no new preload/IPC surface, 12 lines instead of ~50.

Changes

  • apps/desktop/electron/main.ts: zoom-changed handler in installZoomShortcuts, routing through setAndPersistZoomLevel — the same persist+notify funnel as the keyboard shortcuts. Same 0.1 half-step, persists to zoom-state.json across restarts, settings Scale control stays in sync.
  • Session windows inherit the gesture via wireCommonWindowHandlers; the pet overlay stays opted out via zoomWiringForWindowKind.

Validation

Check Result
Full desktop electron suite 433 passed, 1 skipped
tsc scoped to changed file clean
prettier clean

Credit: @liuhao1024 (#40414), authorship preserved on the commit.

Infographic

wheel-zoom

Ground-truth reapply of PR #40414 by @liuhao1024. The original branch
predates the ts-ify migration and implemented the gesture by injecting
a DOM wheel listener via executeJavaScript + a new IPC channel. Current
Electron surfaces the modifier+wheel gesture natively as the main-process
webContents 'zoom-changed' event, so the salvage uses that instead:
no renderer injection, no new preload surface, no new IPC channel.

The handler routes through setAndPersistZoomLevel — the same
persist+notify funnel as the keyboard shortcuts — so wheel zoom uses
the same 0.1 half-step, persists to zoom-state.json across restarts,
and keeps the settings Scale control in sync. Session windows get the
gesture automatically via wireCommonWindowHandlers; the pet overlay
stays opted out via zoomWiringForWindowKind.
@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 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Maintainer salvage of #40414 for #40295. It uses Electron's main-process zoom-changed event and the existing persistence funnel rather than the predecessor's renderer/IPC route, so it is related work rather than a duplicate.

@teknium1
teknium1 merged commit ad0ddfb into main Jul 18, 2026
25 checks passed
@teknium1
teknium1 deleted the feat/40414-wheel-zoom branch July 18, 2026 17:50
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

Development

Successfully merging this pull request may close these issues.

[Desktop UX]: Support Ctrl/Cmd + mouse wheel zoom

3 participants