From 3611e15f055d3cf39cbd206e2d6d46a01b4df6ef Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 26 Nov 2025 09:26:00 -0500 Subject: 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 --- Omni/Jr/Web.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Omni') 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 -- cgit v1.2.3