Skip to content
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

Treat / and /explore as distinct URLs #860

Open
lederer opened this issue Jul 21, 2017 · 5 comments
Open

Treat / and /explore as distinct URLs #860

lederer opened this issue Jul 21, 2017 · 5 comments
Labels

Comments

@lederer
Copy link
Contributor

lederer commented Jul 21, 2017

Go to the GoPhlGo home page and hover on the "Learn" nav link. The browser status bar says gophillygo.org/learn/. Click and you land on the Learn page, with the browser address bar reflecting that same URL (gophillygo.org/learn/). Click browser Back and you return to the home page.

Contrast that to…

Start on the home page and hover on the "Explore" nav link. The browser status bar says gophillygo.org/explore. Click and you land in Explore mode, but the browser address bar still has the home page URL (gophillygo.org). Click browser Back and instead of returning to the home page, you return to the page you were on prior to visiting GoPhlGo.

I think we should normalize these behaviors.

Given the single-page nature of our home and map views, I reckon there are implications I'm overlooking, but here's a strawman:

  • Establish a new URL at gophillygo.org/map.
  • Whenever the app is in map view, the URL should reflect the above /map URL.
  • gophillygo.org/explore should redirect to gophillygo.org/map with the destination picker set to explore mode (ie, "within").
  • Browser history should consider visits to / and /map as distinct entries

Thanks @designmatty for bringing this up.

@flibbertigibbet
Copy link
Contributor

As long as the origin point is populated, browser history does work between the 'home' view and the 'map' or 'explore' views. The case of the origin point not being populated is a separate issue, so created #861.

The '/explore' URL works (goes to the map explore mode), by rewriting to a URL with appropriate parameters set. Losing the separate '/map' route in the URL bar was a consequence of the redesign loading the map on the home view and treating the home and map pages as restyled versions of the same page. The 'learn' page is a separate page, served statically by Django, that does not interact with the JavaScript router.

Modifications to the URL scheme would have consequences for direct linking and handling of permalinks.

@lederer
Copy link
Contributor Author

lederer commented Nov 9, 2017

I tested Back button behavior (Chrome 61/Mac) and made the following observations.

TL;DR

Without an origin, back button behaves unexpectedly in two scenarios:

  • Home -> Explore -> Back
    • Goes to pre-Home instead of Home.
  • Home -> Explore -> More info -> Back
    • Goes to Home instead of Map.

With an origin, back button behaves as expected, but the origin is lost when returning to the Home page from Explore (map), Directions (map), and More info (detail).

Observations

Without origin

Scenario: Explore

  • Start on Home page.
  • Click "Explore".
    • Land on Map page.
  • Click Back button.
    • 👎 Land on page prior to Home page.
    • Expected to land on Home page.

Scenario: Directions

  • Start on Home page.
  • Click "Directions" on a place card.
    • Land on Map page.
  • Click Back button.
    • 👍 Land on Home page.

Scenario: Details

  • Start on Home page.
  • Click "More info" on a place card.
    • Land on Detail page.
  • Click Back button.
    • 👍 Land on Home page.

Scenario: Explore then Details

  • Start on Home page.
  • Click "Explore".
    • Land on Map page.
  • Click "More info" on a place card.
    • Land on Detail page.
  • Click Back button.
    • 👎 Land on Home page.
    • Expected to land on Map page (in explore mode).

With origin

Scenario: Explore

  • Start on Home page.
  • Set origin.
  • Click "Explore".
    • Land on Map page.
  • Click Back button.
    • 👍 Land on Home page…
    • 👎 but origin is lost.
    • Expected to land on Home page with origin retained.

Scenario: Directions

  • Start on Home page.
  • Set origin.
  • Click "Directions" on a place card.
    • Land on Map page.
  • Click Back button.
    • 👍 Land on Home page…
    • 👎 but origin is lost.
    • Expected to land on Home page with origin retained.

Scenario: Details

  • Start on Home page.
  • Set origin.
  • Click "More info" on a place card.
    • Land on Detail page.
  • Click Back button.
    • 👍 Land on Home page…
    • 👎 but origin is lost.
    • Expected to land on Home page with origin retained.

Scenario: Explore then Details

  • Start on Home page.
  • Set origin.
  • Click "Explore".
    • Land on Map page.
  • Click "More info" on a place card.
    • Land on Detail page.
  • Click Back button.
    • 👍 Land on map page (in explore mode)…
    • 👍 with origin retained.

@flibbertigibbet
Copy link
Contributor

Blocked by #1024

@ddohler
Copy link
Contributor

ddohler commented Oct 27, 2020

@lederer do you happen to know if this is still an issue? It looks to me like the routing library has been switched out since this was opened, so I'm wondering whether the behavior has changed at all as part of that work.

@lederer
Copy link
Contributor Author

lederer commented Oct 27, 2020

Still an issue. The behavior described in the original comment remains, as does that described in the TL;DR of the longer follow-up comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants