Preserve Accessibility Preferences Across Devices and Sessions
When a user saves font scale or contrast theme preferences, ThemeService writes the values to ThemeRepository, which persists them to the user's Supabase record. On app startup or login, ThemeService reads the persisted preferences from ThemeRepository and applies the saved ThemeData before the first screen renders, so the app never flashes the default theme before switching. This applies across devices — logging in on a new or shared device immediately adopts the user's saved accessibility configuration. Changes made on one device propagate to other active sessions via Supabase real-time sync.
User Story
Acceptance Criteria
- Given a user has saved non-default font scale and contrast theme preferences, when they close and reopen the app on the same device, then the saved preferences are applied before the first screen is displayed
- Given a user has saved accessibility preferences on one device, when they log in on a different device for the first time, then the same font scale and contrast theme are applied immediately after login without requiring manual reconfiguration
- Given a user updates their accessibility preferences on one device while logged in on a second device, when the change is saved, then the second device reflects the new preference within a reasonable sync window
- Given a user who has never configured accessibility preferences logs in, when the app starts, then the default Standard theme and 100% font scale are applied without any error or delay
- Given a user logs out, when they log back in with the same account, then their accessibility preferences are fully restored
Business Value
Peer mentors frequently use the app on a single personal device but may need to reinstall or switch phones. Coordinators may share devices or move between office and field contexts. Without cross-device persistence, users with vision or motor impairments must reconfigure accessibility settings after every reinstall — a significant friction point that could lead to abandonment of the app. Reliable persistence ensures that once a user has configured an accessible experience, it stays configured, reducing coordinator support load and improving long-term retention.
Components
- Theme Service service
- Theme Repository data