Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Use pushState instead of replaceState when changing tabs in a PR (aka "please don't break the back button") #3

Open
isaacs opened this issue Jun 4, 2013 · 18 comments

Comments

@isaacs
Copy link
Owner

isaacs commented Jun 4, 2013

Reproduce:

  1. Open the pull requests page: https://github.com/joyent/node/pulls
  2. Click on a pull request. Shows the "Discussion" tab.
  3. Click the "Commits" tab. The url changes, and the page updates.
  4. Click the "Back" button.

Expect: Return to the "Discussion" tab.
Actual: Returns to the https://github.com/joyent/node/pulls page

@jzaefferer
Copy link

I think they used replaceState on purpose, so the lots of tab changes don't stack up in the history. It took me a while to get used to that, but I find it very unlikely that they would change that behaviour, considering the drawback.

@isaacs
Copy link
Owner Author

isaacs commented Jun 11, 2013

What's the drawback? Accessibility?

@jzaefferer
Copy link

I think the idea is this: You look at a PR and do a lot of switching between the three tabs. With pushState, they would pile up as history entries. To then go back, you'd have to use the back button for each of those. Since the tabs don't look like links, the user might expect the back button to lead them back to the previous page instantly.

Both approaches seem valid to me, so its more of a design decision then a bug.

@isaacs
Copy link
Owner Author

isaacs commented Jun 12, 2013

What usually happens for me is that I click a tab, then then press the cmd-[ keyboard command to go back, end up at the list of pull requests, curse loudly, press cmd-] to go forward to the pull request page, only to see the same tab I already was trying to get back from, curse again, then laboriously drag my mouse over to the tab and explicitly click it.

Almost the whole page changes. There's no excuse for it not being a history entry.

@meshy
Copy link

meshy commented Sep 23, 2013

👍

@carols10cents
Copy link

This bites me every damn day.

@patcon
Copy link

patcon commented Oct 24, 2013

Ditto. EVERY day. I would have thought something pavlovian would have clicked by now in my brain...

@isaacs
Copy link
Owner Author

isaacs commented Oct 24, 2013

Show me someone who thinks it's better the way that it is, and I'll show you someone who doesn't use github issues.

@cvrebert
Copy link

👍

1 similar comment
@marcomorain
Copy link

+1

@qualidafial
Copy link

👍 This bites me all the time.

@rmm5t
Copy link

rmm5t commented Nov 25, 2015

What usually happens for me is that I click a tab, then then press the cmd-[ keyboard command to go back, end up at the list of pull requests, curse loudly, press cmd-] to go forward to the pull request page, only to see the same tab I already was trying to get back from, curse again, then laboriously drag my mouse over to the tab and explicitly click it.

This! Drives me nuts too.

@marcomorain
Copy link

💯 👍

@qualidafial
Copy link

@marcomorain Please note this project is not an official channel for Github issues. If you agree with this issue, read and follow the instructions in the project README: send a message to Github Support, and report back in comments on this issue with a relevant excerpt of your message and Github's response.

Edit: Just realized I never posted my interaction with Github.

Sent to Github support:

Steps to reproduce problem:

  1. Open pull requests
  2. Navigate to a specific pull request
  3. Navigate to Files Changed tab
  4. Click back button or type Command+[ to navigate backward
  5. Land on pull requests page instead of PR conversation tab.
  6. Curse loudly.
  7. Navigate forward again
  8. Scroll to top.
  9. Click conversation tab.

I've been using Github on a daily basis for a year and this one still bites me every time.

See #3

Response:

Thanks for writing in, I'll definitely pass your +1 for that feature on to the team to consider. Let me know if there's anything else I can help you with!

@qualidafial
Copy link

qualidafial commented Jun 3, 2016

I believe this is resolved. Can others verify?

@OliverJAsh
Copy link

I can confirm that clicking back on the commits page does take you back one page rather than 2.

@arnavb
Copy link

arnavb commented Feb 2, 2019

I don't think this issue applies anymore. I go back to the conversation tab when I click back.

@OliverJAsh
Copy link

There is however another issue similar to this one that hasn't been fixed: #1464

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

No branches or pull requests