File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ export type CommandMappings = {
270270 closeThisNoteSplit : CommandData ;
271271 moveThisNoteSplit : CommandData & { isMovingLeft : boolean } ;
272272 jumpToNote : CommandData ;
273+ openTodayNote : CommandData ;
273274 commandPalette : CommandData ;
274275
275276 // Keyboard shortcuts
Original file line number Diff line number Diff 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 . openInSameTab ( todayNote . noteId ) ;
170+ }
171+
162172 async runActiveNoteCommand ( ) {
163173 const noteContext = appContext . tabManager . getActiveContext ( ) ;
164174 if ( ! noteContext ) {
Original file line number Diff line number Diff line change @@ -41,6 +41,14 @@ function getDefaultKeyboardActions() {
4141 scope : "window" ,
4242 ignoreFromCommandPalette : true
4343 } ,
44+ {
45+ actionName : "openTodayNote" ,
46+ friendlyName : t ( "hidden-subtree.open-today-journal-note-title" ) ,
47+ iconClass : "bx bx-calendar" ,
48+ defaultShortcuts : [ ] ,
49+ description : t ( "hidden-subtree.open-today-journal-note-title" ) ,
50+ scope : "window"
51+ } ,
4452 {
4553 actionName : "commandPalette" ,
4654 friendlyName : t ( "keyboard_action_names.command-palette" ) ,
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ const enum KeyboardActionNamesEnum {
3535 activateNextTab ,
3636 activatePreviousTab ,
3737 openNewWindow ,
38+ openTodayNote ,
3839 toggleTray ,
3940 toggleZenMode ,
4041 firstTab ,
You can’t perform that action at this time.
0 commit comments