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

18 Unbelievable ways to get rid of dead tabs on tab close #11311

Merged
merged 2 commits into from
Oct 6, 2017
Merged

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Oct 6, 2017

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

  • Test everything relating to closing tabs, close tabs to the left, right, close other tabs, close tab page, close individual tabs.

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@@ -184,6 +211,7 @@ const tabsReducer = (state, action, immutableAction) => {
tabs.setActive(nextActiveTabId)
}
})
tabs.forgetTab(tabId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const tabsPerPage = Number(getSetting(settings.TABS_PER_PAGE))
const startTabIndex = tabPageIndex * tabsPerPage
const pinnedTabsCount = tabState.getPinnedTabsByWindowId(state, windowId).size
tabState.getTabsByWindowId(state, windowId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a whole bunch happening here- would it make sense to follow up and move this logic into tabState? Like a tabState.getTabsForClose (or similar)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense but I'm going to pass on it for now since I have other 0.19.x high priority things to focus on, but that's valid minor refactor for sure.

const index = tabValue.get('index')
const windowId = tabValue.get('windowId')
const pinnedTabsCount = tabState.getPinnedTabsByWindowId(state, windowId).size
tabState.getTabsByWindowId(state, windowId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above- the method chaining should work fine... it's just a lot to read

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 👌 I like this

Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manual test plan pass, personal crazy stress test pass, automated test pass, LGTM

@bbondy bbondy merged commit 511bf20 into 0.19.x Oct 6, 2017
bbondy added a commit that referenced this pull request Oct 6, 2017
18 Unbelievable ways to get rid of dead tabs on tab close
@cezaraugusto cezaraugusto deleted the 11028 branch October 6, 2017 16:55
bbondy added a commit that referenced this pull request Oct 6, 2017
18 Unbelievable ways to get rid of dead tabs on tab close
syuan100 pushed a commit to syuan100/browser-laptop that referenced this pull request Nov 9, 2017
18 Unbelievable ways to get rid of dead tabs on tab close
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants