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;
|
closeThisNoteSplit: CommandData;
|
||||||
moveThisNoteSplit: CommandData & { isMovingLeft: boolean };
|
moveThisNoteSplit: CommandData & { isMovingLeft: boolean };
|
||||||
jumpToNote: CommandData;
|
jumpToNote: CommandData;
|
||||||
|
openTodayNote: CommandData;
|
||||||
commandPalette: CommandData;
|
commandPalette: CommandData;
|
||||||
|
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
|
|||||||
@ -159,6 +159,16 @@ export default class Entrypoints extends Component {
|
|||||||
this.openInWindowCommand({ notePath: "", hoistedNoteId: "root" });
|
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() {
|
async runActiveNoteCommand() {
|
||||||
const noteContext = appContext.tabManager.getActiveContext();
|
const noteContext = appContext.tabManager.getActiveContext();
|
||||||
if (!noteContext) {
|
if (!noteContext) {
|
||||||
|
|||||||
@ -41,6 +41,14 @@ function getDefaultKeyboardActions() {
|
|||||||
scope: "window",
|
scope: "window",
|
||||||
ignoreFromCommandPalette: true
|
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",
|
actionName: "commandPalette",
|
||||||
friendlyName: t("keyboard_action_names.command-palette"),
|
friendlyName: t("keyboard_action_names.command-palette"),
|
||||||
|
|||||||
@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum {
|
|||||||
activateNextTab,
|
activateNextTab,
|
||||||
activatePreviousTab,
|
activatePreviousTab,
|
||||||
openNewWindow,
|
openNewWindow,
|
||||||
|
openTodayNote,
|
||||||
toggleTray,
|
toggleTray,
|
||||||
toggleZenMode,
|
toggleZenMode,
|
||||||
firstTab,
|
firstTab,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user