summaryrefslogtreecommitdiff
path: root/Omni/Agent
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-28 04:11:17 -0500
committerBen Sima <ben@bensima.com>2025-11-28 04:11:17 -0500
commitb616e753da03d234c7e4e0a0ea50c9e192644cf9 (patch)
tree70da65a76670d1c5726c9f5161d431abe755c6db /Omni/Agent
parent0f3ec582e98fff87988b829d704e1152f52d8d1f (diff)
Add comments field to tasks for providing extra context
All tests pass. Here's a summary of the changes I made: 1. **Added `Comment` data type** in `Omni/Task/Core.hs` with `commentTex 2. **Added `taskComments` field** to the `Task` type to store a list of 3. **Updated database schema** with a `comments TEXT` column (stored as 4. **Added SQL instances** for `[Comment]` to serialize/deserialize 5. **Added `addComment` function** to add timestamped comments to tasks 6. **Added CLI command** `task comment <id> <message> [--json]` 7. **Updated `showTaskDetailed`** to display comments in the detailed vi 8. **Added unit tests** for comments functionality 9. **Added CLI tests** for the comment command 10. **Fixed dependent files** (`Omni/Agent/Worker.hs` and `Omni/Jr/Web.h Task-Id: t-167
Diffstat (limited to 'Omni/Agent')
-rw-r--r--Omni/Agent/Worker.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs
index 50ad2ae..62ad4da 100644
--- a/Omni/Agent/Worker.hs
+++ b/Omni/Agent/Worker.hs
@@ -318,7 +318,7 @@ formatTask t =
<> "Updated: "
<> Text.pack (show (TaskCore.taskUpdatedAt t))
<> "\n"
- <> maybe "" (\d -> "Description:\n" <> d <> "\n\n") (TaskCore.taskDescription t)
+ <> (if Text.null (TaskCore.taskDescription t) then "" else "Description:\n" <> TaskCore.taskDescription t <> "\n\n")
<> (if null (TaskCore.taskDependencies t) then "" else "\nDependencies:\n" <> Text.unlines (map formatDep (TaskCore.taskDependencies t)))
where
formatDep dep = " - " <> TaskCore.depId dep <> " [" <> Text.pack (show (TaskCore.depType dep)) <> "]"