diff --git a/apps/client/src/components/app_context.ts b/apps/client/src/components/app_context.ts index 5727032e6..7bc544e7e 100644 --- a/apps/client/src/components/app_context.ts +++ b/apps/client/src/components/app_context.ts @@ -270,6 +270,7 @@ export type CommandMappings = { closeThisNoteSplit: CommandData; moveThisNoteSplit: CommandData & { isMovingLeft: boolean }; jumpToNote: CommandData; + openTodayNote: CommandData; commandPalette: CommandData; // Keyboard shortcuts diff --git a/apps/client/src/components/entrypoints.ts b/apps/client/src/components/entrypoints.ts index 7989960a6..8a902666f 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.openInSameTab(todayNote.noteId); + } + 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..fb97be84c 100644 --- a/apps/server/src/services/keyboard_actions.ts +++ b/apps/server/src/services/keyboard_actions.ts @@ -41,6 +41,14 @@ function getDefaultKeyboardActions() { scope: "window", ignoreFromCommandPalette: true }, + { + actionName: "openTodayNote", + friendlyName: t("hidden-subtree.open-today-journal-note-title"), + iconClass: "bx bx-calendar", + defaultShortcuts: [], + description: t("hidden-subtree.open-today-journal-note-title"), + scope: "window" + }, { actionName: "commandPalette", friendlyName: t("keyboard_action_names.command-palette"), 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,