View and Browse Contact List with Role-Specific Perspectives
Coordinators need a comprehensive contact list screen that displays both regular contacts and peer mentors in a structured, scannable format. The list must support switching between a contacts view and a peer mentors view using a view switcher widget. Each card must show key status indicators such as assignment status, certification validity, and pause state. The list must be scoped to the coordinator's chapter via RLS, ensuring data isolation across chapters.
User Story
Audience Summaries
The contact list is the primary operational interface for coordinators managing their peer mentor networks, making this a critical foundational capability with direct impact on program efficiency and data governance. Without a structured, role-scoped list view, coordinators rely on spreadsheets and informal phone records to track assignments, certification status, and mentor availability — a process that creates delays, missed follow-ups, and compliance risk in multi-chapter organizations. This story delivers a paginated, RLS-enforced contact list that ensures each coordinator sees only their chapter's data, directly satisfying data isolation requirements across client organizations like NHF and HLF. The dual-view switcher (contacts vs.
peer mentors) reduces cognitive load and enables faster triage. Faster coordinator workflows translate directly to better mentor responsiveness, improved participant outcomes, and stronger client satisfaction scores — all of which support contract retention and program growth.
This story is marked critical and serves as the structural foundation for all coordinator-facing contact management workflows. It has no declared dependencies, meaning it can be scoped and started immediately, but it is likely a blocker for several downstream stories including mentor pausing, assignment management, and certification tracking. The paginated list with infinite scroll requires agreement on page size, loading state designs, and error states before implementation begins. The view switcher widget must be designed generically enough to support potential future views without refactoring.
RLS policy configuration is a backend task that requires database-level coordination and must be validated across multiple test accounts representing different chapters. QA scope is broad: pagination, RLS isolation, card badge rendering for pause and certification states, and view switching all require dedicated test cases. Given its critical priority, this story should be sequenced early in the sprint to unblock dependent work and allow integration testing time.
The contact list screen requires a paginated data-fetching layer using cursor or offset pagination, with an infinite scroll trigger at the bottom of the list. The query must be scoped through RLS policies at the Supabase or database level so that chapter isolation is enforced server-side, not just client-side. Each contact card renders name, assignment status, and conditional badge components for pause state and certification validity — these badge states must be derived from joined fields (mentor status flags, certification expiry dates) returned in a single optimized query to avoid N+1 issues. The view switcher widget toggles between two filtered subsets of the same underlying data source; the peer mentors view should apply an additional filter for mentor role.
Pagination state must be managed carefully to avoid resetting scroll position when returning from a detail screen. The component should support skeleton loading states during initial fetch and error boundaries for failed pages. RLS policies must be tested with multiple authenticated users from different chapters to confirm isolation.
Acceptance Criteria
- Given I am logged in as a coordinator, when I navigate to the Contacts tab, then I see a paginated list of all contacts within my chapter
- Given I am on the contact list screen, when I tap the view switcher, then the list toggles between a contacts view showing all contacts and a peer mentors view showing only peer mentors
- Given the contact list is loaded, when I view each contact card, then I see the contact name, assignment status indicator, and any active pause or certification warning badges
- Given my chapter has RLS policies applied, when I view the contact list, then I only see contacts belonging to my chapter and not contacts from other chapters
- Given the list has more than 20 items, when I scroll to the bottom, then the next page of contacts is loaded automatically without a full screen reload
Business Value
Contact list browsing is the primary entry point for coordinators to manage their peer mentor network. Without an efficient, role-scoped list view, coordinators resort to manual spreadsheets and phone records, causing delays in follow-up and missed assignments. A performant, RLS-filtered contact list directly reduces coordination overhead and ensures data privacy compliance across multi-chapter organizations.
Components
- Contact List Screen ui
- Contact Card Widget ui
- Peer Mentor Card Widget ui
- Contact View Switcher ui
- Contact List Service service
- Contact Repository data
- Contact List Riverpod Provider data
- Contact RLS Query Builder infrastructure