summaryrefslogtreecommitdiff
path: root/Omni
diff options
context:
space:
mode:
Diffstat (limited to 'Omni')
-rw-r--r--Omni/Jr/Web.hs15
1 files changed, 15 insertions, 0 deletions
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