From b70e5b285aeaf932288610ebafd6dc6bee7b7edd Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Mon, 13 Apr 2026 14:07:43 +0000 Subject: [PATCH] fix new task/event context, add keystroke to create task --- dist/index.js | 7 +++++-- src/View/keystrokes.ts | 1 + src/ViewModel/Pages/boardViewModel.ts | 1 + src/ViewModel/Pages/calendarPageViewModel.ts | 3 ++- src/ViewModel/Pages/taskContainingPageViewModel.ts | 2 +- src/ViewModel/Pages/taskViewModel.ts | 1 + 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index c110abc4..a2f0d2fc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2435,6 +2435,7 @@ }; // view this.open = () => { + console.log(this); this.coreViewModel.context = this; this.containingModel.selectTask(this); }; @@ -2584,7 +2585,7 @@ this, taskFileContent ); - this.selectTask(taskViewModel); + taskViewModel.open(); this.updateTaskIndices(); }; // view @@ -2642,7 +2643,7 @@ this, taskFileContent ); - this.selectTask(taskViewModel); + taskViewModel.open(); this.updateTaskIndices(); }; this.getEventsForDate = () => { @@ -2757,6 +2758,7 @@ this.registerKeyStroke("-" /* Reset */, this.showToday); this.registerKeyStroke("p", this.showNextMonth); this.registerKeyStroke("o", this.showPreviousMonth); + this.registerKeyStroke(";" /* Create */, this.createEvent); this.chatViewModel.registerContext("calendar" /* Calendar */, this); } // data @@ -3384,6 +3386,7 @@ this.registerKeyStroke("backspace" /* CloseOrCancel */, this.hideFilterModal); this.registerKeyStroke("," /* Settings */, this.showSettings); this.registerKeyStroke("enter" /* Apply */, this.hideSettings); + this.registerKeyStroke(";" /* Create */, this.createTask); this.taskPageViewModel.registerContext(this.boardInfo.fileId, this); } }; diff --git a/src/View/keystrokes.ts b/src/View/keystrokes.ts index 048cfc8c..1a8b1529 100644 --- a/src/View/keystrokes.ts +++ b/src/View/keystrokes.ts @@ -6,4 +6,5 @@ export enum CommonKeys { CloseOrCancel = "backspace", Apply = "enter", Settings = ",", + Create = ";", } diff --git a/src/ViewModel/Pages/boardViewModel.ts b/src/ViewModel/Pages/boardViewModel.ts index 9e7d31d3..3cc9445d 100644 --- a/src/ViewModel/Pages/boardViewModel.ts +++ b/src/ViewModel/Pages/boardViewModel.ts @@ -311,6 +311,7 @@ export default class BoardViewModel extends TaskContainingPageViewModel { this.registerKeyStroke(CommonKeys.CloseOrCancel, this.hideFilterModal); this.registerKeyStroke(CommonKeys.Settings, this.showSettings); this.registerKeyStroke(CommonKeys.Apply, this.hideSettings); + this.registerKeyStroke(CommonKeys.Create, this.createTask); this.taskPageViewModel.registerContext(this.boardInfo.fileId, this); } diff --git a/src/ViewModel/Pages/calendarPageViewModel.ts b/src/ViewModel/Pages/calendarPageViewModel.ts index c63425e5..fe7b047a 100644 --- a/src/ViewModel/Pages/calendarPageViewModel.ts +++ b/src/ViewModel/Pages/calendarPageViewModel.ts @@ -56,7 +56,7 @@ export default class CalendarPageViewModel extends TaskContainingPageViewModel { taskFileContent, ); - this.selectTask(taskViewModel); + taskViewModel.open(); this.updateTaskIndices(); }; @@ -215,6 +215,7 @@ export default class CalendarPageViewModel extends TaskContainingPageViewModel { this.registerKeyStroke(CommonKeys.Reset, this.showToday); this.registerKeyStroke("p", this.showNextMonth); this.registerKeyStroke("o", this.showPreviousMonth); + this.registerKeyStroke(CommonKeys.Create, this.createEvent); this.chatViewModel.registerContext(ChatPageTypes.Calendar, this); } diff --git a/src/ViewModel/Pages/taskContainingPageViewModel.ts b/src/ViewModel/Pages/taskContainingPageViewModel.ts index 86e9c0a8..325a7e06 100644 --- a/src/ViewModel/Pages/taskContainingPageViewModel.ts +++ b/src/ViewModel/Pages/taskContainingPageViewModel.ts @@ -31,7 +31,7 @@ export default class TaskContainingPageViewModel extends Context { this, taskFileContent, ); - this.selectTask(taskViewModel); + taskViewModel.open(); this.updateTaskIndices(); }; diff --git a/src/ViewModel/Pages/taskViewModel.ts b/src/ViewModel/Pages/taskViewModel.ts index 4131fd65..302f3539 100644 --- a/src/ViewModel/Pages/taskViewModel.ts +++ b/src/ViewModel/Pages/taskViewModel.ts @@ -87,6 +87,7 @@ export default class TaskViewModel extends Context { // view open = (): void => { + console.log(this); this.coreViewModel.context = this; this.containingModel.selectTask(this); };