A parent must show mixed when only some children are selected
Aliases: bubble-up · tree mixed · children drive parent
What it is
On a tree, a change in children’s ticks must recompute the parent at once: all children ticked → ticked, all clear → empty, otherwise mixed. That is bubble-up. It runs the opposite way from “parent tick writes children”: one writes the set downward, one reads a summary upward. After two leaves are ticked and a third is not, folding the branch must make the parent say mixed; it must not stay on the all-on or all-off it showed a moment ago.
Mixed here is a live tree summary, updated on every leaf click, not a static mark computed once when a panel opens.
Why it happens
Folding hides the leaves; the parent becomes the only visible selection control for that branch. If the parent does not follow the leaves, folding pins a stale summary on the tree. People then believe the whole branch is in or out, and submit a different set than the one they saw expanded. Bubble-up has to walk the ancestor chain: leaf change → parent change → grandparent change, or only the adjacent layer is fixed and the top still lies.
Bubble-up is derived; do not write mixed back onto leaves. Leaves keep their own booleans; the parent display is computed from the child set. Wired to check-down, a parent tick writes children all-on and bubble-up then shows the parent ticked — both directions align in that beat. Ticking only some leaves leaves the parent mixed and does not force the remaining leaves on; that force is check-down’s job, and it happens only when the user clicks the parent.
Where it stops holding
When the parent is itself selected and every child is empty, the parent should show selected, not empty — bubble-up must honour a “parent itself” bit, or selecting only the parent looks like selecting nothing. Unmounted leaves in a virtualized tree still join the computation, or scrolling them into view suddenly turns the parent mixed. When a filter hides some leaves, whether bubble-up uses the real set or the visible set must match the check-down scope statement. If animation lags the click, several leaf clicks in a row show the parent jittering on a stale state; the summary should update in the same frame.
Applying it
- On every leaf tick change, recompute empty / mixed / full along ancestors so folded and expanded displays agree.
- Do not treat mixed as a value writable onto leaves; leaves only know their own boolean.
- Unrendered and filtered nodes still enter the computation, at the same scope as check-down.
- How to check: expand, tick two leaves, fold. The parent must be mixed. Tick a third so the branch is complete; the parent becomes ticked. If the summary does not change across the fold, bubble-up is broken.
Related
- Within the group: E3.16.1 Checking a parent usually selects all of its children · E3.16.3 Coupling must stay responsive in a deep tree · E3.16.4 Users must be able to select a parent itself with no children
- Adjacent: E3.12 Tri-State and Indeterminate
- Search terms:
bubble-up mixed·tree indeterminate·parent summary