thunderbird-patch-review

Easy-to-use patch review interface for Thunderbird

Contribute: ~marcc/thunderbird-review-plugin@lists.sr.ht

git clone git://mccd.space/thunderbird-patch-review

commit 96828e747f84883fa26d6320ace855eb047be15d
parent 8de066f9af393dd265ee29e5237821432ba3b49d
Author: Pi Agent <agent@pi.local>
Date:   Sat, 18 Jul 2026 13:41:20 +0200

review: move Discard drafts into the Send review dropdown

The Discard drafts button was a prominent red control in the toolbar;
move it under the Send review split button's menu as a borderline item
instead, keeping the confirmation dialog. setupSplit now skips menu
buttons marked data-bypass so the discard action does not get routed
through sendReview.

Diffstat:
Mextension/review/review.css | 10++++------
Mextension/review/review.html | 2+-
Mextension/review/review.js | 2++
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/extension/review/review.css b/extension/review/review.css
@@ -110,18 +110,16 @@ button {
 
 button:hover { border-color: var(--accent); color: var(--accent); }
 
-#btn-discard {
-  border-color: #cf222e;
+.split .menu button.danger {
   color: #cf222e;
 }
-#btn-discard:hover {
+.split .menu button.danger:hover {
   background: #cf222e;
-  border-color: #cf222e;
   color: #fff;
 }
 @media (prefers-color-scheme: dark) {
-  #btn-discard { border-color: #f85149; color: #f85149; }
-  #btn-discard:hover { background: #f85149; border-color: #f85149; color: #0d1117; }
+  .split .menu button.danger { color: #f85149; }
+  .split .menu button.danger:hover { background: #f85149; color: #0d1117; }
 }
 button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
 button.primary:hover { color: #fff; opacity: 0.9; }
diff --git a/extension/review/review.html b/extension/review/review.html
@@ -9,7 +9,6 @@
   <header id="topbar">
     <div id="series-title">Loading…</div>
     <div id="actions">
-      <button id="btn-discard" title="Discard all draft comments in this series" hidden>Discard drafts…</button>
       <span id="comment-count" title="Draft comments">0 comments</span>
       <input id="repo-path" type="text" placeholder="repository path" spellcheck="false">
       <button id="btn-browse" title="Choose the repository directory">Browse…</button>
@@ -33,6 +32,7 @@
         <div class="menu" hidden>
           <button data-mode="send">Send now</button>
           <button data-mode="preview">Preview in compose…</button>
+          <button id="btn-discard" class="danger" data-bypass="1" hidden>Discard drafts…</button>
         </div>
       </div>
     </div>
diff --git a/extension/review/review.js b/extension/review/review.js
@@ -465,6 +465,7 @@ function updateCount() {
 }
 
 $("#btn-discard").addEventListener("click", async () => {
+  closeMenus();
   const total = state.comments.reduce((sum, c) => sum + Object.keys(c).length, 0);
   if (total === 0) return;
   const fill = total === 1 ? `the 1 draft comment` : `all ${total} draft comments`;
@@ -528,6 +529,7 @@ function setupSplit(splitId, onPick) {
     menu.hidden = !wasHidden;
   });
   menu.querySelectorAll("button").forEach((button) => {
+    if (button.dataset.bypass) return;
     button.addEventListener("click", () => {
       closeMenus();
       onPick(button.dataset.mode);