Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

"Select its parent tab" setting not working as expected #9395

Closed
bsclifton opened this issue Jun 12, 2017 · 9 comments · Fixed by brave/muon#214
Closed

"Select its parent tab" setting not working as expected #9395

bsclifton opened this issue Jun 12, 2017 · 9 comments · Fixed by brave/muon#214

Comments

@bsclifton
Copy link
Member

  • Did you search for similar issues before submitting this one?
    Yes

  • Describe the issue you encountered:
    Picking Select its parent tab for the When closing an active tab setting does not always behave as expected.

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    All

  • Brave Version (revision SHA):
    0.16.9 (fba98fc)

  • Steps to reproduce:

    1. Open https://twitter.com/ (tab 1)
    2. Middle two links on the page, which causes two new tabs to open (tabs 2 and 3)
    3. Switch focus to tab 3
    4. Switch focus to tab 2 and then close it
  • Actual result:
    Focus is given to tab 3 (NOT tab 1, which is the parent)

  • Expected result:
    Focus is given to tab 1 (the parent, aka the opener)

  • Will the steps above reproduce in a fresh profile? If not what other info can be added?
    yes

  • Is this an issue in the currently released version?
    yes

  • Can this issue be consistently reproduced?

  • Extra QA steps:
    1.
    2.
    3.

  • Screenshot if needed:
    Showing selection is parent
    image

  • Any related issues:

@bsclifton
Copy link
Member Author

cc: @BrendanEich

@bsclifton
Copy link
Member Author

Here's the line w/ the problem
Parent only goes back to the parent if it was the last active tab

@bsclifton
Copy link
Member Author

Original behavior

NEXT - If you look at older versions of the code,
you'll notice that we originally used this method. This also seems to be the default behavior for Chrome.

Introducing two new options

The LAST_ACTIVE and PARENT options were introduced when @NejcZdovc fixed #6553 with PR
#6573 (implementation can be seen here).
With these new options, it's important to note the default is now PARENT and is being stored in the preferences.

Changing the default behavior

This logic was moved from frameStateUtil (renderer process) to the tabsReducer (browser process) with PR #9023.
When this was done, the PARENT option has its behavior changed. Instead of always jumping back to the parent frame, it's now only only going to the parent IF the parent was the last active tab. Otherwise, it would default to the next tab.

Proposed fix

To fix this I'd like to restore the PARENT option to always open the parent tab ID, like it used to. I have made the change needed and the tests work as expected. (side note: I'm not always seeing openerTabId be set)

@bsclifton
Copy link
Member Author

BTW - If we'd like to change the default behavior (which is currently PARENT), let's open up a new issue 😄

@luixxiul
Copy link
Contributor

The fix does not work when you open tabs with different domains. Please open the gif below and reload the tab to repeat it.

a

If the opened tab has the same domain as the parent tab does, the setting works. See:

a

@srirambv
Copy link
Collaborator

Verified same behavior on Windows as @luixxiul mentioned

@bridiver
Copy link
Collaborator

this needs the exact URLs/links to replicate. Links that appear to work the same may actually take completely different paths inside chromium

@luixxiul
Copy link
Contributor

@LaurenWags
Copy link
Member

Verified same behavior as reported by @luixxiul on MacOS

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