commit 4c99fed85e1241f022499cb17f68f132ef35a8a2
Author: Coder Agent <coder@agents.omni>
Date: Wed Feb 18 13:59:38 2026
Add close/done button to task detail web page
Add a 'Close Task' button to the task detail page that sets status
to Done via HTMX POST to the existing status update endpoint. The
button is only shown when the task status is not already Done, and
removes itself from the DOM after successful submission. Styled as
a subtle green-outlined button to be discoverable but not dominant.
Task-Id: t-638
diff --git a/Omni/Task/Web/Pages.hs b/Omni/Task/Web/Pages.hs
index 5c38be90..62f08a32 100644
--- a/Omni/Task/Web/Pages.hs
+++ b/Omni/Task/Web/Pages.hs
@@ -622,6 +622,23 @@ instance Lucid.ToHtml TaskDetailPage where
]
"Review This Task"
+ when (TaskCore.taskStatus task /= TaskCore.Done) <| do
+ Lucid.div_ [Lucid.class_ "close-task-section"] <| do
+ Lucid.form_
+ [ Lucid.class_ "close-task-form",
+ Lucid.makeAttribute "hx-post" ("/tasks/" <> TaskCore.taskId task <> "/status"),
+ Lucid.makeAttribute "hx-target" "#status-badge-container",
+ Lucid.makeAttribute "hx-swap" "outerHTML",
+ Lucid.makeAttribute "hx-on::after-request" "document.querySelector('.close-task-section')?.remove()"
+ ]
+ <| do
+ Lucid.input_ [Lucid.type_ "hidden", Lucid.name_ "status", Lucid.value_ (tshow TaskCore.Done)]
+ Lucid.button_
+ [ Lucid.type_ "submit",
+ Lucid.class_ "btn btn-close-task"
+ ]
+ "Close Task"
+
renderUnifiedTimeline (TaskCore.taskId task) (TaskCore.taskComments task) agentEvents (TaskCore.taskStatus task) now
where
renderDependency :: (Monad m) => TaskCore.Dependency -> Lucid.HtmlT m ()
diff --git a/Omni/Task/Web/Style.hs b/Omni/Task/Web/Style.hs
index 7a8d0f2c..26ccdc14 100644
--- a/Omni/Task/Web/Style.hs
+++ b/Omni/Task/Web/Style.hs
@@ -802,6 +802,17 @@ buttonStyles = do
color WebStyle.cPurple
".review-link-btn" # hover ? Stylesheet.key "background" ("rgba(167,139,250,0.25)" :: Text)
".review-link-section" ? margin (px 8) (px 0) (px 8) (px 0)
+ ".close-task-section" ? margin (px 8) (px 0) (px 8) (px 0)
+ ".close-task-form" ? display flex
+ ".btn-close-task" ? do
+ Stylesheet.key "background" ("rgba(74,222,128,0.12)" :: Text)
+ color WebStyle.cGreen
+ border (px 1) solid WebStyle.cGreen
+ borderRadius WebStyle.radiusMd WebStyle.radiusMd WebStyle.radiusMd WebStyle.radiusMd
+ padding (px 6) (px 16) (px 6) (px 16)
+ fontSize (px 13)
+ cursor pointer
+ ".btn-close-task" # hover ? Stylesheet.key "background" ("rgba(74,222,128,0.22)" :: Text)
".btn-secondary" <> ".load-more-btn" ? do
backgroundColor WebStyle.cFgMuted
color white