Skip to content

Commit 5620e7f

Browse files
committed
feat: add command openTodayNote with empty keyboard shortcut #7472
1 parent 69b2620 commit 5620e7f

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

apps/client/src/components/entrypoints.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ export default class Entrypoints extends Component {
159159
this.openInWindowCommand({ notePath: "", hoistedNoteId: "root" });
160160
}
161161

162+
async openTodayNoteCommand() {
163+
const todayNote = await dateNoteService.getTodayNote();
164+
if (!todayNote) {
165+
console.warn("Missing today note.");
166+
return;
167+
}
168+
169+
await appContext.tabManager.openTabWithNoteWithHoisting(todayNote.noteId, { activate: true });
170+
}
171+
162172
async runActiveNoteCommand() {
163173
const noteContext = appContext.tabManager.getActiveContext();
164174
if (!noteContext) {

apps/server/src/services/keyboard_actions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,14 @@ function getDefaultKeyboardActions() {
319319
description: t("keyboard_actions.open-new-window"),
320320
scope: "window"
321321
},
322+
{
323+
actionName: "openTodayNote",
324+
friendlyName: t("keyboard_action_names.open-today-note"),
325+
iconClass: "bx bx-calendar",
326+
defaultShortcuts: [],
327+
description: t("keyboard_actions.open-today-note"),
328+
scope: "window"
329+
},
322330
{
323331
actionName: "toggleTray",
324332
friendlyName: t("keyboard_action_names.toggle-system-tray-icon"),

packages/commons/src/lib/keyboard_actions_interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum {
3535
activateNextTab,
3636
activatePreviousTab,
3737
openNewWindow,
38+
openTodayNote,
3839
toggleTray,
3940
toggleZenMode,
4041
firstTab,

0 commit comments

Comments
 (0)