From 5620e7f4a7a0646c8726d59efb4acc85ce315eb7 Mon Sep 17 00:00:00 2001 From: contributor Date: Tue, 28 Oct 2025 16:27:46 +0200 Subject: [PATCH] feat: add command openTodayNote with empty keyboard shortcut #7472 --- apps/client/src/components/entrypoints.ts | 10 ++++++++++ apps/server/src/services/keyboard_actions.ts | 8 ++++++++ packages/commons/src/lib/keyboard_actions_interface.ts | 1 + 3 files changed, 19 insertions(+) diff --git a/apps/client/src/components/entrypoints.ts b/apps/client/src/components/entrypoints.ts index 7989960a6..9194596ab 100644 --- a/apps/client/src/components/entrypoints.ts +++ b/apps/client/src/components/entrypoints.ts @@ -159,6 +159,16 @@ export default class Entrypoints extends Component { 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() { const noteContext = appContext.tabManager.getActiveContext(); if (!noteContext) { diff --git a/apps/server/src/services/keyboard_actions.ts b/apps/server/src/services/keyboard_actions.ts index 6a11242c4..0903179a6 100644 --- a/apps/server/src/services/keyboard_actions.ts +++ b/apps/server/src/services/keyboard_actions.ts @@ -319,6 +319,14 @@ function getDefaultKeyboardActions() { description: t("keyboard_actions.open-new-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", friendlyName: t("keyboard_action_names.toggle-system-tray-icon"), diff --git a/packages/commons/src/lib/keyboard_actions_interface.ts b/packages/commons/src/lib/keyboard_actions_interface.ts index c3de7e0db..ce2defcd6 100644 --- a/packages/commons/src/lib/keyboard_actions_interface.ts +++ b/packages/commons/src/lib/keyboard_actions_interface.ts @@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum { activateNextTab, activatePreviousTab, openNewWindow, + openTodayNote, toggleTray, toggleZenMode, firstTab,