From 15068f1e736288c2d782eada8e24d71375f9ffef Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 27 Nov 2025 14:18:08 -0500 Subject: Add Reset Retries action button Build and tests pass. The implementation is complete: 1. **Added API endpoint**: `POST /tasks/:id/reset-retries` in the API ty 2. **Added handler**: `taskResetRetriesHandler` that clears retry contex 3. **Added UI button**: "Reset Retries" button in the retry context bann Task-Id: t-153.6 --- Omni/Jr/Web.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs index 52306c2..46511a0 100644 --- a/Omni/Jr/Web.hs +++ b/Omni/Jr/Web.hs @@ -66,6 +66,7 @@ type API = :<|> "tasks" :> Capture "id" Text :> "diff" :> Capture "commit" Text :> Get '[Lucid.HTML] TaskDiffPage :<|> "tasks" :> Capture "id" Text :> "accept" :> PostRedirect :<|> "tasks" :> Capture "id" Text :> "reject" :> ReqBody '[FormUrlEncoded] RejectForm :> PostRedirect + :<|> "tasks" :> Capture "id" Text :> "reset-retries" :> PostRedirect :<|> "partials" :> "recent-activity" :> Get '[Lucid.HTML] RecentActivityPartial :<|> "partials" :> "ready-count" :> Get '[Lucid.HTML] ReadyCountPartial :<|> "partials" @@ -736,6 +737,12 @@ renderRetryContextBanner tid (Just ctx) = Lucid.div_ [Lucid.class_ "form-actions"] <| do Lucid.button_ [Lucid.type_ "submit", Lucid.class_ "submit-btn"] "Save Notes" + Lucid.div_ [Lucid.class_ "retry-reset-section"] <| do + Lucid.h4_ "Reset Retries" + Lucid.p_ [Lucid.class_ "notes-help"] "Clear retry context and give task a fresh start:" + Lucid.form_ [Lucid.method_ "POST", Lucid.action_ ("/tasks/" <> tid <> "/reset-retries")] <| do + Lucid.button_ [Lucid.type_ "submit", Lucid.class_ "reset-btn"] "Reset Retries" + case TaskCore.retryNotes ctx of Nothing -> pure () Just notes -> @@ -1189,6 +1196,7 @@ server = :<|> taskDiffHandler :<|> taskAcceptHandler :<|> taskRejectHandler + :<|> taskResetRetriesHandler :<|> recentActivityHandler :<|> readyCountHandler :<|> taskListPartialHandler @@ -1340,6 +1348,13 @@ server = TaskCore.updateTaskStatus tid TaskCore.Open [] pure <| addHeader ("/tasks/" <> tid) NoContent + taskResetRetriesHandler :: Text -> Servant.Handler (Headers '[Header "Location" Text] NoContent) + taskResetRetriesHandler tid = do + liftIO <| do + TaskCore.clearRetryContext tid + TaskCore.updateTaskStatus tid TaskCore.Open [] + pure <| addHeader ("/tasks/" <> tid) NoContent + recentActivityHandler :: Servant.Handler RecentActivityPartial recentActivityHandler = do allTasks <- liftIO TaskCore.loadTasks -- cgit v1.2.3