diff --git a/src/browser/App.tsx b/src/browser/App.tsx index 7de592e5e2..199c7694a4 100644 --- a/src/browser/App.tsx +++ b/src/browser/App.tsx @@ -479,6 +479,14 @@ function AppInner() { openSettings, ]); + // Subscribe to menu bar "Open Settings" (macOS Cmd+, from app menu) + useEffect(() => { + const unsubscribe = window.api.menu?.onOpenSettings(() => { + openSettings(); + }); + return () => unsubscribe?.(); + }, [openSettings]); + // Handle workspace fork switch event useEffect(() => { const handleForkSwitch = (e: Event) => { diff --git a/src/common/constants/ipc-constants.ts b/src/common/constants/ipc-constants.ts index 828797a311..be7bc45ccf 100644 --- a/src/common/constants/ipc-constants.ts +++ b/src/common/constants/ipc-constants.ts @@ -50,6 +50,9 @@ export const IPC_CHANNELS = { // Window channels WINDOW_SET_TITLE: "window:setTitle", + // Menu channels (main -> renderer) + MENU_OPEN_SETTINGS: "menu:openSettings", + // Debug channels (for testing only) DEBUG_TRIGGER_STREAM_ERROR: "debug:triggerStreamError", diff --git a/src/common/types/ipc.ts b/src/common/types/ipc.ts index d257600810..22f844e504 100644 --- a/src/common/types/ipc.ts +++ b/src/common/types/ipc.ts @@ -377,6 +377,9 @@ export interface IPCApi { install(): void; onStatus(callback: (status: UpdateStatus) => void): () => void; }; + menu?: { + onOpenSettings(callback: () => void): () => void; + }; server?: { getLaunchProject(): Promise; }; diff --git a/src/desktop/main.ts b/src/desktop/main.ts index 4eb8f39d92..80b815b515 100644 --- a/src/desktop/main.ts +++ b/src/desktop/main.ts @@ -187,6 +187,16 @@ function createMenu() { submenu: [ { role: "about" }, { type: "separator" }, + { + label: "Settings...", + accelerator: "Cmd+,", + click: () => { + if (mainWindow) { + mainWindow.webContents.send(IPC_CHANNELS.MENU_OPEN_SETTINGS); + } + }, + }, + { type: "separator" }, { role: "services", submenu: [] }, { type: "separator" }, { role: "hide" }, diff --git a/src/desktop/preload.ts b/src/desktop/preload.ts index 8b5cd86e3e..8a9ea1c71c 100644 --- a/src/desktop/preload.ts +++ b/src/desktop/preload.ts @@ -210,6 +210,13 @@ const api: IPCApi = { closeWindow: (workspaceId: string) => ipcRenderer.invoke(IPC_CHANNELS.TERMINAL_WINDOW_CLOSE, workspaceId), }, + menu: { + onOpenSettings: (callback: () => void) => { + const handler = () => callback(); + ipcRenderer.on(IPC_CHANNELS.MENU_OPEN_SETTINGS, handler); + return () => ipcRenderer.removeListener(IPC_CHANNELS.MENU_OPEN_SETTINGS, handler); + }, + }, }; // Expose the API along with platform/versions