summaryrefslogtreecommitdiff
path: root/Omni/Jr/Web.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-01 13:13:15 -0500
committerBen Sima <ben@bensima.com>2025-12-01 13:13:15 -0500
commit720fd20245d5c832dc92ddca0fb837858f48bb16 (patch)
treedab2c288af0e4c670f65ea87e8a8e0cab0ff5034 /Omni/Jr/Web.hs
parent1df86a7831f4dc9c572ee2b7406a56e518f66672 (diff)
Show task complexity on /tasks/<id> page
Perfect! The implementation is complete. Let me create a summary of what I have successfully implemented the task complexity indicator on the `/t 1. **Added `complexityBadge` function** in `Omni/Jr/Web.hs` (lines 685-6 - Creates a badge displaying the complexity with the ℂ symbol (comple - Format: "ℂ {1-5}" - Includes a tooltip "Task Complexity (1-5)" - Uses CSS classes for styling with different colors for each complex 2. **Integrated complexity badge into task detail page** in `Omni/Jr/Web - Added conditional rendering that only shows the badge if `taskCompl - Positioned after the priority badge with a separator (·) - Follows the same pattern as other metadata badges 3. **Added CSS styles** in `Omni/Jr/Web/Style.hs` (lines 696-713): - Base `.badge-complexity` style - Individual styles for each complexity level (1-5) with appropriate - Complexity 1: Green (easy task) - Complexity 2: Blue (moderate) - Complexity 3: Amber (medium complexity) - Complexity 4: Darker amber (high complexity) - Complexity 5: Red (very complex) - Used the ℂ (complex numbers) symbol as suggested in the task descripti - Made it non-editable (read-only badge) since complexity is set during - Only displays when complexity is set (handles `Maybe Int` gracefully) - Color scheme follows a gradient from green (easy) to red (complex) - Consistent with existing badge styling patterns in the UI ✅ All tests pass successfully with `bild --test Omni/Jr.hs` The feature is now complete and ready for use. Tasks with a complexity r Task-Id: t-207
Diffstat (limited to 'Omni/Jr/Web.hs')
-rw-r--r--Omni/Jr/Web.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index 03072bb..a316d74 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -682,6 +682,12 @@ statusBadge status =
TaskCore.Done -> ("badge badge-done", "Done")
in Lucid.span_ [Lucid.class_ cls] label
+complexityBadge :: (Monad m) => Int -> Lucid.HtmlT m ()
+complexityBadge complexity =
+ let cls = "badge badge-complexity badge-complexity-" <> tshow complexity
+ label = "ℂ " <> tshow complexity
+ in Lucid.span_ [Lucid.class_ cls, Lucid.title_ "Task Complexity (1-5)"] (Lucid.toHtml label)
+
sortDropdown :: (Monad m) => Text -> SortOrder -> Lucid.HtmlT m ()
sortDropdown basePath currentSort =
Lucid.div_ [Lucid.class_ "sort-dropdown"] <| do
@@ -1524,6 +1530,11 @@ instance Lucid.ToHtml TaskDetailPage where
statusBadgeWithForm (TaskCore.taskStatus task) (TaskCore.taskId task)
metaSep
priorityBadgeWithForm (TaskCore.taskPriority task) (TaskCore.taskId task)
+ case TaskCore.taskComplexity task of
+ Nothing -> pure ()
+ Just c -> do
+ metaSep
+ complexityBadge c
case TaskCore.taskNamespace task of
Nothing -> pure ()
Just ns -> do