From 18eb25b70d12fabd6ca2b7d4c19eba4235010506 Mon Sep 17 00:00:00 2001 From: avi Date: Tue, 22 Sep 2026 16:58:29 -0500 Subject: [PATCH] refactor(menu): collapse five export items into one Export submenu --- src/main/menu.ts | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/main/menu.ts b/src/main/menu.ts index 7964a22..0bd9cb1 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -80,31 +80,33 @@ export function buildMenu( }, { type: "separator" }, { - label: "Export Markdown…", - accelerator: "CmdOrCtrl+Shift+E", + label: "Export", enabled: !!getState().bookPath, - click: () => getWindow()?.webContents.send("folio:export-markdown-requested"), - }, - { - label: "Export Bundle (ZIP)…", - enabled: !!getState().bookPath, - click: () => getWindow()?.webContents.send("folio:export-zip-requested"), - }, - { - label: "Export Full Book (PDF)…", - accelerator: "CmdOrCtrl+Shift+P", - enabled: !!getState().bookPath, - click: () => getWindow()?.webContents.send("folio:export-pdf-requested"), - }, - { - label: "Export Full Book (DOCX)…", - enabled: !!getState().bookPath, - click: () => getWindow()?.webContents.send("folio:export-docx-requested"), - }, - { - label: "Export Full Book (ODT)…", - enabled: !!getState().bookPath, - click: () => getWindow()?.webContents.send("folio:export-odt-requested"), + submenu: [ + { + label: "Markdown…", + accelerator: "CmdOrCtrl+Shift+E", + click: () => getWindow()?.webContents.send("folio:export-markdown-requested"), + }, + { + label: "Bundle (ZIP)…", + click: () => getWindow()?.webContents.send("folio:export-zip-requested"), + }, + { type: "separator" }, + { + label: "Full Book (PDF)…", + accelerator: "CmdOrCtrl+Shift+P", + click: () => getWindow()?.webContents.send("folio:export-pdf-requested"), + }, + { + label: "Full Book (DOCX)…", + click: () => getWindow()?.webContents.send("folio:export-docx-requested"), + }, + { + label: "Full Book (ODT)…", + click: () => getWindow()?.webContents.send("folio:export-odt-requested"), + }, + ], }, { type: "separator" }, {