{% load common_extras %}{% comment %} The list toolbar's Filter button and its popover (HANDOFF §2.2) — see the `filter_popover` inclusion tag in apps/common/templatetags/common_extras.py. One button with a count badge; one panel of grouped toggle pills; filters apply as they are picked, so the footer button only closes the panel and says how many rows the current selection leaves. The removable chips under the toolbar are components/filter_chips.html. Bind `model` to an object in the ENCLOSING x-data holding one array per group. As in ui_select, every expression that reads it lives in a directive, which resolves through Alpine's scope chain; the methods in this component's own x-data are plain JS and cannot see the parent scope, which is why they only handle anchoring and the count. Hidden inputs: one per selected value, rendered by x-for, so the enclosing htmx form serialises `?status=active&status=offline`. The page's reload() dispatches on $nextTick for the same reason ui_select's callers do — the inputs appear on the next tick, and serialising before then sends the previous selection. The panel is position:fixed and anchored on open (ui_select's reasoning: a toolbar lives in scrolling containers that clip an absolute panel), so window scroll closes it. It is a non-modal dialog: Escape closes it and returns focus to the button, and tabbing out of it closes it too. {% endcomment %}
{{ group.label }}