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
| Log | Files | Refs | README | LICENSE |
commit 7c437ccaa58123c9eee1c2a6027953db6cce34cd parent bce9576f90902b376174f9d4bbadce2299cd401c Author: Pi Agent <agent@pi.local> Date: Sat, 18 Jul 2026 22:33:33 +0200 review: reword the title to summarize the patchset and comments Diffstat:
| M | extension/review/review.js | | | 24 | +++++++++++++++--------- |
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/extension/review/review.js b/extension/review/review.js
@@ -72,17 +72,22 @@ async function init() {
// ---------------------------------------------------------------------------
// Rendering
-// The top-left title is static-colored but reflects the currently viewed
-// patch of the series ("Reviewing cover", "Reviewing patch N").
+// The top-left title summarises the whole series under review: the patch
+count and the total draft comments across it. Updated on init, on patch
+// switch, and whenever comments change.
function renderSeriesTitle() {
- const current = state.series[state.current];
- let text = "Review";
- if (current) {
- if (current.isCover) text = "Reviewing cover";
- else if (current.n !== null && current.m) text = `Reviewing patch ${current.n}`;
- else text = "Reviewing patch";
+ if (!state.series.length) {
+ $("#series-title").textContent = "Review";
+ return;
}
- $("#series-title").textContent = text;
+ const n = state.series.length;
+ const total = state.comments.reduce((sum, c) => sum + Object.keys(c).length, 0);
+ const parts = [
+ "Reviewing patchset",
+ `(${n} patch${n === 1 ? "" : "es"})`,
+ ];
+ if (total) parts.push(`${total} comment${total === 1 ? "" : "s"}`);
+ $("#series-title").textContent = parts.join(" — ");
}
function renderNav() {
@@ -482,6 +487,7 @@ function updateCount() {
// One reply per commented patch — pluralize the button to match.
const commented = state.series.filter((_, i) => Object.keys(state.comments[i]).length).length;
$("#btn-send").firstChild.nodeValue = commented === 1 ? "Send review" : "Send reviews";
+ renderSeriesTitle();
}
$("#btn-discard").addEventListener("click", async () => {