feat: add command openTodayNote with empty keyboard shortcut #7472

This commit is contained in:
contributor
2025-10-28 16:27:46 +02:00
parent 69b262040a
commit 5620e7f4a7
3 changed files with 19 additions and 0 deletions

View File

@@ -159,6 +159,16 @@ export default class Entrypoints extends Component {
this.openInWindowCommand({ notePath: "", hoistedNoteId: "root" }); this.openInWindowCommand({ notePath: "", hoistedNoteId: "root" });
} }
async openTodayNoteCommand() {
const todayNote = await dateNoteService.getTodayNote();
if (!todayNote) {
console.warn("Missing today note.");
return;
}
await appContext.tabManager.openTabWithNoteWithHoisting(todayNote.noteId, { activate: true });
}
async runActiveNoteCommand() { async runActiveNoteCommand() {
const noteContext = appContext.tabManager.getActiveContext(); const noteContext = appContext.tabManager.getActiveContext();
if (!noteContext) { if (!noteContext) {

View File

@@ -319,6 +319,14 @@ function getDefaultKeyboardActions() {
description: t("keyboard_actions.open-new-window"), description: t("keyboard_actions.open-new-window"),
scope: "window" scope: "window"
}, },
{
actionName: "openTodayNote",
friendlyName: t("keyboard_action_names.open-today-note"),
iconClass: "bx bx-calendar",
defaultShortcuts: [],
description: t("keyboard_actions.open-today-note"),
scope: "window"
},
{ {
actionName: "toggleTray", actionName: "toggleTray",
friendlyName: t("keyboard_action_names.toggle-system-tray-icon"), friendlyName: t("keyboard_action_names.toggle-system-tray-icon"),

View File

@@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum {
activateNextTab, activateNextTab,
activatePreviousTab, activatePreviousTab,
openNewWindow, openNewWindow,
openTodayNote,
toggleTray, toggleTray,
toggleZenMode, toggleZenMode,
firstTab, firstTab,