Skip to content

fix(desktop): zoom shortcuts no longer die when the preview browser has focus - #5691

Merged
t3dotgg merged 1 commit into
mainfrom
fix/desktop-zoom-shortcuts
Aug 8, 2026
Merged

fix(desktop): zoom shortcuts no longer die when the preview browser has focus#5691
t3dotgg merged 1 commit into
mainfrom
fix/desktop-zoom-shortcuts

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 8, 2026

Copy link
Copy Markdown
Member

Cmd+= / Cmd+- sometimes stopped zooming the app until a Cmd+R. Cause: the View menu used Electron's zoomIn/zoomOut/resetZoom roles, which act on whichever webContents has keyboard focus. Click inside an embedded preview browser tab (or DevTools) and the shortcuts silently zoom that guest page instead of the app UI. Cmd+R "fixed" it only because the reload role targets the window, and the reload hands focus back to the main webContents.

The View menu zoom items are now plain click handlers (same accelerators, same 0.5 step) that route through a new DesktopWindow.zoomMain, which always zooms the main window's own webContents no matter where focus sits. Preview tabs keep their separate zoom controls in the three-dot menu.

Added a menu test that fails if the zoom items ever go back to roles.


Change authored by Claude Fable 5 via Claude Code.

🤖 Generated with Claude Code


Note

Low Risk
Localized desktop menu and main-window zoom behavior with tests; no auth, data, or backend changes.

Overview
Fixes Cmd+= / Cmd+- sometimes zooming an embedded preview (or DevTools) instead of the app UI when that guest webContents has focus.

The View menu no longer uses Electron zoomIn / zoomOut / resetZoom roles. Zoom items keep the same accelerators and labels but call DesktopWindow.zoomMain, which adjusts zoom on the main window’s webContents (0.5 step, reset to 0) regardless of focus.

Tests add a shared menu configureMenu helper, stub zoomMain on DesktopWindow mocks, and assert the View submenu has no zoom roles and that Zoom In dispatches zoom-in.

Reviewed by Cursor Bugbot for commit 613d0cb. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix zoom shortcuts to target the main window when the preview browser has focus

  • Replaces Electron's built-in zoom role menu items (resetZoom, zoomIn, zoomOut) in the View menu with explicit click handlers that call DesktopWindow.zoomMain.
  • Adds DesktopWindow.zoomMain(direction) which finds the focused main window and adjusts its webContents zoom level by ±0.5 or resets to 0, matching Electron's role step size.
  • Behavioral Change: zoom shortcuts no longer apply to whichever window/webview has focus; they always target the main window.

Macroscope summarized 613d0cb.

…as focus

Cmd+= / Cmd+- were wired to Electron's zoomIn/zoomOut menu roles, which
act on whichever webContents holds keyboard focus. After clicking inside
an embedded preview WebContentsView (or DevTools), the shortcuts zoomed
the guest page instead of the app UI and looked dead until a reload
returned focus to the main window. The menu now routes zoom through
DesktopWindow.zoomMain, which always targets the main window's own
webContents with the same accelerators and step size as the roles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b8bbb3b-07c4-44b5-9ae0-d64c4ec12305

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 11.3 KiB 11.3 KiB +2 B (+0.0%) 15.1 KiB
Codex Thread snapshot wire 5.5 KiB 5.5 KiB −3 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 5.9 KiB 5.9 KiB +5 B (+0.1%) 7.8 KiB
Codex Live turn WebSocket decoded 49.7 KiB 49.7 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 16 16 0 (0.0%) 21
Claude Total thread wire 11.3 KiB 11.4 KiB +12 B (+0.1%) 15.1 KiB
Claude Thread snapshot wire 5.5 KiB 5.5 KiB +13 B (+0.2%) 7.3 KiB
Claude Live turn WebSocket wire 5.9 KiB 5.9 KiB −1 B (−0.0%) 7.8 KiB
Claude Live turn WebSocket decoded 50.6 KiB 50.6 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 16 16 0 (0.0%) 21

Baseline: 2c7267a · PR result: 613d0cb · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 94.6 KiB
  • Claude decoded thread snapshot: 95.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 613d0cb

Straightforward bug fix that redirects zoom shortcuts to always target the main window instead of Electron's default focus-based behavior. The scope is limited, intent is clear, and test coverage is added.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg
t3dotgg merged commit 0640410 into main Aug 8, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the fix/desktop-zoom-shortcuts branch August 8, 2026 09:24
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 8, 2026
## What's Changed
* fix(desktop): zoom shortcuts no longer die when the preview browser has focus by @t3dotgg in pingdotgg/t3code#5691
* feat(mobile): one sheet for model and thread settings by @t3dotgg in pingdotgg/t3code#5625
* feat(usage): usage page reading provider transcripts across environments by @t3dotgg in pingdotgg/t3code#5684


**Full Changelog**: pingdotgg/t3code@v0.0.33-nightly.20260808.1031...v0.0.33-nightly.20260808.1033

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.33-nightly.20260808.1033
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 8, 2026
…224)

* fix(desktop): zoom shortcuts no longer die when the preview browser has focus (pingdotgg#5691)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(mobile): one sheet for model and thread settings (pingdotgg#5625)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(usage): usage page reading provider transcripts across environments (pingdotgg#5684)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(desktop): zoom shortcuts no longer die when the preview browser has focus (pingdotgg#5691)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(mobile): one sheet for model and thread settings (pingdotgg#5625)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(usage): usage page reading provider transcripts across environments (pingdotgg#5684)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant