Cancel button

merged…
osebo42d ago

Can you restyle the cancel button so it’s next to post and run

3 repliesoldestnewest
Osebotfable-5-142d ago

Today the cancel control in the open composer is a small underlined text link after the Post button. On phones Post stretches to its own full-width line, so "cancel" lands alone on the line below it.

Plan:

  • components/composer.tsx: wrap Post / Post & run and Cancel in one .compose-actions group; Cancel becomes a proper button (button.compose-cancel, label "Cancel") instead of button.link.
  • app/globals.css: Cancel joins the secondary fill-button rule (same look as Top / Stop / Merge). On ≤560px the group takes the full line, Post stretches (label still left-aligned as the owner asked before) and Cancel sits beside it at natural width.
  • Mockup screenshot at 390px and desktop width to show the result.
Osebotfable-5-142d agothreadide@eb00074

Done on thread/aebe948e (threadide eb00074).

What changed

  • components/composer.tsx: Post / Post & run and Cancel are now one div.compose-actions group at the end of the row. Cancel is a real button (button.compose-cancel, label "Cancel") instead of the underlined button.link text link.
  • app/globals.css: Cancel joins the secondary fill-button rule shared with Top / Stop / Merge. On ≤560px the group takes its own line, Post stretches with its label still left-aligned (your earlier request on thread/4f9142c7), Cancel sits beside it at natural width. On wider screens they're simply adjacent after the Kind select.

Before → after (phone): Post was a full-width line with "cancel" as a tiny link on the line below; now it's [ POST & RUN ][ CANCEL ] on one line. Desktop: the link after Post becomes a grey Cancel button next to it.

Verified: tsc --noEmit clean; mockup screenshots (real globals.css) at 390px and 760px, light and dark, attached. Not run in the live app (needs DB + OAuth). Behaviour is unchanged: Cancel folds the form and keeps the draft, Escape still works.

PR description is written; the PR opens when this run ends.

Open composer after the change, 390px phone (left) and 760px desktop (right): Cancel is a fill button beside Post & run
Open composer after the change, 390px phone (left) and 760px desktop (right): Cancel is a fill button beside Post & run
Diff · 2 files
diff --git a/threadide/components/composer.tsx b/threadide/components/composer.tsx
--- a/threadide/components/composer.tsx
+++ b/threadide/components/composer.tsx
@@ -196,10 +196,13 @@
             </select>
           </label>
-          <button disabled={busy || !body.trim() || tooLong}>{busy ? "Posting…" : canAsk && askClaude ? (guest ? "Post as guest & run" : "Post & run") : guest ? "Post as guest" : "Post"}</button>
-          <button type="button" className="link compose-cancel" onClick={() => setOpen(false)} disabled={busy}>
-            cancel
-          </button>
+          {/* Post and Cancel are one group so they share a line at every width (phones give the group its own row). */}
+          <div className="compose-actions">
+            <button disabled={busy || !body.trim() || tooLong}>{busy ? "Posting…" : canAsk && askClaude ? (guest ? "Post as guest & run" : "Post & run") : guest ? "Post as guest" : "Post"}</button>
+            <button type="button" className="compose-cancel" onClick={() => setOpen(false)} disabled={busy}>
+              Cancel
+            </button>
+          </div>
         </div>
diff --git a/threadide/app/globals.css b/threadide/app/globals.css
--- a/threadide/app/globals.css
+++ b/threadide/app/globals.css
@@ -576,8 +576,9 @@
   .row-right { margin-left: 0; }
   /* Post button gets its own full-width line: a proper thumb target, nothing overflows. The label sits at the
      LEFT edge of the wide button (owner request, thread/4f9142c7), not centred; natural-width buttons are unaffected. */
-  form.compose .row > button { flex: 1 1 100%; justify-content: flex-start; text-align: left; }
-  form.compose .row > button.link.compose-cancel { justify-content: center; }
+  form.compose .row > .compose-actions { flex: 1 1 100%; }
+  form.compose .compose-actions > button { flex: 1 1 auto; justify-content: flex-start; text-align: left; }
+  form.compose .compose-actions > button.compose-cancel { flex: none; justify-content: center; }
 }
@@ -732,10 +733,12 @@
-/* Escape in the textarea or this link folds the form back up; the draft stays in memory. */
-form.compose .row > button.link.compose-cancel { flex: none; }
-/* Secondary buttons (plain fill, no frame): Top, Stop and Merge. `button.foo` selectors so they
+/* Post (+ run) and Cancel sit together as one group at the end of the row (thread/aebe948e: owner wanted Cancel
+   next to Post, not a text link below it). Escape in the textarea or Cancel folds the form back up; the draft stays in memory. */
+form.compose .compose-actions { display: inline-flex; align-items: center; gap: 8px; }
+/* Secondary buttons (plain fill, no frame): Top, Stop, Merge and the composer's Cancel. `button.foo` selectors so they
    beat the generic button / button:hover rules above. */
-button.jump-top, button.stop-run, button.merge-pr { background: var(--fill); color: var(--text); flex: none; }
-button.jump-top:hover:not(:disabled), button.stop-run:hover:not(:disabled), button.merge-pr:hover:not(:disabled) { background: var(--fill-hover); color: var(--text); }
+button.jump-top, button.stop-run, button.merge-pr, button.compose-cancel { background: var(--fill); color: var(--text); flex: none; }
+button.jump-top:hover:not(:disabled), button.stop-run:hover:not(:disabled), button.merge-pr:hover:not(:disabled), button.compose-cancel:hover:not(:disabled) { background: var(--fill-hover); color: var(--text); }
Osebot42d ago

Merged threadide #94 by @osebo (merge, 8d5e115).