Add validation and save confirmation to threshold settings
epic-assignment-follow-up-reminders-ui-task-006 — Implement client-side validation for ReminderThresholdSettingsUI: first-reminder threshold must be ≥ 1, escalation threshold must be greater than first-reminder threshold, max count must be between 1 and 10. Show inline error messages using plain-language error display patterns. On valid submission, persist values via the reminder config repository and display a save-confirmation snackbar with an undo action.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 1 - 540 tasks
Can start after Tier 0 completes
Implementation Notes
Extend the ReminderThresholdFormState from task-005 with a validationErrors map (Map
Clear validation errors eagerly on field change using the notifier's field update methods.
Testing Requirements
Write flutter_test widget tests covering: (1) each invalid input combination triggers its corresponding inline error, (2) correcting an invalid field clears the error, (3) all-valid input triggers repository save call with correct values, (4) SnackBar with 'Undo' appears after successful save, (5) tapping Undo calls repository with previous values, (6) repository write failure shows error state. Use Riverpod ProviderScope overrides and a mock repository. Verify SnackBar presence using find.byType(SnackBar) and action label matching.
The deep-link from the notification card to the assignment detail screen depends on the assignment detail route being stable and accepting an assignment ID parameter. If the routing contract is undocumented or changes during parallel development, the CTA will silently navigate to a fallback screen.
Mitigation & Contingency
Mitigation: Confirm the assignment detail route path and parameter contract with the team building or maintaining that screen before implementing the CTA. Add an integration test that asserts navigating from a mock notification card with a known assignment ID lands on the correct route.
Contingency: If the route is unstable, implement the deep-link as a late-bound string resolved from a central route registry, allowing the target route to be updated without changing the notification card.
Visually distinguishing escalation cards from standard reminder cards using colour alone fails WCAG 1.4.1 (use of colour). Blindeforbundet users relying on screen readers must receive equivalent contextual information through semantics, not just visual styling.
Mitigation & Contingency
Mitigation: Use both colour and an icon/label difference to distinguish card types. Add explicit Semantics widgets with descriptive labels ('Escalation alert: peer mentor has not responded') so screen readers announce the type without visual context.
Contingency: If accessibility review flags the distinction, add a text badge ('Escalation') alongside the visual treatment as a code-change-only fix with no schema or service impact.