Toggle Between Map View and List View for Peer Mentors
Not all coordinator tasks benefit from a map view. When reviewing certification statuses across the chapter, a sortable list is more efficient; when assigning a new contact from a specific municipality, the map is superior. The view-toggle-button (a persistent FAB-style toggle in the top-right corner of the map screen) switches between views without resetting filters, scroll position, or selected mentors. The list fallback uses mentor-list-fallback which shares the same data model and filter state as the map, ensuring both views are always in sync. The toggle state is preserved during the session but resets to the coordinator's default preference (map) on next app launch.
User Story
Acceptance Criteria
- Given the coordinator is on the map view, when they tap the view-toggle-button, then the interface transitions to the mentor-list-fallback list view within 300ms with the same filtered mentor set
- Given the coordinator has active filters applied on the map, when they switch to list view, then the same filters remain applied and the list reflects the identical filtered result set
- Given the coordinator is on the list view, when they tap the view-toggle-button again, then the map view is restored and any marker that was previously selected is still selected
- Given the coordinator is on a device without GPS or map support, when they open the contact management section, then the list view is shown by default and the toggle button is hidden to prevent navigating to a non-functional map
- Given the coordinator switches to list view and scrolls to a specific mentor, when they switch back to map view, then the map auto-centres on that mentor's location
- Given the user returns to the map/list screen after navigating away, when the screen reinitialises, then the last-used view mode (map or list) is restored for the current session
Business Value
A map-only interface creates barriers for coordinators who prefer list-based workflows or who are working in conditions where map rendering is slow or unavailable (poor connectivity in rural areas). Providing a seamless toggle ensures the geographic feature is additive — it enhances the existing contact list workflow rather than replacing it, reducing adoption friction and ensuring all coordinators can access mentor data regardless of connectivity.