commit 3611e15f055d3cf39cbd206e2d6d46a01b4df6ef
Author: Ben Sima <ben@bensima.com>
Date: Wed Nov 26 09:26:00 2025
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
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index 107df95b..4fd77b6a 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