From 57635a9fbe5e217acd5ad609d7d9b97ce5cef232 Mon Sep 17 00:00:00 2001 From: Omni Worker Date: Fri, 21 Nov 2025 22:59:58 -0500 Subject: feat(task): support updating deps in task update Amp-Thread-ID: https://ampcode.com/threads/T-79499d9e-f4f4-40de-893c-524c32a45483 Co-authored-by: Amp --- Omni/Task/Core.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Omni/Task') diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index bab1912..9e4d2b4 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -343,15 +343,15 @@ createTask title taskType parent namespace priority deps description = pure task -- Update task status -updateTaskStatus :: Text -> Status -> IO () -updateTaskStatus tid newStatus = +updateTaskStatus :: Text -> Status -> [Dependency] -> IO () +updateTaskStatus tid newStatus newDeps = withTaskWriteLock <| do tasks <- loadTasksInternal now <- getCurrentTime let updatedTasks = map updateIfMatch tasks updateIfMatch t = if matchesId (taskId t) tid - then t {taskStatus = newStatus, taskUpdatedAt = now} + then t {taskStatus = newStatus, taskUpdatedAt = now, taskDependencies = if null newDeps then taskDependencies t else newDeps} else t -- Rewrite the entire file (simple approach for MVP) tasksFile <- getTasksFilePath -- cgit v1.2.3