authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 13:34:15-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-02 13:49:04-08:00
log9e2e73c070710bfcb132cfff3ca1eb7b03996dd7
tree216eb884a3e1fbf29484a4b8a4ea4d0fbcc32753
parentc530e5d50f5a77cd732c0c3e09d9ef964faea96e

Import ContextMenuItem from contracts in desktop app

Remove the duplicate DesktopContextMenuItem interface and use the shared ContextMenuItem type from @t3tools/contracts instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

1 files changed, 2 insertions(+), 7 deletions(-)

apps/desktop/src/main.ts+2-7
......@@ -8,6 +8,7 @@ import path from "node:path";
88import { app, BrowserWindow, dialog, ipcMain, Menu, nativeImage, protocol, shell } from "electron";
99import type { MenuItemConstructorOptions } from "electron";
1010
11import type { ContextMenuItem } from "@t3tools/contracts";
1112import { showDesktopConfirmDialog } from "./confirmDialog";
1213import { fixPath } from "./fixPath";
1314
......@@ -36,12 +37,6 @@ let restartTimer: ReturnType<typeof setTimeout> | null = null;
3637let isQuitting = false;
3738let desktopProtocolRegistered = false;
3839
39interface DesktopContextMenuItem {
40 id: string;
41 label: string;
42 destructive?: boolean;
43}
44
4540let destructiveMenuIconCache: Electron.NativeImage | null | undefined;
4641
4742function getDestructiveMenuIcon(): Electron.NativeImage | undefined {
......@@ -439,7 +434,7 @@ function registerIpcHandlers(): void {
439434 CONTEXT_MENU_CHANNEL,
440435 async (
441436 _event,
442 items: DesktopContextMenuItem[],
437 items: ContextMenuItem[],
443438 position?: { x: number; y: number },
444439 ) => {
445440 const normalizedItems = items