Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): handle macos command-plus zoom input #18439

Mergedmaria-rcksmerged 7 commits intomain fromrefs/pull/18439/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 26 additions and 5 deletions (loading 1).

x
0 of 4 viewed, 4 left
12 additions and 4 deletionsapps/desktop/src/window/DesktopApplicationMenu.test.tsModified
View file
@@ -247,13 +247,13 @@
}),
​
- it.effect("routes View menu zoom to the main window instead of zoom roles", () =>
+ it.effect("registers macOS command-plus once and routes it through main-window zoom", () =>
Effect.gen(function* () {
const selectedAction = yield* Deferred.make<string>();
const applicationMenuTemplate =
yield* Deferred.make<readonly Electron.MenuItemConstructorOptions[]>();
​
- yield* configureMenu(selectedAction, applicationMenuTemplate);
+ yield* configureMenu(selectedAction, applicationMenuTemplate, { platform: "darwin" });
​
const template = yield* Deferred.await(applicationMenuTemplate);
const viewMenu = template.find((item) => item.label === "View");
@@ -268,9 +268,17 @@
​
- const zoomIn = viewMenu.submenu.find((item) => item.label === "Zoom In");
+ const shiftedEqual = viewMenu.submenu.filter(
+ (item) => item.accelerator === "CmdOrCtrl+Shift+=",
+ );
+ assert.lengthOf(shiftedEqual, 1);
+ assert.lengthOf(
+ viewMenu.submenu.filter((item) => item.accelerator === "CmdOrCtrl+numadd"),
+ 1,
+ );