← All tests

Shop filters — apply on close, not per click (prod)

Narong (2026-06-11, video): each checkbox click in the shop filter fired a server roundtrip, making the dropdown feel laggy. Captured from get-coffee.nixtech.app.

Gate 2 9/9 passed (re-run after the follow-up below). Checkbox toggles in the shop multi-select filters now buffer into a local draft — checkboxes flip instantly — and the navigation (server call) fires once, when the dropdown closes (click outside / re-click the trigger), and only if the selection actually changed. “All shops / All stores” is a single-intent action so it still applies immediately. Fixed on all three surfaces sharing the pattern: POS Session history, Reports Summary, and Order Analysis. nix-cafe e9eb5e5, 3 files, no migration.
Follow-up a1e1e63 + 94fb816 — “first click-out didn’t save” fixed. Narong’s report after the ship: the first commit didn’t apply, the second did. Reproduced (~50% of first interactions on a fresh page load): router.push ran its server fetch but the history commit was silently dropped by the Worker runtime — and separately, closing the popover by clicking a preset chip let the chip’s navigation (built from a stale snapshot) wipe the just-committed shop selection. New shared useFilterPush hook: builds every filter URL from the live / pending query string and verifies the push landed, recovering via an escalation ladder (re-push is no-oped by the router, so: router.replace at 1.2s, full navigation at 2.8s — each only if the URL hasn’t moved and no newer intent superseded it). Verified by 4/4 fresh-load first-commits landing and the chip click now keeping both the shop and the preset.
Sessions: shop checked, popover still open, URL unchanged
1 — Session history: a shop is checked, the popover is still open and the URL hasn’t changed — no roundtrip fired yet. Click to zoom.
Sessions: filter applied after clicking outside
2 — After clicking out of the filter: one navigation fires, the URL carries the shop param and the table reflects the selection.
Reports Summary: store toggled with no immediate navigation
3 — Reports Summary: same buffering — store toggled, menu open, no navigation until close.
Order Analysis: store toggled with no immediate navigation
4 — Order Analysis: the third surface with the same pattern, also commit-on-close now.
Sessions: closing the popover via a preset chip keeps both the shop filter and the preset
5 — Follow-up a1e1e63: “closing” the shop popover by clicking the This Week chip now keeps both filters (URL carries shop + preset) — previously the chip’s navigation wiped the shop selection.