Search Contact Notes and Activity Summaries
Contact records accumulate notes and post-session report summaries over time. When a coordinator needs to find, for example, all contacts for whom a peer mentor wrote about a specific challenge or course interest, text search across notes surfaces that information instantly. The search service queries notes and report summaries stored in Supabase, filtered by the coordinator's RLS scope, and returns results grouped by contact with relevant excerpts highlighted. This feature directly supports the formalized report structure required by Blindeforbundet (health status, course interest, way-forward items) and the general notes functionality requested by all organizations.
User Story
Acceptance Criteria
- Given the coordinator enters a search query, when results include contacts with matching note content, then note-matched results are visually distinguished from name-matched results
- Given a note result is returned, when displayed in the results list, then a short excerpt of the matching note text is shown beneath the contact name
- Given the coordinator's RLS scope covers only their chapter's contacts, when search results are returned, then only contacts within their permitted scope appear
- Given the coordinator taps a note-matched result, when navigating, then the contact detail screen opens and scrolls to or highlights the relevant note or report section
- Given a search returns both name matches and note matches for the same contact, when displayed, then the contact appears once with both match types indicated
Business Value
The ability to search note content transforms passive record-keeping into an active coordination tool. For Blindeforbundet, formalized post-visit reports contain structured data (course interest, health situation, way-forward) that coordinators must act on. Full-text search across this data enables coordinators to identify patterns, prioritize follow-ups, and respond to Bufdir audit requests without manually reviewing hundreds of records — reducing administrative overhead and improving care quality.
Components
- Contact Search Screen ui
- Accessible Search Input Field ui
- Search Results List ui
- Contact Search Service service
- Supabase Contact Search Repository data
- Contact RLS Query Builder infrastructure
- Search Debounce Utility infrastructure
- Contact Detail Screen ui
- Contact Detail Service service