( task: TaskInfo, plugin: TaskNotesPlugin )
| 83 | * Creates a click handler for priority indicators. |
| 84 | */ |
| 85 | export function createPriorityClickHandler( |
| 86 | task: TaskInfo, |
| 87 | plugin: TaskNotesPlugin |
| 88 | ): (e: MouseEvent) => void { |
| 89 | return (e: MouseEvent) => { |
| 90 | e.stopPropagation(); |
| 91 | const menu = new PriorityContextMenu({ |
| 92 | currentValue: task.priority, |
| 93 | onSelect: (newPriority) => { |
| 94 | void (async () => { |
| 95 | const logger = getTaskCardActionLogger(plugin); |
| 96 | try { |
| 97 | await plugin.updateTaskProperty(task, "priority", newPriority); |
| 98 | } catch (error) { |
| 99 | logger.error("Error updating priority", { |
| 100 | category: "persistence", |
| 101 | operation: "update-priority", |
| 102 | details: { taskPath: task.path, newPriority }, |
| 103 | error, |
| 104 | }); |
| 105 | new Notice("Failed to update priority"); |
| 106 | } |
| 107 | })(); |
| 108 | }, |
| 109 | plugin, |
| 110 | }); |
| 111 | menu.show(e); |
| 112 | }; |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Creates a click handler for recurrence indicators. |
no test coverage detected