Page MenuHomePhabricator

Browser back button works poorly with expanded article sections
Closed, ResolvedPublic

Description

Tapping the back button after you've expanded articles sections will cycle you through expanded sections first and then to a previous article. It should go to the previous article first.


Version: unspecified
Severity: normal

Details

Reference
bz36848

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:24 AM
bzimport set Reference to bz36848.
bzimport added a subscriber: Unknown Object (MLST).

I've been wrestling with what the right thing to do with the hash is.

In the current situation it actually gives a good way to jump up the article. Although we have a jump back a section link at the bottom of each section I actually use the browser back button to jump back up the article to previous sections on my Android). I agree though this becomes less useful in bigger articles

It is also useful to be able to share a page with a hash as I can share the page with a current section open (e.g. not the default closed section that needs to be toggled open).

Several solutions

  1. Keep existing behaviour
  2. We can use the history api to replaceState so that only the last hash is maintained. On clicking back you return to the last page.
  3. We set an initial hash and then replace all further hashes. One back button press thus takes you to the top of the page. Two back button presses to the last page

Is there some way we could user test the best way to deal with this?

philinje wrote:

Related bug at 36867, possibly a duplicate.

I guess what happens is that with one section open, there is no movement up to a previous section. So it looks like nothing has happened. Then if the same section is opened and closed multiple times (or that is attempted), several presses of Back do nothing.

This was a problem when the section reveal was slow or buggy.

My vote is for option 3 above, because in that case something useful and visible occurs with each Back press.

This is not entirely true. On my Android clicking back does move back to the previous section. So I guess that is device specific...

  • Bug 36867 has been marked as a duplicate of this bug. ***
  • Bug 36980 has been marked as a duplicate of this bug. ***

Feedback from the site has suggested not everyone is happy with this.
A different opinion "Can you please fix your app so that when you are on a page and visit another page, hitting the back arrow will take you back to the previous section you were in? As it is now, hitting the back arrow takes you back to the beginning of the previous page and you lose your spot, which is really annoying if you were in the middle of a long article."