User Account Management Screen
Component Detail
Description
Paginated list and management UI for all users within the admin's org scope. Supports filtering by role, chapter, status (active, paused, pending), and certification state. Provides inline role assignment, account activation/deactivation, and navigation to individual user detail.
user-account-management-screen
Summaries
The User Account Management Screen gives organisation administrators full control over their membership roster — the ability to view, filter, activate, deactivate, and reassign roles for every user within their organisational scope. This capability is essential for maintaining programme integrity: administrators can quickly respond to safeguarding events by deactivating accounts, ensure only certified and active peer mentors are visible in the system, and maintain accurate role assignments as organisational structures evolve. Efficient user management reduces administrative workload, minimises the risk of unauthorised access by former members, and supports audit readiness by maintaining a clean, up-to-date user registry.
High-complexity screen with three component dependencies: Role Assignment Panel, User Management Service, and Org Hierarchy Navigator. All three must be delivered and integration-tested before this screen can be considered complete. The paginated list with server-side filtering (by role, chapter, status, certification state) requires close coordination with the backend team on filter API design and pagination contract. Inline status toggle (onStatusToggle) requires optimistic UI handling with rollback on failure, adding non-trivial state management complexity.
Plan for a full regression cycle after any changes to Role Assignment Panel or Org Hierarchy Navigator. Cross-platform layout testing (web, mobile, desktop) is mandatory given the data-dense nature of the screen.
UserAccountManagementScreen is a Flutter screen widget composing RoleAssignmentPanel (modal overlay), OrgHierarchyNavigator (for org scope selection), and a paginated ListView driven by UserManagementService. State should be managed in a dedicated controller (Riverpod AsyncNotifier or BLoC) that holds UserFilters, the current page cursor, and the user list. applyFilters(UserFilters filters) resets pagination and triggers a fresh fetch. loadNextPage() appends to the existing list using cursor-based pagination — avoid offset-based pagination for large datasets.
onStatusToggle(userId, newStatus) should implement optimistic update: update local state immediately, call service, and revert on error with a snackbar. onRoleAssignTapped(userId) shows the RoleAssignmentPanel as a bottom sheet or dialog and awaits its result to refresh the affected list row. Ensure the org scope from OrgHierarchyNavigator is passed as a filter parameter to every UserManagementService call.
Responsibilities
- List all users within org scope with role and status indicators
- Filter users by role, chapter, status, and certification state
- Provide inline role assignment and account status toggle
- Navigate to individual user profile for detailed management
Interfaces
build(context)
applyFilters(UserFilters filters)
onUserTapped(userId)
onRoleAssignTapped(userId)
onStatusToggle(userId, newStatus)
loadNextPage()
refreshList()
Relationships
Dependencies (3)
Components this component depends on