MCPcopy
hub / github.com/callumalpass/tasknotes / showRecurrenceMenu

Method showRecurrenceMenu

src/bases/TaskListView.ts:2586–2615  ·  view source on GitHub ↗
(task: TaskInfo, event: MouseEvent)

Source from the content-addressed store, hash-verified

2584 }
2585
2586 private showRecurrenceMenu(task: TaskInfo, event: MouseEvent): void {
2587 const menu = new RecurrenceContextMenu({
2588 currentValue: typeof task.recurrence === "string" ? task.recurrence : undefined,
2589 currentAnchor: task.recurrence_anchor || "scheduled",
2590 scheduledDate: task.scheduled,
2591 onSelect: (newRecurrence: string | null, anchor?: "scheduled" | "completion") => {
2592 void (async () => {
2593 try {
2594 await this.plugin.updateTaskProperty(
2595 task,
2596 "recurrence",
2597 newRecurrence || undefined
2598 );
2599 if (anchor !== undefined) {
2600 await this.plugin.updateTaskProperty(task, "recurrence_anchor", anchor);
2601 }
2602 } catch (error) {
2603 tasknotesLogger.error(
2604 "[TaskNotes][TaskListView] Failed to update recurrence",
2605 { category: "validation", operation: "update-recurrence", error: error }
2606 );
2607 new Notice("Failed to update recurrence");
2608 }
2609 })();
2610 },
2611 app: this.plugin.app,
2612 plugin: this.plugin,
2613 });
2614 menu.show(event);
2615 }
2616
2617 private showReminderModal(task: TaskInfo): void {
2618 const modal = new ReminderModal(this.plugin.app, this.plugin, task, (reminders) => {

Callers 1

handleActionClickMethod · 0.95

Calls 3

showMethod · 0.95
updateTaskPropertyMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected