ui: let indeterminate state win over checked in group checkboxes

The checkbox indicator snippet renders the check icon whenever
checked, so the mixed state never showed. Pass the checked prop
as false while indeterminate.

Assisted-by: pi
This commit is contained in:
Aleksander Grygier
2026-08-27 11:03:12 +02:00
committed by GitHub
parent 20b0733cee
commit b520daf9a7
2 changed files with 3 additions and 3 deletions
@@ -281,7 +281,7 @@
</span>
<Checkbox
{checked}
checked={checked && !indeterminate}
class="{ICON_CLASS_DEFAULT} shrink-0"
{indeterminate}
onCheckedChange={() => toolsPanel.toggleGroupByKey(group.key)}
@@ -79,7 +79,7 @@
{@const isExpanded = toolsPanel.expandedGroups.has(group.key)}
{@const checked = toolsPanel.isGroupChecked(group)}
{@const enabledCount = toolsPanel.getEnabledToolCount(group)}
// parent on but nothing under it enabled, or partially enabled: show mixed state
<!-- mixed state: parent on but nothing or only part of it enabled -->
{@const indeterminate =
group.tools.length > 0 && (enabledCount === 0 ? checked : enabledCount < group.tools.length)}
{@const favicon = toolsPanel.getFavicon(group)}
@@ -124,7 +124,7 @@
{#snippet child({ props })}
<Checkbox
{...props}
{checked}
checked={checked && !indeterminate}
class="mr-2 {ICON_CLASS_DEFAULT} shrink-0"
{indeterminate}
onCheckedChange={() => toolsPanel.toggleGroupByKey(group.key)}