()
| 589 | } |
| 590 | |
| 591 | protected async openTaskNote(): Promise<void> { |
| 592 | try { |
| 593 | // Get the file from the task path |
| 594 | const file = this.app.vault.getAbstractFileByPath(this.task.path); |
| 595 | |
| 596 | if (!(file instanceof TFile)) { |
| 597 | new Notice(this.t("modals.taskEdit.notices.fileMissing", { path: this.task.path })); |
| 598 | return; |
| 599 | } |
| 600 | |
| 601 | // Open the file in a new leaf |
| 602 | const leaf = this.app.workspace.getLeaf(true); |
| 603 | await leaf.openFile(file); |
| 604 | |
| 605 | // Close the modal |
| 606 | this.close(); |
| 607 | } catch (error) { |
| 608 | tasknotesLogger.error("Failed to open task note:", { |
| 609 | category: "persistence", |
| 610 | operation: "open-task-note", |
| 611 | error: error, |
| 612 | }); |
| 613 | new Notice(this.t("modals.taskEdit.notices.openNoteFailure")); |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | private async archiveTask(): Promise<void> { |
| 618 | try { |
no test coverage detected