diff --git a/src/main.js b/src/main.js index b0c0603..e399c60 100644 --- a/src/main.js +++ b/src/main.js @@ -1542,6 +1542,30 @@ function createMenu() { accelerator: 'CmdOrCtrl+Alt+Q', click: () => openQuickNoteWindow(), }, + { + // Daily journal: opens (or creates) today's YYYY-MM-DD.md and + // loads it in the existing tab. Global Ctrl+Alt+D works even + // when the app is unfocused. + label: "Today's Daily Note", + accelerator: 'CmdOrCtrl+Alt+D', + click: () => { + try { + const result = DailyNotes.openOrCreate({ + date: new Date(), + dir: dailyNotesDir(), + templateDir: dailyNotesTemplateDir(), + fs, + pathUtil: path, + now: new Date(), + }); + if (mainWindow && !mainWindow.isDestroyed()) { + mainWindow.webContents.send('file-opened', { filePath: result.path }); + } + } catch (err) { + console.warn('[daily-notes] menu open failed:', err && err.message); + } + }, + }, { label: 'Document Compare', click: () => mainWindow.webContents.send('show-document-compare'),