{"success":true,"name":"normalize-search-input-and-design-the-no-results-moment","description":"Building a search box over lists, channels, members, or content.","category":"ai-brimind","path":"ai-brimind/normalize-search-input-and-design-the-no-results-moment/SKILL.md","file":"SKILL.md","content":"---\nname: normalize-search-input-and-design-the-no-results-moment\ndescription: \"Building a search box over lists, channels, members, or content.\"\n---\n\n# Normalize Search Input and Design the No-Results Moment\n\n## When to use\nA search/filter feature matches user input against data, and input variations (case, accents, spaces) or the empty-result experience haven't been handled.\n\n## Example request\nSearch 'ali' misses 'Ali' → raw string includes() is case-sensitive — unnormalized comparison. Trailing space from mobile autocorrect → 'sport ' matches nothing; the user sees a broken search — invisible characters defeating match. Zero results shows a blank area → user can't tell if it's loading, broken, or truly empty — undesigned empty result.\n\n## Instructions\nAct like a developer who knows users type approximately and search must meet them halfway. Two halves: MATCHING — (1) normalize BOTH sides identically before comparing: lowercase, trim, collapse inner whitespace, and decide accent policy ('cafe' should probably find 'café' — normalize diacritics for Latin text; define the Arabic policy consciously: alef variants and diacritics matter to your actual data); (2) match on the fields users think in — a channel search should likely hit name AND category; state which fields participate; substring match is the sane default over exact-match; (3) if search hits a backend, normalization must live there too — a frontend-only fix leaves the API strict. THE EMPTY MOMENT — (4) zero results is a designed state, never a blank region: say clearly 'No results for \"xyz\"', keep the query visible and editable, and offer a way forward (clear search, check spelling, browse all); distinguish it visually from loading; (5) sanity-check ranking: exact and starts-with matches surface above buried substring hits when lists are long. Only proceed once 'ALI', ' ali ', and 'alí' all find Ali, and a garbage query produces a helpful screen, not a void.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1189\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}