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";...@@ -8,6 +8,7 @@ import path from "node:path";
8import { app, BrowserWindow, dialog, ipcMain, Menu, nativeImage, protocol, shell } from "electron";8import { app, BrowserWindow, dialog, ipcMain, Menu, nativeImage, protocol, shell } from "electron";
9import type { MenuItemConstructorOptions } from "electron";9import type { MenuItemConstructorOptions } from "electron";
1010
11import type { ContextMenuItem } from "@t3tools/contracts";
11import { showDesktopConfirmDialog } from "./confirmDialog";12import { showDesktopConfirmDialog } from "./confirmDialog";
12import { fixPath } from "./fixPath";13import { fixPath } from "./fixPath";
1314
...@@ -36,12 +37,6 @@ let restartTimer: ReturnType<typeof setTimeout> | null = null;...@@ -36,12 +37,6 @@ let restartTimer: ReturnType<typeof setTimeout> | null = null;
36let isQuitting = false;37let isQuitting = false;
37let desktopProtocolRegistered = false;38let desktopProtocolRegistered = false;
3839
39interface DesktopContextMenuItem {
40 id: string;
41 label: string;
42 destructive?: boolean;
43}
44
45let destructiveMenuIconCache: Electron.NativeImage | null | undefined;40let destructiveMenuIconCache: Electron.NativeImage | null | undefined;
4641
47function getDestructiveMenuIcon(): Electron.NativeImage | undefined {42function getDestructiveMenuIcon(): Electron.NativeImage | undefined {
...@@ -439,7 +434,7 @@ function registerIpcHandlers(): void {...@@ -439,7 +434,7 @@ function registerIpcHandlers(): void {
439 CONTEXT_MENU_CHANNEL,434 CONTEXT_MENU_CHANNEL,
440 async (435 async (
441 _event,436 _event,
442 items: DesktopContextMenuItem[],437 items: ContextMenuItem[],
443 position?: { x: number; y: number },438 position?: { x: number; y: number },
444 ) => {439 ) => {
445 const normalizedItems = items440 const normalizedItems = items