mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 13:56:11 +01:00
feat: add command openTodayNote with empty keyboard shortcut #7472
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum {
|
||||
activateNextTab,
|
||||
activatePreviousTab,
|
||||
openNewWindow,
|
||||
openTodayNote,
|
||||
toggleTray,
|
||||
toggleZenMode,
|
||||
firstTab,
|
||||
|
||||
Reference in New Issue
Block a user