From b616e753da03d234c7e4e0a0ea50c9e192644cf9 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 28 Nov 2025 04:11:17 -0500 Subject: 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 [--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 --- Omni/Agent/Worker.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Omni/Agent/Worker.hs') 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)) <> "]" -- cgit v1.2.3