Repository navigation
Zoom a focused browser page with ⌘= / ⌘- / ⌘0, ⌘+ and pinch - #225
Merged
Merged
Conversation
yansfil
added a commit
that referenced
this pull request
Sep 28, 2026
Brings in browser page zoom (#225), which touches only the desktop host and its docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In a browser display, ⌘= / ⌘- / ⌘0 used to hand focus back to the shell and resize the terminal or editor text, and a trackpad pinch did nothing.
Now, while a page holds the keyboard, the text-size commands zoom that page in Chrome's steps (25% to 500%, reset to 100%) and the page keeps focus.
⌘+ (⌘⇧=) also zooms in, and pinch zoom is enabled up to 3x.
With the shell focused, the same commands size text exactly as before.
Routing is by command id in
DesktopHost.sendCommand, so a rebound text-size chord zooms the page too.Review
desktop/src/main/host.ts-sendCommandis the app-menu path for every command; the zoom branch runs only for the three text-size ids while a visible page is focused.desktop/src/main/browser.ts- pinch limits are re-applied on every main-framedid-navigate, because they live in the renderer and a cross-site navigation swaps it (failure path: a rejected call is logged asbrowser.pinch_zoom_failed).Evidence
zoom:drives the menu commands with the page focused and checks the zoom steps 1.1, 1.25, 1.1, 1, 0.9, 1, plus ⌘⇧= to 1.1. The page keeps focus throughout and nopane_text_scale/editor_text_scaleis sent.text_larger/text_resetthen send exactly one text-scale event each while the page zoom stays put.visualViewport.scaleabove 1.2, and does so again after the page navigates to another site in a new renderer process (PID checked).browserSync.test.tsunit-tests the step table against Chromium'skPresetZoomFactors, the clamping at both ends, and off-step starting values.browser.spec.ts,keys.spec.tsandclose-policy.spec.tsdesktop suites passed (7/7), along with desktop typecheck, lint and unit tests (44).Input.synthesizePinchGesture, not by hand.browser:test failed some of the time atbrowser.spec.ts:350, theenterWorkspaceafter a relaunch. That is the known relaunch race from Find the hide CLI when the desktop app starts without the operator's PATH #166 and outside this diff.More evidence
AI tooling: mostly AI tools. By hand I compared each zoom step, focus state and text-scale count against the e2e output and the native key-press transcript.