From 5620e7f4a7a0646c8726d59efb4acc85ce315eb7 Mon Sep 17 00:00:00 2001 From: contributor Date: Tue, 28 Oct 2025 16:27:46 +0200 Subject: [PATCH 1/5] 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, From dd483fccbc19a738f1a75032ad6090c609a59e55 Mon Sep 17 00:00:00 2001 From: contributor Date: Tue, 28 Oct 2025 16:33:36 +0200 Subject: [PATCH 2/5] use common translation for openTodayNote #7472 --- apps/server/src/services/keyboard_actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/server/src/services/keyboard_actions.ts b/apps/server/src/services/keyboard_actions.ts index 0903179a6..c148147f7 100644 --- a/apps/server/src/services/keyboard_actions.ts +++ b/apps/server/src/services/keyboard_actions.ts @@ -321,10 +321,10 @@ function getDefaultKeyboardActions() { }, { actionName: "openTodayNote", - friendlyName: t("keyboard_action_names.open-today-note"), + friendlyName: t("hidden-subtree.open-today-journal-note-title"), iconClass: "bx bx-calendar", defaultShortcuts: [], - description: t("keyboard_actions.open-today-note"), + description: t("hidden-subtree.open-today-journal-note-title"), scope: "window" }, { From 14a3438a20352aecb6904444984077883b811b78 Mon Sep 17 00:00:00 2001 From: contributor Date: Tue, 28 Oct 2025 16:44:26 +0200 Subject: [PATCH 3/5] move shortcut definition to "Note navigation" section #7472 --- apps/server/src/services/keyboard_actions.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/server/src/services/keyboard_actions.ts b/apps/server/src/services/keyboard_actions.ts index c148147f7..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"), @@ -319,14 +327,6 @@ function getDefaultKeyboardActions() { description: t("keyboard_actions.open-new-window"), scope: "window" }, - { - 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: "toggleTray", friendlyName: t("keyboard_action_names.toggle-system-tray-icon"), From e683dc1d6690ca8c17c1baf9d5b7b4a7716bbd42 Mon Sep 17 00:00:00 2001 From: contributor Date: Tue, 28 Oct 2025 16:55:50 +0200 Subject: [PATCH 4/5] add openTodayNote to CommandMappings #7472 --- apps/client/src/components/app_context.ts | 1 + 1 file changed, 1 insertion(+) 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 From 9c791df0ed1436f35c4c78b4fa2c77997dcae8fb Mon Sep 17 00:00:00 2001 From: contributor Date: Wed, 29 Oct 2025 19:22:13 +0200 Subject: [PATCH 5/5] open today note in current tab #7472 https://github.com/TriliumNext/Trilium/pull/7549#issuecomment-3458822614 --- apps/client/src/components/entrypoints.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/client/src/components/entrypoints.ts b/apps/client/src/components/entrypoints.ts index 9194596ab..8a902666f 100644 --- a/apps/client/src/components/entrypoints.ts +++ b/apps/client/src/components/entrypoints.ts @@ -166,7 +166,7 @@ export default class Entrypoints extends Component { return; } - await appContext.tabManager.openTabWithNoteWithHoisting(todayNote.noteId, { activate: true }); + await appContext.tabManager.openInSameTab(todayNote.noteId); } async runActiveNoteCommand() {