high priority low complexity frontend pending frontend specialist Tier 3

Acceptance Criteria

ProxyConfirmationScreen accepts a ProxyRegistrationDraft (or equivalent model) and renders all required fields: attributed mentor name, activity type, date, duration, and coordinator name
The UI visually distinguishes 'Activity performed by: [Mentor Name]' from 'Registered by: [Coordinator Name]' — different label weight, color, or section heading using design tokens
In bulk mode, the screen shows a count ('3 mentors selected') and lists all attributed mentor names (scrollable if >5)
Confirm button triggers an onConfirm callback; Back button triggers an onBack callback — no direct navigation calls inside the widget
All text elements pass WCAG 2.2 AA contrast ratio (minimum 4.5:1 for normal text, 3:1 for large text) against the background color defined in design tokens
No hardcoded colors, font sizes, or spacing — all values sourced from the app's design token theme
Screen is accessible: all interactive elements have semantic labels, confirm/back buttons are reachable via screen reader in logical order
Widget handles null/empty mentor name gracefully with a fallback label (e.g., 'Unknown Mentor') without throwing
Widget test (separate task) can render the screen in both single and bulk modes without errors

Technical Requirements

frameworks
Flutter
Dart
data models
ProxyRegistrationDraft
PeerMentorSummary
ActivityType
performance requirements
Screen must render in under 16ms per frame (60fps) — no heavy computation in build()
Bulk mentor list must be rendered with ListView.builder for lists >5 entries to avoid jank
security requirements
No sensitive personal data (e.g., national ID, health info) displayed on this screen
Screen must not cache registration data in widget state after onConfirm is called
ui components
ProxyConfirmationScreen (StatelessWidget)
ConfirmationSummaryCard (reusable summary row widget)
AppButton (existing shared button widget) for confirm and back actions
BulkMentorList (inline scrollable list for bulk mode)

Execution Context

Execution Tier
Tier 3

Tier 3 - 413 tasks

Can start after Tier 2 completes

Implementation Notes

Design this as a pure presentational widget (StatelessWidget) with all data passed via constructor. Use a sealed class or two named constructors (ProxyConfirmationScreen.single / ProxyConfirmationScreen.bulk) to handle the two modes cleanly rather than a bool flag. The visual distinction between 'performed by' and 'registered by' is critical for NHF/HLF audit compliance — use a two-section layout with a subtle divider and different label styles from the design token system (e.g., bodyMedium for data, labelSmall for role labels). Do not use Expanded in a Column without a Flexible parent if bulk mentor list is present — use a constrained SizedBox or shrinkWrap ListView to avoid unbounded height errors.

Ensure the confirm button is the primary action (full-width, primary color token) and back is secondary (outlined or text button).

Testing Requirements

Widget tests must cover: (1) single-mentor mode renders all 5 required fields, (2) bulk mode renders mentor count and list, (3) confirm button triggers onConfirm callback exactly once, (4) back button triggers onBack callback, (5) null mentor name shows fallback text without exception, (6) accessibility semantics tree contains labels for all interactive elements. Use flutter_test with WidgetTester. No network calls needed — pass mock data directly to the widget constructor.

Component
Proxy Confirmation Screen
ui low
Epic Risks (3)
high impact medium prob security

Supabase RLS policies for org-scoped proxy access may be difficult to express correctly, especially for coordinators with multi-chapter access. An overly permissive policy could allow cross-org proxy registrations, corrupting Bufdir reporting; an overly restrictive policy could block legitimate coordinators from registering.

Mitigation & Contingency

Mitigation: Write integration tests covering all access boundary cases (same org, cross-org, multi-chapter coordinator) before merging any RLS migration. Use parameterised RLS test helpers already established by the auth feature.

Contingency: If RLS proves insufficient, add a server-side Edge Function validation layer that re-checks org membership before persisting any proxy record, providing defence in depth.

medium impact low prob technical

Adding new tables and foreign key constraints to an existing production Supabase database risks migration failures or locking issues if the database already contains active sessions during deployment.

Mitigation & Contingency

Mitigation: Use additive-only migrations (no DROP or ALTER on existing tables). Test full migration sequence in a staging Supabase project before production deployment. Schedule during low-traffic window.

Contingency: Maintain a rollback migration script. If the migration fails, the feature remains unreachable behind a feature flag while the schema issue is resolved.

high impact medium prob security

Audit log entries must be immutable for compliance, but Supabase RLS by default allows row owners to update their own rows. If audit records are accidentally mutable, dispute resolution and accountability guarantees are invalidated.

Mitigation & Contingency

Mitigation: Configure the proxy_audit_log table with an RLS policy that allows INSERT for coordinators but denies UPDATE and DELETE for all roles including service_role, enforced at the database level.

Contingency: If RLS cannot fully prevent updates, create a database trigger that reverts any UPDATE to the audit table and logs the attempt as a security event.