Skip to content

fix(addeditfamily): show "No contacts found" when a search comes up empty - #50

Merged
chriskehayias merged 1 commit into
devfrom
fix/addeditfamily-search-empty-state
Oct 10, 2026
Merged

chriskehayias merged 1 commit into
devfrom
fix/addeditfamily-search-empty-state

Conversation

@chriskehayias

Copy link
Copy Markdown
Contributor

Summary

  • FamilySearchBar's <CommandEmpty> never rendered: cmdk shows it only when the whole Command has zero items, and the "+ New Family" item is always registered once the query is >= 2 chars.
  • Replaced it with a plain <div> matching the "Searching…" / "Type at least 2 characters" states.
  • Gated on a new searchedTerm state, so the message appears only after the term on screen has been searched. Without that it would flash during the 300 ms debounce while results still holds the previous term's answer. A failed search shows nothing, as before.
  • Tests: replaced the test that asserted the broken behavior; added a debounce/stale-term test; the error test now also asserts no false "not found".
  • Added GOTCHA-045; deleted the closed TODO and updated INDEX.md.

Test plan

  • npm run lint
  • npm run typecheck
  • npm run test:coverage (2096 passed)

🤖 Generated with Claude Code

…mpty

cmdk's CommandEmpty renders only when the whole Command has zero items,
and the "+ New Family" item is always registered once the query is >= 2
characters, so the message never appeared. Replace it with a plain div
gated on our own state, and only once the term on screen has actually
been searched (tracked as searchedTerm), so it does not flash during the
300 ms debounce. Adds GOTCHA-045.

Closes the 2026-09-13 search-empty-state-never-renders TODO.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chriskehayias
chriskehayias merged commit a5c9cd9 into dev Oct 10, 2026
1 check passed
@chriskehayias
chriskehayias deleted the fix/addeditfamily-search-empty-state branch October 10, 2026 15:49
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant