File tree Expand file tree Collapse file tree 5 files changed +31
-0
lines changed
Expand file tree Collapse file tree 5 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,14 @@ function AppInner() {
480480 openSettings ,
481481 ] ) ;
482482
483+ // Subscribe to menu bar "Open Settings" (macOS Cmd+, from app menu)
484+ useEffect ( ( ) => {
485+ const unsubscribe = window . api . menu ?. onOpenSettings ( ( ) => {
486+ openSettings ( ) ;
487+ } ) ;
488+ return ( ) => unsubscribe ?.( ) ;
489+ } , [ openSettings ] ) ;
490+
483491 // Handle workspace fork switch event
484492 useEffect ( ( ) => {
485493 const handleForkSwitch = ( e : Event ) => {
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ export const IPC_CHANNELS = {
5050 // Window channels
5151 WINDOW_SET_TITLE : "window:setTitle" ,
5252
53+ // Menu channels (main -> renderer)
54+ MENU_OPEN_SETTINGS : "menu:openSettings" ,
55+
5356 // Debug channels (for testing only)
5457 DEBUG_TRIGGER_STREAM_ERROR : "debug:triggerStreamError" ,
5558
Original file line number Diff line number Diff line change @@ -377,6 +377,9 @@ export interface IPCApi {
377377 install ( ) : void ;
378378 onStatus ( callback : ( status : UpdateStatus ) => void ) : ( ) => void ;
379379 } ;
380+ menu ?: {
381+ onOpenSettings ( callback : ( ) => void ) : ( ) => void ;
382+ } ;
380383 server ?: {
381384 getLaunchProject ( ) : Promise < string | null > ;
382385 } ;
Original file line number Diff line number Diff line change @@ -187,6 +187,16 @@ function createMenu() {
187187 submenu : [
188188 { role : "about" } ,
189189 { type : "separator" } ,
190+ {
191+ label : "Settings..." ,
192+ accelerator : "Cmd+," ,
193+ click : ( ) => {
194+ if ( mainWindow ) {
195+ mainWindow . webContents . send ( IPC_CHANNELS . MENU_OPEN_SETTINGS ) ;
196+ }
197+ } ,
198+ } ,
199+ { type : "separator" } ,
190200 { role : "services" , submenu : [ ] } ,
191201 { type : "separator" } ,
192202 { role : "hide" } ,
Original file line number Diff line number Diff line change @@ -210,6 +210,13 @@ const api: IPCApi = {
210210 closeWindow : ( workspaceId : string ) =>
211211 ipcRenderer . invoke ( IPC_CHANNELS . TERMINAL_WINDOW_CLOSE , workspaceId ) ,
212212 } ,
213+ menu : {
214+ onOpenSettings : ( callback : ( ) => void ) => {
215+ const handler = ( ) => callback ( ) ;
216+ ipcRenderer . on ( IPC_CHANNELS . MENU_OPEN_SETTINGS , handler ) ;
217+ return ( ) => ipcRenderer . removeListener ( IPC_CHANNELS . MENU_OPEN_SETTINGS , handler ) ;
218+ } ,
219+ } ,
213220} ;
214221
215222// Expose the API along with platform/versions
You can’t perform that action at this time.
0 commit comments