feat(menu): add 'Today's Daily Note' under Tools

Same handler as the global Ctrl+Alt+D shortcut — opens (or creates)
the local-date YYYY-MM-DD.md and sends a file-opened IPC to the
renderer. Mirrors the Quick Note pattern in the same submenu (global
shortcut + menu entry, both pointing at openOrCreate).

Amit Haridas
This commit is contained in:
2026-09-14 09:01:43 +05:30
parent 1b85bc47a4
commit 0cab0b08c7
+24
View File
@@ -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'),