Compare commits
No commits in common. "8c40ad46783740f55cedb895d61d069ce6f590cf" and "3508404937a63f05d438c480f3d8d946478b76ae" have entirely different histories.
8c40ad4678
...
3508404937
@ -1 +1 @@
|
|||||||
v20260101-12-run-checks-select-all-indeterminate-clear-selection-fix
|
v20260101-11-run-checks-select-all-indeterminate-clear-selection
|
||||||
|
|||||||
@ -279,6 +279,38 @@
|
|||||||
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;
|
||||||
@ -381,50 +413,13 @@ 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: if any browser still fires change after an indeterminate click,
|
// Safety net: in case the checkbox becomes checked while it was indeterminate,
|
||||||
// force the expected "clear" behavior.
|
// treat it as "clear all" (expected UX).
|
||||||
if (selectAllWasIndeterminate) {
|
if (selectAll.indeterminate && selectAll.checked) {
|
||||||
clearAllSelection();
|
clearAllSelections();
|
||||||
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();
|
||||||
|
|||||||
@ -184,14 +184,6 @@
|
|||||||
- 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
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user