mirror of
https://github.com/CyberSecurityUP/NeuroSploit.git
synced 2026-08-26 03:12:30 +02:00
fix(web): category master switch reads as partial, not off, when only some agents are deselected
Unchecking one agent in an 8-agent category (7/8 left on) rendered the category header switch fully unchecked — visually indistinguishable from 'category disabled', even though 7 of 8 agents were still on. The checkbox's checked state only had two positions; a partial selection had nowhere to render but off. Fix: set the master switch's .indeterminate property when 0 < selected < total, with its own CSS state (grey track, thumb parked halfway) instead of the on/off track+thumb. Clicking a checkbox out of indeterminate selects everything, per browser default — unchanged behavior, just an honest visual for the in-between state. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0129WdYHccPsH27k5GGuwijd
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
3dcfeb7377
commit
040170e54a
+7
-1
@@ -183,7 +183,13 @@ function renderBoard() {
|
||||
if (e.target.closest('.switch')) return;
|
||||
card.classList.toggle('collapsed');
|
||||
});
|
||||
card.querySelector('.cat-toggle').addEventListener('change', (e) => {
|
||||
const catToggle = card.querySelector('.cat-toggle');
|
||||
// A partial selection (some but not all agents on) must look "partial",
|
||||
// not "off" — an unchecked master switch reads as "category disabled"
|
||||
// even when most of its agents are still on. Indeterminate = the middle
|
||||
// state; clicking it from there selects everything (browser default).
|
||||
catToggle.indeterminate = selCount > 0 && selCount < group.agents.length;
|
||||
catToggle.addEventListener('change', (e) => {
|
||||
const on = e.target.checked;
|
||||
for (const a of group.agents) { if (on) state.selected.add(a.id); else state.selected.delete(a.id); }
|
||||
renderBoard();
|
||||
|
||||
Reference in New Issue
Block a user