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

"Back" link behaves differently for hashtag searches #3366

Closed
1 task done
ghost opened this issue May 27, 2017 · 3 comments
Closed
1 task done

"Back" link behaves differently for hashtag searches #3366

ghost opened this issue May 27, 2017 · 3 comments
Labels
ui Front-end, design

Comments

@ghost
Copy link

ghost commented May 27, 2017

As I mentioned on #2593, the behavior of the "Back" link at the top of the rightmost column is usually to go back to the previous view, whatever that was. In this it behaves just like the browser's back button. For hashtag searches though (regardless of whether it was opened from the rightmost column itself or a different one), the "Back" link at the top instead goes to the default "getting-started" view (adding a new page to the browser history instead of moving back one page). I think this is a bug.


  • I searched or browsed the repo’s other issues to ensure this is not a duplicate.
@akihikodaki
Copy link
Contributor

That is problematic especially for single-column layout.

@akihikodaki akihikodaki added the ui Front-end, design label May 30, 2017
@happycoloredbanana
Copy link
Contributor

There seem to be a couple of problems with the "Back" link:

  1. There are two types of "Backs": the ones that actually perform the "go back" operation on the history and the ones that navigate to the "getting started" page. This creates inconsistency regarding what should the user expect from a "Back" link.

  2. The navigation to the "get started" is done by pushing to the history. This is how navigation is done in react-router. However, it's counter-intuitive considering the name of the link - "Back".

  3. On the other hand, just blindly going back in history can also be problematic due to react-router's limitations. E.g., 1) go to github.com; 2) paste something like "https://yourmastoserver/web/accounts/666" into your browser; 3) see the web gui navigating to the "account" column; 4) click the "Back" link - voila you are back on github.

IMHO, fixing all this mess would be an attrition war with react-router. As a liter alternative for a fix, I suggest following:

  1. Make both "Backs" behave in the same consistent way: go one step back in history
  2. If the history length is one, make the "Back" link disappear. Or change it to something more intuitive indicating that it will lead to the "get started" page.
  3. Live with the fact that we cannot prevent navigating out of the app in all situations.

@Gargron
Copy link
Member

Gargron commented Jun 3, 2017

I corrected the difference between the two back buttons in #3207, but the issue with going back to non-web-UI history (#3515) is harder. React router does not store its own history, the browser history does not reveal what the items in the history stack are (only the length), so there is no way to tell if we're going back to a route in the web UI or a completely different website. The solution to that would be to add a listener to the browser history to manually record the history stack and use that for navigating "back"

@Gargron Gargron closed this as completed Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Front-end, design
Projects
None yet
Development

No branches or pull requests

3 participants