-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go back from settings to location / edit location / review / map #545
Conversation
@wbazant Good catch with the edit-review behavior. The problems raised in the issue are fixed, except for my "perhaps related" note:
Is this something worth also addressing in this PR? |
It felt like a small feature but I did it! Going to settings sets fromSettings true in the location slice, going away anywhere but location page resets it, and going on location page preserves the current value. Then the back button on location page takes you to either settings or map - so, going between different locations or panning the map is lumped together for what counts as 'back' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- An infinite loop is now possible: click on a location, then on settings. Clicking "<- Back" goes to location, clicking "<- Back" again to settings, and so on forever.
- Much more minor, but going to review location, to settings, and "<- Back" returns to the bare location page rather than the #review anchor on the location page.
opening location page through back button shouldn't count because then we have an infinite loop
Fixed, thanks for spotting! I forgot you can 'go to the location' through the back button. Now we only set isFromSettings when clicking on the map when the URL is /settings, and we reset it only when going away from a location page, with this funny looking code in
That is a minor issue :) . I don't have a way to fix it that feels worthwhile, unless we take it as a sign that we should be restoring scrollbar position on 'back from settings' always, or that the review form on desktop should actually be its own page like on mobile instead of under the location? |
I think this. It always felt cluttered to me to have the form just dangling there at the bottom. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wbazant I confirm the infinite loop is fixed. Thanks!
I did notice during use and testing that the navigation with the browser's back button is sometimes surprising. I'll see if I can coherently describe that in a future issue. Coming from the simple and innocent world of the server-side-rendered Rails website, navigation and routing is one of the aspects of the new website I have the most trouble wrapping my head around.
Closes #484