Role-Specific Home Screen After Login
When a coordinator authenticates and the system resolves their role, they are directed to a role-specific home screen that surfaces coordinator-relevant content: pending proxy registrations, pause requests, team statistics, and quick access to bulk actions. The role resolution service queries Supabase for the user's assigned roles within their active organization context, and the role state manager exposes the resolved role downstream. The role-based home screen widget reads from this state and renders the coordinator variant.
User Story
Audience Summaries
This critical story ensures coordinators reach their operational tools immediately upon login, eliminating friction in the daily management of peer mentor programs. Organizations using this platform need coordinators to respond quickly to pending proxy registrations, pause requests, and team exceptions. A generic landing screen forces additional navigation steps that accumulate into meaningful time losses across hundreds of coordinators managing thousands of mentors. By surfacing role-relevant actions and statistics at the home screen, the platform directly reduces response latency on high-priority items, improves coordinator satisfaction, and strengthens the organization's ability to maintain program quality at scale across its membership base.
Rated critical priority, this story is foundational to the coordinator onboarding experience and must be delivered early in the release cycle as it anchors all role-based navigation flows. There are no declared dependencies, making it an early candidate for sprint scheduling. Delivery involves coordination between the authentication flow, the role resolution service, and the home screen widget layer. Multi-role users add complexity — the role switch widget must be tested for all valid role combinations and edge cases including revoked roles and session continuity.
The tab state persistence requirement via StatefulShellRoute is a Flutter-specific implementation detail that needs developer validation early to avoid rework. UAT should include real coordinator personas from target organizations.
This story requires the role resolution service to complete its Supabase role query before navigation commits to a route, meaning the auth flow must await role resolution asynchronously before rendering. The role state manager should expose the resolved role as a stream or ChangeNotifier so the home screen widget reactively renders the coordinator variant without manual polling. The coordinator home screen widget must compose pending proxy registrations, pause requests, statistics, and bulk action shortcuts from separate data sources — consider parallel futures or a dedicated coordinator dashboard provider. StatefulShellRoute in go_router must be configured to preserve tab index across navigations.
Role revocation between sessions requires a session validation check on app resume that clears stale role state and redirects to the no-access screen.
Acceptance Criteria
- Given a user with the coordinator role logs in, When role resolution completes, Then the coordinator-specific home screen is displayed without any additional navigation steps
- Given a user has multiple roles, When they switch roles using the role switch widget, Then the home screen updates to reflect the newly selected role
- Given a user's role is revoked between sessions, When they log in again, Then the no-access screen is shown instead of the coordinator home screen
- Given a coordinator is on their home screen, When they navigate away and return, Then their tab state is preserved via StatefulShellRoute
Business Value
Coordinators managing multiple peer mentors need immediate access to their operational tools. A generic landing screen wastes time and increases cognitive load, directly impeding the organization's ability to oversee peer mentor activity and respond to pending actions promptly.
Components
- Role-Based Home Screen ui
- Role Resolution Service service
- Role State Manager service
- Supabase Role Data Provider infrastructure
- Role Repository data
- Role-Aware Bottom Navigation ui