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 ac9de41f8a07dfe3a659abfc604305ba4c9f3281
parent 893f427859dd63ba8ee6f2caf092e675617bde35
Author: Pi Agent <agent@pi.local>
Date:   Sat, 18 Jul 2026 13:02:59 +0200

review: show From and Subject at the top of each patch

Add a small metadata header at the top of every commit-message block —\nFrom (the patch author) and the email Subject line — with the values in\na monospace face, mirroring the top of a git-format-patch message. The\ncommit message body continues below as before.

Diffstat:
Mextension/review/review.css | 21+++++++++++++++++++++
Mextension/review/review.js | 26+++++++++++++++++++++++++-
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/extension/review/review.css b/extension/review/review.css
@@ -215,6 +215,27 @@ button.primary:hover { color: #fff; opacity: 0.9; }
 
 .commit-message .btn-general { position: absolute; top: 0.5rem; right: 0.5rem; }
 
+.commit-message .patch-headers {
+  margin: 0 0 0.5rem;
+  font: 12px/1.5 -apple-system, "Segoe UI", sans-serif;
+}
+.commit-message .patch-headers dt {
+  display: inline;
+  color: var(--muted);
+  margin-right: 0.3em;
+}
+.commit-message .patch-headers dd {
+  display: inline;
+  margin: 0;
+}
+.commit-message .patch-headers code {
+  font-family: ui-monospace, monospace;
+  color: var(--fg);
+}
+.commit-message .patch-headers > dt + dd::after { content: "\A"; white-space: pre; }
+
+.commit-message .commit-message-body { white-space: pre-wrap; }
+
 .file {
   margin-bottom: 1rem;
   border: 1px solid var(--border);
diff --git a/extension/review/review.js b/extension/review/review.js
@@ -123,9 +123,22 @@ function renderPatch() {
   // whose body starts directly at the "---" scissors).
   const msg = document.createElement("div");
   msg.className = "commit-message";
-  msg.textContent = patch.isCover
+
+  // Per-patch metadata header: who sent it and the subject line, mirroring
+  // the top of a git-format-patch / mail message. The commit message body
+  // follows below.
+  const headers = document.createElement("dl");
+  headers.className = "patch-headers";
+  headerRow("From", patch.author || "", headers);
+  headerRow("Subject", patch.subject || "", headers);
+  msg.appendChild(headers);
+
+  const body = document.createElement("div");
+  body.className = "commit-message-body";
+  body.textContent = patch.isCover
     ? parsed.commitMessage || patch.body
     : parsed.commitMessage || patch.title;
+  msg.appendChild(body);
   const generalBtn = document.createElement("button");
   generalBtn.className = "btn-general";
   generalBtn.textContent = state.comments[i][store.GENERAL] ? "Edit comment" : "Comment on patch";
@@ -164,6 +177,17 @@ function renderPatch() {
   }
 }
 
+function headerRow(name, value, into) {
+  const dt = document.createElement("dt");
+  dt.textContent = `${name}:`;
+  const dd = document.createElement("dd");
+  // Email-ish / path-ish values render better in a monospace face.
+  const code = document.createElement("code");
+  code.textContent = value || "\u00a0";
+  dd.appendChild(code);
+  into.append(dt, dd);
+}
+
 function fileLabel(file) {
   if (file.isRename) return `${file.oldPath} → ${file.newPath}`;
   if (file.isNew) return `${file.displayPath} (new file)`;