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

Use muon's tab_strip_model for driving index and active #10572

Closed
wants to merge 1 commit into from

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Aug 17, 2017

Note this PR is against 0.18.x so it should be merged there after reviewed, and then uplifted in reverse up to master.

Requires muon PR: brave/muon#277

Fix #10436
Fix #9385
Fix #9722
Fix #10561
Fix #9083
Fix #9671
Fix #10038
Fix #10384
Fix #10532

and probably several others.

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:

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

api.updateTabsStateForWindow(state, tabValue.get('windowId'))
},
updateTabsStateForWindow: (state, windowId) => {
tabState.getTabsByWindowId(state, windowId).forEach((tabValue) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Iterating through all the tabs is a potential performance problem that we've seen before when there are a lot of tabs so I think we should try to limit this to only the tabs that have changed

Copy link
Member Author

Choose a reason for hiding this comment

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

yep I was planning to try to limit this but wanted a review on the approach otherwise first and to get everything working nicely otherwise first. Will do.

Copy link
Member Author

Choose a reason for hiding this comment

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

profiled this and it isn't a source of performance problems even with 6 tab pages, so will leave it as is for now.

},
updateTabsStateForWindow: (state, windowId) => {
tabState.getTabsByWindowId(state, windowId).forEach((tabValue) => {
updateTab(tabValue.get('tabId'))
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is going to update async in another action. updateTab is designed to be called from an event, but since we're already in a reducer when this is called I think it would be better to update directly

Copy link
Member Author

Choose a reason for hiding this comment

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

will do

@bbondy bbondy force-pushed the tab-index branch 3 times, most recently from da6d73e to 4f02b54 Compare August 22, 2017 19:26
Fix #10436
Fix #9385
Fix #9722
Fix #10561
Fix #9083
Fix #9671
Fix #10038
Fix #10384
Fix #10532

and probably several others.
@bbondy
Copy link
Member Author

bbondy commented Aug 23, 2017

Closing for one PR'ed against master instead.

@bbondy bbondy closed this Aug 23, 2017

tab.on('tab-strip-empty', () => {
tab.once('will-attach', () => {
const tabValue = getTabValue(tabId)
Copy link
Collaborator

Choose a reason for hiding this comment

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

couldn't this happen in appActions.tabWillAttach instead of having a second action for tabStripEmpty?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and actually isn't there a potential here for the windowId to be -1 at this point? Maybe it's better to capture the window id before detach?

@diracdeltas diracdeltas deleted the tab-index branch January 4, 2018 21:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants