From 896d45201565269f8b870c512e848bee77bec3ca Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 19 Dec 2023 16:22:04 +0100 Subject: [PATCH] DEV: patchbot: use checked buttons as reference instead of internal table The statuses[] table was pre-filled from the shell code during initialization based on the evaluation and the buttons pre-checked accordingly, but upon reload, the checked buttons are preserved and the statuses reinitialized, leading to a different status and color on lines that were changed. In practice we don't need this table and we can directly check each button's state. This makes sure that displayed state is consistent with checked buttons and allows to preserve the statuses upon reloads to benefit from updates. Only the start of the review is reset upon reload now (this allows to consider latest backport state). Of course, a full reload (shift-ctrl-R) continues to reset the form. --- dev/patchbot/scripts/post-ai.sh | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/dev/patchbot/scripts/post-ai.sh b/dev/patchbot/scripts/post-ai.sh index 9d66d23b9..9b34cc193 100755 --- a/dev/patchbot/scripts/post-ai.sh +++ b/dev/patchbot/scripts/post-ai.sh @@ -135,8 +135,7 @@ input.y[type="radio"]:checked {