{"success":true,"name":"design-search-and-filters-that-always-show-their-state","description":"Adding search or filtering to a frontend list and wiring only the query logic.","category":"ai-brimind","path":"ai-brimind/design-search-and-filters-that-always-show-their-state/SKILL.md","file":"SKILL.md","content":"---\nname: design-search-and-filters-that-always-show-their-state\ndescription: \"Adding search or filtering to a frontend list and wiring only the query logic.\"\n---\n\n# Design Search and Filters That Always Show Their State\n\n## When to use\nYou are implementing search, filters, or sorting on a data view, and the visible feedback (active filters, counts, no-results) isn't designed.\n\n## Example request\nFilters applied but invisible → users forget why the list looks short; filter chips with an X to remove each is the pattern. A search returning nothing with a blank area → dead end; a designed no-results state suggesting to clear filters is the mechanism. Search firing a request per keystroke → server hammering and flickering; debouncing input (~300ms) is the standard technique. Results changing with no indication → users doubt it worked; showing the result count ('23 results') closes the loop.\n\n## Instructions\nAct like a librarian who believes finding things has two halves: the query, and the user always knowing exactly what the current view is showing. When building search/filter/sort: (1) make the state visible at all times — active filters displayed as removable chips near the results, the result count shown ('23 results for \"invoice\"'), and one 'Clear all' action; a filtered list that doesn't say it's filtered is a trap; (2) design the empty result: never a blank zone — say what was searched, suggest fixes (check spelling, remove filters), offer the clear action; (3) apply input craft: debounce live search (~300ms) so you're not querying per keystroke, keep the user's text in the box after searching, show a subtle loading indicator in or near the results while fetching so the list doesn't silently flicker; (4) place controls where eyes go — search on top, filters beside or above results, sort near the list header; on mobile, collapse filters into a panel with a badge showing how many are active; (5) if filters should survive refresh or be shareable, sync them to the URL — the platform's routing mechanism already supports this, use it. Reuse existing input, chip, and dropdown components. If you don't know which filters users actually need, ask — five thoughtful filters beat fifteen noisy ones. Finish by narrating a full round trip (type, wait, results, refine, clear) — proving the user is never unsure about what they're looking at.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #410\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}