From f7b875b650e791f604fcf35e04f06310352cb352 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 29 Nov 2025 20:40:25 -0500 Subject: Add cost and duration metrics to homepage Task Status section The implementation is complete. The build passed with `bild --test Omni/ **Summary of changes:** 1. **Omni/Task/Core.hs**: Added `getGlobalAggregatedMetrics :: IO Aggreg 2. **Omni/Jr/Web.hs**: - Updated `HomePage` data type to include `AggregatedMetrics` paramet - Updated `homeHandler` to fetch global metrics via `getGlobalAggrega - Updated `ToHtml HomePage` instance to add two new cards: "Cost" (fo - Added helper functions `metricCard`, `formatCost`, and `formatDurat 3. **Omni/Jr/Web/Style.hs**: Added `badge-neutral` CSS styling (gray bor Task-Id: t-179 --- Omni/Task/Core.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Omni/Task') diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index 773a01f..722e696 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -1320,6 +1320,28 @@ getAggregatedMetrics epicId = do (Just start, Just end) -> floor (diffUTCTime end start) _ -> 0 +-- | Get aggregated metrics for all tasks globally (not scoped to an epic) +getGlobalAggregatedMetrics :: IO AggregatedMetrics +getGlobalAggregatedMetrics = do + allTasks <- loadTasks + let completedCount = length [t | t <- allTasks, taskStatus t == Done] + taskIds = map taskId allTasks + activities <- concat floor (diffUTCTime end start) + _ -> 0 + -- | Get tasks with unmet blocking dependencies (not ready, not done) getBlockedTasks :: IO [Task] getBlockedTasks = do -- cgit v1.2.3