← Back to task

Commit 926018e9

commit 926018e989cba4286c98eb2682e51ef32b2ee0c8
Author: Ben Sima <ben@bensima.com>
Date:   Sat Nov 29 20:35:09 2025

    Fix Cancel button on description edit form
    
    The fix is complete:
    
    1. Changed the Cancel element from `<a href="#">` to `<button
    type="butt 2. Added button reset styling (transparent background,
    no border, underl
    
    The `<button>` element works better with HTMX because it doesn't
    have th
    
    Task-Id: t-178

diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index a4fdee1b..bed26a62 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -1838,8 +1838,8 @@ instance Lucid.ToHtml DescriptionEditPartial where
     Lucid.div_ [Lucid.id_ "description-block", Lucid.class_ "description-block editing"] <| do
       Lucid.div_ [Lucid.class_ "description-header"] <| do
         Lucid.h3_ (if isEpic then "Design" else "Description")
-        Lucid.a_
-          [ Lucid.href_ "#",
+        Lucid.button_
+          [ Lucid.type_ "button",
             Lucid.class_ "cancel-link",
             Lucid.makeAttribute "hx-get" ("/tasks/" <> tid <> "/description/view"),
             Lucid.makeAttribute "hx-target" "#description-block",
diff --git a/Omni/Jr/Web/Style.hs b/Omni/Jr/Web/Style.hs
index 6399f2f0..0628c536 100644
--- a/Omni/Jr/Web/Style.hs
+++ b/Omni/Jr/Web/Style.hs
@@ -406,7 +406,13 @@ cardStyles = do
   ".edit-link" <> ".cancel-link" ? do
     fontSize (px 12)
     color "#0066cc"
-  ".cancel-link" ? color "#dc2626"
+  "button.cancel-link" ? do
+    color "#dc2626"
+    backgroundColor transparent
+    border (px 0) solid transparent
+    padding (px 0) (px 0) (px 0) (px 0)
+    cursor pointer
+    textDecoration underline
   ".diff-block" ? do
     maxHeight (px 600)
     overflowY auto
@@ -1423,7 +1429,10 @@ darkModeStyles =
     ".edit-description" ? borderTopColor "#374151"
     (".edit-description" |> "summary") ? color "#60a5fa"
     ".edit-link" ? color "#60a5fa"
-    ".cancel-link" ? color "#f87171"
+    "button.cancel-link" ? do
+      color "#f87171"
+      backgroundColor transparent
+      border (px 0) solid transparent
     ".description-textarea" ? do
       backgroundColor "#374151"
       borderColor "#4b5563"