Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): add explicit context-menu layout and focus options #8458

ClosedAdamulek123(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/8458/headopened View on GitHub

Showing 7 changed files with 170 additions and 3 deletions (loading 4).

x
0 of 7 viewed, 7 left
3 additions and 2 deletionsapps/desktop/src/electron/ElectronMenu.test.tsModified
View file
@@ -77,7 +77,7 @@
const electronMenu = yield* ElectronMenu.ElectronMenu;
const selectedItemId = yield* electronMenu.showContextMenu({
window: makeWindow(),
- items: [{ id: "copy", label: "Copy" }],
+ items: [{ id: "copy", label: "Copy", accelerator: "Ctrl+Shift+C" }],
position: Option.none(),
});
​
@@ -99,7 +99,7 @@
const selectedItemId = yield* electronMenu.showContextMenu({
window: makeWindow(2),
items: [
- { id: "copy", label: "Copy" },
+ { id: "copy", label: "Copy", accelerator: "Ctrl+Shift+C" },
{ id: "delete", label: "Delete", destructive: true, separatorBefore: true },
position: Option.some({ x: 10.8, y: 20.2 }),
@@ -110,6 +110,7 @@
assert.equal(popupOptions?.y, 40);
assert.deepEqual(buildFromTemplateMock.mock.calls[0]?.[0][0], {
label: "Copy",
+ accelerator: "Ctrl+Shift+C",
enabled: true,
click: buildFromTemplateMock.mock.calls[0]?.[0][0].click,
});