critical priority low complexity frontend pending frontend specialist Tier 4

Acceptance Criteria

Screen displays the mentor's current active status using the PauseStatusIndicator widget before confirmation
A descriptive explanation text is shown clarifying what pausing means (temporarily unavailable for new assignments, coordinator will be notified)
An optional free-text reason input field is rendered using AppTextField; submission is allowed without a reason
The ExpectedReturnDatePicker widget is integrated and allows selecting a future date; past dates are disabled
A clearly labelled 'Confirm Pause' button triggers PauseManagementService.activatePause() with the reason and return date payload
A 'Cancel' action (button or back navigation) returns the mentor to the previous screen without any state change
A loading indicator is shown while activatePause() is in-flight; the confirm button is disabled during loading to prevent double submission
On success, a success confirmation message is displayed showing the expected return date if one was set
On API error, an accessible inline error message is shown using a semantic live region (Semantics widget with liveRegion: true) so screen readers announce the error
The screen passes WCAG 2.2 AA contrast requirements for all text and interactive elements
Back navigation (back button, not swipe) is the only dismiss mechanism on iOS and Android to prevent accidental dismissal
All interactive elements have minimum touch target size of 48x48dp per accessibility guidelines

Technical Requirements

frameworks
Flutter
BLoC
apis
PauseManagementService.activatePause()
Supabase REST via service layer
data models
assignment
performance requirements
Screen must render within 300ms of navigation
activatePause() call must reflect updated status in UI within 1 second of API response
security requirements
Pause reason text must be sanitised before submission to prevent injection
Supabase RLS must restrict the update to only the authenticated peer mentor's own assignment row
JWT from Supabase Auth used for all service calls — no unauthenticated requests permitted
ui components
PauseStatusIndicator widget
ExpectedReturnDatePicker widget
AppTextField (optional reason input)
AppButton (confirm + cancel)
Semantics live region for error messaging
CircularProgressIndicator (loading state)

Execution Context

Execution Tier
Tier 4

Tier 4 - 323 tasks

Can start after Tier 3 completes

Implementation Notes

Use a BLoC (PauseManagementBloc) with states: PauseInitial, PauseLoading, PauseSuccess, PauseError. Emit PauseLoading on confirm tap and disable the confirm button via BlocBuilder. Do not use Navigator.pop on confirm — instead navigate to a dedicated success screen or show an in-place confirmation card to avoid the mentor accidentally re-entering the flow. Ensure the ExpectedReturnDatePicker defaults to null (no date selected) and only sends a return date in the payload if the mentor explicitly picks one.

The reason field should trim whitespace before submission. Follow the existing AppButton and AppTextField patterns from the shared widget library — do not create custom button or input widgets.

Testing Requirements

Write widget tests using flutter_test covering: (1) screen renders current active status indicator, (2) confirm button is disabled while loading, (3) success state displays expected return date, (4) error state renders accessible error message with liveRegion semantics, (5) cancel action pops the route without calling activatePause(). Write an integration test verifying the full flow from screen open → reason entry → date selection → confirm tap → success state. Test accessibility with Flutter's SemanticsController to assert live region announcements.

Component
Pause Activation Screen
ui low
Dependencies (3)
Epic Risks (3)
medium impact medium prob technical

Concurrent status transitions (e.g., coordinator and automated scheduler both attempting to update the same mentor's status simultaneously) may produce race conditions or inconsistent state in the database, leading to audit log gaps or incorrect notifications.

Mitigation & Contingency

Mitigation: Implement all status transitions as atomic Postgres RPC functions with optimistic locking (version column or updated_at check). Use database-level constraints rather than application-level guards as the final enforcement point.

Contingency: Add a compensation job that reconciles status and log table consistency on each nightly scheduler run, surfacing any discrepancies to coordinator dashboards.

medium impact medium prob integration

The coordinator-to-mentor assignment relationship may not always be 1:1 or may be stale (coordinator reassigned after a pause was set), causing notifications to be sent to the wrong coordinator or not sent at all.

Mitigation & Contingency

Mitigation: Query the assignment relationship at notification dispatch time rather than caching it at pause creation time. Add a fallback to notify the chapter administrator if no active coordinator assignment exists.

Contingency: Log all undeliverable notification attempts with the originating mentor ID so administrators can manually follow up, and surface undelivered notification counts on the coordinator dashboard.

medium impact low prob technical

The CoordinatorPauseRosterScreen may load slowly for coordinators managing large rosters with many concurrent certification expiry queries, degrading usability on low-bandwidth mobile connections.

Mitigation & Contingency

Mitigation: Use a single Supabase RPC that joins mentor status, certification expiry, and assignment data in one query rather than N+1 individual calls. Implement pagination with a configurable page size and skeleton loading states.

Contingency: Add an offline cache of the last-fetched roster state using Riverpod with SharedPreferences, ensuring coordinators can at minimum view stale data when connectivity is poor.