Compare commits

...

2 Commits

3 changed files with 50 additions and 37 deletions

View File

@ -1 +1 @@
v20260101-11-run-checks-select-all-indeterminate-clear-selection v20260101-12-run-checks-select-all-indeterminate-clear-selection-fix

View File

@ -279,38 +279,6 @@
var btnMark = document.getElementById('btn_mark_reviewed'); var btnMark = document.getElementById('btn_mark_reviewed');
var btnUnmark = document.getElementById('btn_unmark_reviewed'); var btnUnmark = document.getElementById('btn_unmark_reviewed');
var statusEl = document.getElementById('rc_status'); var statusEl = document.getElementById('rc_status');
// Header checkbox behavior:
// - When indeterminate (partial selection), clicking/pressing Space clears all selections.
// - Otherwise behaves as a normal "select all / select none".
function clearAllSelections() {
var cbs = table.querySelectorAll('tbody .rc_row_cb');
cbs.forEach(function (cb) { cb.checked = false; });
if (selectAll) {
selectAll.indeterminate = false;
selectAll.checked = false;
}
updateButtons();
}
if (selectAll) {
selectAll.addEventListener('click', function (e) {
if (selectAll.indeterminate) {
e.preventDefault();
e.stopPropagation();
clearAllSelections();
}
});
selectAll.addEventListener('keydown', function (e) {
// Space toggles checkbox via keyboard
if ((e.key === ' ' || e.key === 'Spacebar' || e.code === 'Space') && selectAll.indeterminate) {
e.preventDefault();
e.stopPropagation();
clearAllSelections();
}
});
}
var currentJobId = null; var currentJobId = null;
var currentRunId = null; var currentRunId = null;
@ -413,13 +381,50 @@ function statusClass(status) {
} }
if (selectAll) { if (selectAll) {
function clearAllSelection() {
var cbs = table.querySelectorAll('tbody .rc_row_cb');
cbs.forEach(function (cb) { cb.checked = false; });
// Ensure header checkbox is reset as well.
selectAll.indeterminate = false;
selectAll.checked = false;
updateButtons();
}
// When the header checkbox is indeterminate (partial selection), users expect a click
// to clear the selection, not to select everything.
var selectAllWasIndeterminate = false;
selectAll.addEventListener('mousedown', function () {
selectAllWasIndeterminate = !!selectAll.indeterminate;
}, true);
selectAll.addEventListener('click', function (e) {
if (selectAllWasIndeterminate) {
e.preventDefault();
e.stopPropagation();
clearAllSelection();
selectAllWasIndeterminate = false;
}
}, true);
selectAll.addEventListener('keydown', function (e) {
// Space toggles checkboxes. If indeterminate, treat Space as "clear selection".
if ((e.key === ' ' || e.code === 'Space') && selectAll.indeterminate) {
e.preventDefault();
e.stopPropagation();
clearAllSelection();
}
}, true);
selectAll.addEventListener('change', function () { selectAll.addEventListener('change', function () {
// Safety net: in case the checkbox becomes checked while it was indeterminate, // Safety net: if any browser still fires change after an indeterminate click,
// treat it as "clear all" (expected UX). // force the expected "clear" behavior.
if (selectAll.indeterminate && selectAll.checked) { if (selectAllWasIndeterminate) {
clearAllSelections(); clearAllSelection();
selectAllWasIndeterminate = false;
return; return;
} }
var cbs = table.querySelectorAll('tbody .rc_row_cb'); var cbs = table.querySelectorAll('tbody .rc_row_cb');
cbs.forEach(function (cb) { cb.checked = selectAll.checked; }); cbs.forEach(function (cb) { cb.checked = selectAll.checked; });
updateButtons(); updateButtons();

View File

@ -184,6 +184,14 @@
- Prevented unintended full selection when toggling from an indeterminate state. - Prevented unintended full selection when toggling from an indeterminate state.
- Ensured consistent behavior between mouse click and keyboard (Space) interaction on the header checkbox. - Ensured consistent behavior between mouse click and keyboard (Space) interaction on the header checkbox.
---
## v20260101-12-run-checks-select-all-indeterminate-clear-selection-fix
- Fixed the Run Checks header “select all” checkbox: when it is indeterminate (partial selection), clicking it now clears the current selection instead of selecting all rows.
- Implemented click interception before the browser toggles the checkbox state to prevent unintended full selection from the indeterminate state.
- Added consistent keyboard behavior: pressing Space on the indeterminate header checkbox now also clears the selection.
================================================================================================================================================ ================================================================================================================================================
## v0.1.14 ## v0.1.14