Filter Contact List by Status, Area, or Custom Fields
The Contact Filter Panel provides a slide-up or inline panel with filter controls for status (active, paused, inactive), area, and organisation-defined custom fields. Filter state is managed in the Contact List BLoC and applied both client-side for immediate feedback and enforced server-side via Supabase RLS to ensure results remain within the user's authorised scope. Multiple filters can be applied simultaneously, and the active filter state is visually indicated on the filter button. Filters can be cleared individually or all at once. The filter panel reduces cognitive load for coordinators managing large contact lists by making it easy to segment the list by meaningful criteria.
User Story
Acceptance Criteria
- Given a user is on the Contacts screen, when they open the filter panel, then they see options to filter by status, area, and available custom fields
- Given a user applies a status filter, when the filter is active, then only contacts matching the selected status are shown in the list
- Given a user applies multiple filters simultaneously, when results are displayed, then only contacts matching all active filters are shown
- Given a user has active filters, when they view the filter button, then a visual indicator shows that filters are active
- Given a user clears all filters, when the action completes, then the full unfiltered contact list is restored
- Given filters are applied, when the Contact Search Service queries Supabase, then the filters are enforced server-side in addition to client-side rendering
Business Value
Filtering is essential for coordinators managing hundreds of contacts across large organisations such as NHF (1,400 local branches). Without filtering, finding peer mentors with a specific status or in a particular area requires manual scrolling, which is both time-consuming and cognitively demanding. Effective filtering directly reduces administrative overhead and enables coordinators to act faster on tasks like matching mentors to assignments or following up on paused mentors.
Components
- Contact Filter Panel ui
- Contact List BLoC service
- Contact Search Service service
- Contacts List Screen ui
- Contact Repository data