From b39d2afe4887855aaa8c540207c356f22dc984d8 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 6 Jul 2026 20:33:03 +0200 Subject: [PATCH] DEV: patchbot: keep the review start in sync with the radios on reload When the page is reloaded, the browser restores the "review" radio column to the user's last selection (e.g. "All"), but the "review" JS variable is regenerated to the default first line to review: the listing then restarts from that line while "All" still appears selected, and one has to click a random line then "All" again to really see everything. Give an id to each line's review radio and resynchronize the variable from the actually checked radio when the page loads: a restored "All" (or any restored line) now behaves as selected, and on a fresh load the checked radio is the generated one so nothing changes. --- dev/patchbot/scripts/post-ai.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/dev/patchbot/scripts/post-ai.sh b/dev/patchbot/scripts/post-ai.sh index cfd21a00a..654a6a161 100755 --- a/dev/patchbot/scripts/post-ai.sh +++ b/dev/patchbot/scripts/post-ai.sh @@ -267,6 +267,26 @@ function show_only(b,n,u,w,y) { updt(0,"r"); } +// Resynchronizes the review variable with the checked review radio: across +// a reload, the browser restores the radios to the user's last selection +// (e.g. "All") while the variable is regenerated to the default first line +// to review, and the listing would not match the checked radio anymore. +function init_review() { + var i, el; + + if (document.getElementById("show_all").checked) { + review = 0; + return; + } + for (i = 1; i <= nb_patches; i++) { + el = document.getElementById("rv_" + i); + if (el && el.checked) { + review = i; + return; + } + } +} + // --> @@ -383,7 +403,7 @@ for patch in "${PATCHES[@]}"; do resp=$(echo "$resp" | sed -e "s|\([0-9a-f]\{7,40\}\)|\1|g") echo -n "$seq_num
" - echo -n "" + echo -n "" echo -n "$cid${date:+
$date}" echo -n "${pnum:+$pnum }$subj${author:+
$author
}" echo -n "" @@ -406,12 +426,12 @@ for patch in "${PATCHES[@]}"; do fi done -echo "New
CIDSubjectVerdict
N U W Y
Reason" +echo "New
CIDSubjectVerdict
N U W Y
Reason" echo "" echo "

" echo "

Output:

" echo "" echo "

" -echo "" +echo "" echo "" -- 2.47.3