summaryrefslogtreecommitdiff
path: root/Omni/Jr/Web.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-01 12:37:37 -0500
committerBen Sima <ben@bensima.com>2025-12-01 12:37:37 -0500
commit41fc5370fd9f7b7fe5486f4c35321f28f093720e (patch)
treed01237d025ca674bf3c9ee3266586ec376be72da /Omni/Jr/Web.hs
parent726f71e6c2b697d198eb35f2ba9e3f19ee7b2482 (diff)
Fix timeline and metrics HTMX partial issues
- Timeline partial now uses getAllEventsForTask instead of getEventsForSession so all events show after HTMX refresh, not just the latest session - Move Execution Details header outside HTMX swap target so it persists Task-Id: t-214, t-215
Diffstat (limited to 'Omni/Jr/Web.hs')
-rw-r--r--Omni/Jr/Web.hs17
1 files changed, 6 insertions, 11 deletions
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index 2fc2064..ecc851d 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -1577,12 +1577,12 @@ instance Lucid.ToHtml TaskDetailPage where
Lucid.makeAttribute "hx-trigger" "every 5s",
Lucid.makeAttribute "hx-swap" "innerHTML"
]
- sectionAttrs =
- [Lucid.class_ "execution-section", Lucid.id_ "execution-details"]
+ innerAttrs =
+ [Lucid.id_ "execution-details-inner"]
<> [attr | isInProgress, attr <- htmxAttrs]
- Lucid.div_ sectionAttrs <| do
+ Lucid.div_ [Lucid.class_ "execution-section"] <| do
Lucid.h3_ "Execution Details"
- renderExecutionDetails (TaskCore.taskId task) activities maybeRetry
+ Lucid.div_ innerAttrs <| renderExecutionDetails (TaskCore.taskId task) activities maybeRetry
when (TaskCore.taskStatus task == TaskCore.Review) <| do
Lucid.div_ [Lucid.class_ "review-link-section"] <| do
@@ -3057,14 +3057,9 @@ server =
pure (TaskMetricsPartial tid activities maybeRetry now)
agentEventsPartialHandler :: Text -> Maybe Int -> Servant.Handler AgentEventsPartial
- agentEventsPartialHandler tid maybeSince = do
+ agentEventsPartialHandler tid _maybeSince = do
now <- liftIO getCurrentTime
- maybeSession <- liftIO (TaskCore.getLatestSessionForTask tid)
- events <- case maybeSession of
- Nothing -> pure []
- Just sid -> case maybeSince of
- Nothing -> liftIO (TaskCore.getEventsForSession sid)
- Just lastId -> liftIO (TaskCore.getEventsSince sid lastId)
+ events <- liftIO (TaskCore.getAllEventsForTask tid)
tasks <- liftIO TaskCore.loadTasks
let isInProgress = case TaskCore.findTask tid tasks of
Nothing -> False