Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/browser/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
3 changes: 3 additions & 0 deletions src/common/constants/ipc-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down
3 changes: 3 additions & 0 deletions src/common/types/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ export interface IPCApi {
install(): void;
onStatus(callback: (status: UpdateStatus) => void): () => void;
};
menu?: {
onOpenSettings(callback: () => void): () => void;
};
server?: {
getLaunchProject(): Promise<string | null>;
};
Expand Down
10 changes: 10 additions & 0 deletions src/desktop/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
7 changes: 7 additions & 0 deletions src/desktop/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down