View Assigned Contacts List on Profile
The peer mentor profile screen should include an assigned-contacts-list section that shows all contacts currently assigned to this mentor. Each contact entry should display the contact's name, assignment start date, last activity date, and current relationship status. The peer mentor should be able to tap any contact to navigate directly to the contact detail screen. For mentors managing multiple contacts across chapters, this list must respect row-level security to only show contacts the mentor is authorized to see. The component should handle empty state gracefully for new mentors with no assignments yet.
User Story
Audience Summaries
Peer mentors who cannot quickly see their current contact responsibilities are at risk of overlooking assigned individuals — a direct failure of the program's core mission. This story delivers a consolidated assigned-contacts-list on the peer mentor's own profile screen, giving mentors immediate visibility into every active contact relationship, including last activity date and relationship status. For organizations managing mentors across multiple chapters, the built-in row-level security ensures mentors only see contacts they are authorized for, protecting data privacy without requiring manual filtering. This improves mentor accountability, reduces coordinator intervention for basic workload questions, and directly supports the quality of care delivered to contacts — a measurable outcome tied to program effectiveness and funder reporting.
This high-priority story depends on story-peer-mentor-profile-status-peer-mentor-001 and should be scheduled accordingly. Delivery involves building the assigned-contacts-list component within the mentor profile screen, wiring it to the contacts data layer with row-level security enforcement, and handling navigation to contact detail screens on tap. The empty state for new mentors with no assignments must be explicitly designed and tested. Five acceptance criteria cover the primary happy path, empty state, navigation, RLS filtering, and active-only display.
Cross-functional coordination is needed with the data team to confirm RLS policies are correctly scoped per mentor and chapter. Testing must validate RLS behavior across mentors with cross-chapter assignments. The 'active assignments only' filter requires clarification on what constitutes an ended assignment in the data model before development starts.
The assigned-contacts-list component should query the contacts table filtered by the authenticated mentor's ID, enforcing row-level security at the database query level rather than in application code. Each row must surface contact name, assignment start date, last activity date, and relationship status — confirm these fields exist in the contact and assignment tables and add any missing indices for query performance. The list must display only active assignments by default, so an assignment status or end-date filter is required; clarify the schema definition of 'active' before implementation. Navigation on row tap should push the contact detail screen with the contact ID as a route parameter.
The empty state must render a descriptive message component when the query returns zero results. For multi-chapter mentors, verify that RLS policies in the database are scoped correctly and write integration tests that simulate a mentor with contacts in multiple chapters to confirm no unauthorized records leak through.
Acceptance Criteria
- Given I am on my profile screen, When the assigned-contacts-list loads, Then I see all contacts currently assigned to me with their name and last activity date
- Given I have no assigned contacts, When the assigned-contacts-list loads, Then I see a clear empty state message indicating no contacts are currently assigned
- Given I tap a contact in my assigned list, When the navigation executes, Then I am taken to the contact detail screen for that contact
- Given I have contacts assigned across multiple chapters, When the list loads, Then only contacts I am authorized to see via RLS are shown
- Given a contact assignment has ended, When I view my assigned contacts list, Then only active assignments are shown in the default view
Business Value
Peer mentors need a single place to understand their current responsibilities. Without a consolidated view of assigned contacts on their own profile, mentors must navigate through multiple screens to understand their workload. This directly impacts the quality of care given to contacts and reduces the risk of a contact being overlooked when a mentor has multiple assignments.
Components
- Assigned Contacts List ui
- Peer Mentor Detail Screen ui
- Peer Mentor Detail BLoC service
- Assignment Repository data
- Assignment History Repository data
- Peer Mentor Repository data
- Supabase Client Provider infrastructure