Conversation
|
|
||
| export interface ElectronTrayMenuItem { | ||
| readonly label?: string; | ||
| readonly type?: "normal" | "separator" | "submenu" | "checkbox" | "radio"; |
There was a problem hiding this comment.
🟡 Medium electron/ElectronTray.ts:38
ElectronTrayMenuItem advertises type: "submenu", but callers cannot provide any submenu entries, so selecting that type creates an empty submenu and nested tray actions cannot be implemented. Add a recursive submenu/children field and map it to MenuItemConstructorOptions.submenu when building the template.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/desktop/src/electron/ElectronTray.ts around line 38:
`ElectronTrayMenuItem` advertises `type: "submenu"`, but callers cannot provide any submenu entries, so selecting that type creates an empty submenu and nested tray actions cannot be implemented. Add a recursive `submenu`/children field and map it to `MenuItemConstructorOptions.submenu` when building the template.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a new production ElectronTray component covering native tray creation, menus, events, and lifecycle management; even without a current call site, that is a substantive new capability rather than a small isolated change. An unresolved Medium finding also notes that the advertised submenu type cannot represent nested tray actions. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
Closing this intermediate PR in favor of #10163, which contains the complete, self-contained implementation with system tray support and window lifecycle management. |
Part of stacked PR resolving #10161.
Stacked PR Chain
feat(desktop): add ElectronTray service)feat(desktop): support system tray and persist on close on Windows)Summary
Introduces the foundational
ElectronTrayservice wrapping Electron's nativeTrayAPI for desktop platforms.exactOptionalPropertyTypescompatibility), and clean destruction.Note
Add
ElectronTrayservice for Electron tray managementcreateanddestroyoperations, with creation errors wrapped asElectronTrayCreateErrorand operation errors asElectronTrayOperationErrorcreatereplaces any existing managed tray, builds a native image from the icon path (path as fallback), applies optional tooltip/context menu, registers click and double-click listeners, and stores the tray referencedestroyis idempotent for already-destroyed trays and converts thrown destruction failures intoElectronTrayOperationErrorviaorDieElectronTray.layerin the merged Electron layer in main.ts and adds a full test suite in ElectronTray.test.ts📊 Macroscope summarized ed597df. 2 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues