summaryrefslogtreecommitdiff
path: root/Omni
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-26 09:26:00 -0500
committerBen Sima <ben@bensima.com>2025-11-26 09:26:00 -0500
commit3611e15f055d3cf39cbd206e2d6d46a01b4df6ef (patch)
tree93a83994f1f9cda7aab8639b563a25be883b0aa6 /Omni
parenta1e4183e8a84bc8d8f8cc56e0ea5c6963d52923b (diff)
Implement ready queue view (GET /ready)
The implementation is complete. The `/ready` route was already partially 1. **Priority sorting**: Added `List.sortBy (compare `on` TaskCore.taskP 2. **Heading format**: Changed from a badge-style count to the specified Task-Id: t-1o2g8gugkr1.7
Diffstat (limited to 'Omni')
-rw-r--r--Omni/Jr/Web.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index 107df95..4fd77b6 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -211,9 +211,7 @@ instance Lucid.ToHtml ReadyQueuePage where
Lucid.style_ readyStyles
Lucid.body_ <| do
Lucid.p_ <| Lucid.a_ [Lucid.href_ "/"] "← Back to Dashboard"
- Lucid.h1_ <| do
- "Ready Queue "
- Lucid.span_ [Lucid.class_ "count-badge"] (Lucid.toHtml (tshow (length tasks)))
+ Lucid.h1_ <| Lucid.toHtml ("Ready Queue (" <> tshow (length tasks) <> " tasks)")
if null tasks
then Lucid.p_ [Lucid.class_ "empty-msg"] "No tasks are ready for work."
else Lucid.div_ [Lucid.class_ "task-list"] <| traverse_ renderTask tasks
@@ -693,7 +691,8 @@ server =
readyQueueHandler :: Servant.Handler ReadyQueuePage
readyQueueHandler = do
readyTasks <- liftIO TaskCore.getReadyTasks
- pure (ReadyQueuePage readyTasks)
+ let sortedTasks = List.sortBy (compare `on` TaskCore.taskPriority) readyTasks
+ pure (ReadyQueuePage sortedTasks)
taskListHandler :: Servant.Handler TaskListPage
taskListHandler = do