The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 01:45 UTC
fix(desktop): handle macos command-plus zoom input (#18439)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
maria committed
Oct 19, 2026 at 21:10 UTC
fcab788163e7ad859bfb93ba584f6f8c77178164
4 files changed
+27
-6
apps/desktop/src/window/DesktopApplicationMenu.test.ts
+12
-4
@@ -247,13 +247,13 @@ describe("DesktopApplicationMenu", () => {
247
}),
248
);
249
250
- it.effect("routes View menu zoom to the main window instead of zoom roles", () =>
250
+ it.effect("registers macOS command-plus once and routes it through main-window zoom", () =>
251
Effect.gen(function* () {
252
const selectedAction = yield* Deferred.make<string>();
253
const applicationMenuTemplate =
254
yield* Deferred.make<readonly Electron.MenuItemConstructorOptions[]>();
255
256
- yield* configureMenu(selectedAction, applicationMenuTemplate);
256
+ yield* configureMenu(selectedAction, applicationMenuTemplate, { platform: "darwin" });
257
258
const template = yield* Deferred.await(applicationMenuTemplate);
259
const viewMenu = template.find((item) => item.label === "View");
@@ -268,9 +268,17 @@ describe("DesktopApplicationMenu", () => {
268
),
269
);
270
271
- const zoomIn = viewMenu.submenu.find((item) => item.label === "Zoom In");
271
+ const shiftedEqual = viewMenu.submenu.filter(
272
+ (item) => item.accelerator === "CmdOrCtrl+Shift+=",
273
+ );
274
+ assert.lengthOf(shiftedEqual, 1);
275
+ assert.lengthOf(
276
+ viewMenu.submenu.filter((item) => item.accelerator === "CmdOrCtrl+numadd"),
277
+ 1,
278
+ );
279
+ const zoomIn = shiftedEqual[0];
280
assert.isDefined(zoomIn);
273
- assert.equal(zoomIn.accelerator, "CmdOrCtrl+=");
281
+ assert.isFalse(zoomIn.visible);
282
if (typeof zoomIn.click !== "function") {
283
throw new Error("Expected Zoom In menu item to have a click handler.");
284
}
apps/desktop/src/window/DesktopApplicationMenu.ts
+10
@@ -263,6 +263,16 @@ export const make = Effect.gen(function* () {
263
visible: false,
264
click: zoomClick("in"),
265
},
266
+ ...(environment.platform === "darwin"
267
+ ? [
268
+ {
269
+ label: "Zoom In",
270
+ accelerator: "CmdOrCtrl+Shift+=",
271
+ visible: false,
272
+ click: zoomClick("in"),
273
+ },
274
+ ]
275
+ : []),
276
{ label: "Zoom Out", accelerator: "CmdOrCtrl+-", click: zoomClick("out") },
277
// The numeric keypad sends its own key codes, so the number-row
278
// accelerators above never match it.
apps/desktop/src/window/DesktopWindow.test.ts
+4
-1
@@ -774,9 +774,10 @@ describe("DesktopWindow", () => {
774
// Chromium hands the main window's zoom level down to embedded preview
775
// guests, so every app zoom has to put the preview browser back at its own
776
// zoom or zooming the UI drags the previewed page with it.
777
- it.effect("restores the preview browser's own zoom after zooming the app", () =>
777
+ it.effect("zooms main with a focused popup and reapplies preview zoom", () =>
778
Effect.gen(function* () {
779
const fakeWindow = makeFakeBrowserWindow();
780
+ const popup = makeFakeBrowserWindow();
781
const createCount = yield* Ref.make(0);
782
const mainWindow = yield* Ref.make<Option.Option<Electron.BrowserWindow>>(Option.none());
783
const previewZoomReapplies: number[] = [];
@@ -785,6 +786,7 @@ describe("DesktopWindow", () => {
786
createCount,
787
mainWindow,
788
previewZoomReapplies,
789
+ focusedWindow: popup.window,
790
});
791
792
yield* Effect.gen(function* () {
@@ -801,6 +803,7 @@ describe("DesktopWindow", () => {
803
[-0.5, -1, -0.5, 0],
804
);
805
assert.deepEqual(previewZoomReapplies, [-0.5, -1, -0.5, 0]);
806
+ assert.equal(popup.setZoomLevel.mock.calls.length, 0);
807
}).pipe(Effect.provide(layer));
808
}),
809
);
apps/desktop/src/window/DesktopWindow.ts
+1
-1
@@ -1026,7 +1026,7 @@ export const make = Effect.gen(function* () {
1026
}),
1027
zoomMain: Effect.fn("desktop.window.zoomMain")(function* (direction) {
1028
yield* Effect.annotateCurrentSpan({ direction });
1029
- const window = yield* focusedMainWindow;
1029
+ const window = yield* electronWindow.main;
1030
if (Option.isNone(window) || window.value.isDestroyed()) {
1031
return;
1032
}