* Update a task element in place using TaskCard functionality
( element: HTMLElement, taskInfo: TaskInfo, plugin: TaskNotesPlugin, visibleProperties: string[], propertyLabels?: Record<string, string> )
| 199 | * Update a task element in place using TaskCard functionality |
| 200 | */ |
| 201 | async function updateTaskElementInPlace( |
| 202 | element: HTMLElement, |
| 203 | taskInfo: TaskInfo, |
| 204 | plugin: TaskNotesPlugin, |
| 205 | visibleProperties: string[], |
| 206 | propertyLabels?: Record<string, string> |
| 207 | ): Promise<void> { |
| 208 | try { |
| 209 | // Use the existing updateTaskCard function if available |
| 210 | const { updateTaskCard } = await import("../ui/TaskCard"); |
| 211 | |
| 212 | updateTaskCard(element, taskInfo, plugin, visibleProperties, { propertyLabels }); |
| 213 | |
| 214 | // Add update animation |
| 215 | element.classList.add("task-card--updated"); |
| 216 | window.setTimeout(() => { |
| 217 | element.classList.remove("task-card--updated"); |
| 218 | }, 1000); |
| 219 | } catch (error) { |
| 220 | tasknotesLogger.error("[ViewOptimizations] Error updating task element in place:", { |
| 221 | category: "persistence", |
| 222 | operation: "updating-task-element-place", |
| 223 | error: error, |
| 224 | }); |
| 225 | // Could fallback to full refresh here if needed |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Performance monitoring utility for debugging |
no test coverage detected