Search Contacts and Peer Mentors by Name or Keyword
The Contact Search Bar provides an inline search experience with debounced input that triggers Supabase queries filtered by organisation membership and role scope. As the user types, the Contact Search Service executes queries with a debounce delay to avoid excessive API calls, returning paginated results that are rendered in the contact list. The search is scoped to the user's role: coordinators search across all org contacts, while peer mentors search within their assignment-linked contacts only. The search bar is reachable without additional navigation steps for screen reader users, satisfying WCAG 2.2 AA requirements.
User Story
Acceptance Criteria
- Given a user is on the Contacts screen, when they tap the search bar and begin typing, then results update automatically with a debounce delay of ~300ms
- Given a coordinator types a partial name, when results are returned, then only contacts within their organisational scope are shown
- Given a peer mentor types a partial name, when results are returned, then only contacts linked to their active assignments are shown
- Given no results match the search query, when the search completes, then an empty state message is displayed
- Given a user clears the search bar, when the input is empty, then the full contact list is restored
- Given a screen reader user navigates to the Contacts screen, when using VoiceOver or JAWS, then the search bar is reachable without additional navigation steps
Business Value
Fast contact search is listed as a MUST HAVE requirement across all participating organisations. Without search, coordinators managing hundreds of peer mentors and contacts face significant friction in their daily work. The debounced, role-scoped search directly reduces administrative burden and increases adoption by making the most frequent user action feel immediate and purposeful, which is especially critical for users with motor challenges who find scrolling difficult.
Components
- Contact Search Bar ui
- Contact Search Service service
- Contact List BLoC service
- Contact Repository data
- Contacts List Screen ui