When returning to the geography selector page, check the boxes that are represented in current state. Additionally, use local state to track the previous "geo selection mode" selected values, so they can be restored when that mode is re-enabled. Prevent both regions and countries from being selected at once.
When navigating back to the question page (from the viz page), select any checkboxes that
match the currently selected state. Additionally, expand any category accordions which have selected checkboxes.
Lastly, now that the user can navigate backwards, it was possible to go from Viz (with questions already selected) back to Geography, and then next to Questions again. This would leave the previously selected questions checked, causing the user to have to manually adjust them. It's not clear which use case we should support (clear them out or save them, either is a convenience depending on the user intent). This commit clears the selection before navigating forwards, but can be removed if the opposite behavior is better received. I think this approach is less error-prone, since the user could have changed the geometry selection mode (e.g., from region --> country) which would invalidate any previously selected questions (since there isn't 100% overlap between region and country questions).
Connects #11
Testing Instructions
Select several regions - switch to countries, and select several.
Switching back and forth should preserve the previous mode's selections, and match that in redux state
Move to questions
Select several from different categories
Move to viz
Move back to questions, ensure the questions are selected and the approapriate categories are expanded
Move back to geography, select anew, then move to questions
Confirm that there is a blank state (both in the UI and redux) for the questions
Refresh and ensure no state is preserved
Generally use the breadcrumb and browser navigation and determine if the persistence is applied in sensible ways.
Overview
When returning to the geography selector page, check the boxes that are represented in current state. Additionally, use local state to track the previous "geo selection mode" selected values, so they can be restored when that mode is re-enabled. Prevent both regions and countries from being selected at once.
When navigating back to the question page (from the viz page), select any checkboxes that match the currently selected state. Additionally, expand any category accordions which have selected checkboxes.
Lastly, now that the user can navigate backwards, it was possible to go from Viz (with questions already selected) back to Geography, and then next to Questions again. This would leave the previously selected questions checked, causing the user to have to manually adjust them. It's not clear which use case we should support (clear them out or save them, either is a convenience depending on the user intent). This commit clears the selection before navigating forwards, but can be removed if the opposite behavior is better received. I think this approach is less error-prone, since the user could have changed the geometry selection mode (e.g., from region --> country) which would invalidate any previously selected questions (since there isn't 100% overlap between region and country questions).
Connects #11
Testing Instructions