mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 13:39:01 +01:00
Keyboard shortcut for today note button (#7549)
This commit is contained in:
commit
19c6ae6fe5
@ -270,6 +270,7 @@ export type CommandMappings = {
|
||||
closeThisNoteSplit: CommandData;
|
||||
moveThisNoteSplit: CommandData & { isMovingLeft: boolean };
|
||||
jumpToNote: CommandData;
|
||||
openTodayNote: CommandData;
|
||||
commandPalette: CommandData;
|
||||
|
||||
// Keyboard shortcuts
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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"),
|
||||
|
||||
@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum {
|
||||
activateNextTab,
|
||||
activatePreviousTab,
|
||||
openNewWindow,
|
||||
openTodayNote,
|
||||
toggleTray,
|
||||
toggleZenMode,
|
||||
firstTab,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user