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

Issue 9306 related #9542

Merged
merged 1 commit into from
Jun 29, 2017
Merged

Issue 9306 related #9542

merged 1 commit into from
Jun 29, 2017

Conversation

bridiver
Copy link
Collaborator

@bridiver bridiver commented Jun 18, 2017

Submitter Checklist:
@cezaraugusto I did some related changes for #9306 that turned out not to be necessary, but are still good to have and can go into 0.19. Still need to check tests, but wanted to get this out there to look at

  • 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: #9542 (review)

  1. Have 3 tabs open
  2. Set the 1st tab as active one
  3. Hover over the 2nd tab
  4. Close it
  5. Test that you do not see active tab content
  6. Test that the 3rd tab is previewed

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

@bridiver bridiver added this to the 0.19.x (Nightly Channel) milestone Jun 18, 2017
@bridiver bridiver self-assigned this Jun 18, 2017
if (nextTabId === tabState.TAB_ID_NONE) {
nextTabId = tabState.get('tabs').first()
}

if (nextTabId !== tabState.TAB_ID_NONE) {
Copy link
Member

@bsclifton bsclifton Jun 18, 2017

Choose a reason for hiding this comment

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

When I wrote the unit tests for this, I was unable to find a way to hit this condition (falling back to first).

When you originally pulled the logic out of frameStateUtil and moved here, you had a similar block. Since it wasn't possible to hit, I had removed it. Did you see a case where this runs?

@bridiver
Copy link
Collaborator Author

bridiver commented Jun 18, 2017 via email

@cezaraugusto
Copy link
Contributor

@bridiver are we following the dumb/smart components convention where util files are made to host the logic, leaving the main component just for presentational purposes?

I'm changing the way we preview tabs in #8852 and if this turns to be accepted first I'll need to re-work the logic

@bridiver
Copy link
Collaborator Author

the logic should be in the reducers (which can use state/util files) and yes, the components should be as "dumb" as possible. Ideally action should be things like tabClicked or tabMouseEnter letting the reducer to decide what actually needs to be done in response

@bridiver
Copy link
Collaborator Author

@cezaraugusto it looks like this overrides some recent changes you made to the component. Can you make sure this covers whatever changes you made?

@cezaraugusto
Copy link
Contributor

@bridiver yes, thanks for the reminder. I'll make sure to update your changes.

#8852 will also change it so keeping an eye anyway on which goes first.

@cezaraugusto cezaraugusto self-assigned this Jun 19, 2017
@bridiver
Copy link
Collaborator Author

I think #8852 is actually moving in the wrong direction with setPreviewMode. "setter" actions should be deprecated and we don't want to call multiple actions together. setPreviewMode doesn't provide any new information that setPreviewFrame doesn't already provide. I think better to merge this first (assuming there are no issues with it) and then make other changes

@bridiver
Copy link
Collaborator Author

there is an issue with this PR that I am fixing right now

@bridiver
Copy link
Collaborator Author

updated @cezaraugusto
I really think we should merge this one first because it's only going to get more complicated to merge the functionality if we keep adding things to the component

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.

this regressed #9539 and also made next tab preview after close to flash with active tab.

for flashing of active tab content, here's the str:

  1. Have three tabs open
  2. Set first as active
  3. Hover over second, close
  4. Fourth tab is previewed as expected, but before preview happens you can see active tab content..

@cezaraugusto
Copy link
Contributor

@bridiver btw once we're good to go I'm going to accept this one before the land of #8852 as per your request. That PR will be included in 0.18.x per last weekly triage meeting, so I'm going to move this to the same milestone as well.

@cezaraugusto cezaraugusto modified the milestones: 0.18.x (Developer Channel), 0.19.x (Nightly Channel) Jun 21, 2017
@bridiver bridiver force-pushed the issue-9306-related branch 2 times, most recently from 0615d5b to 9c46c3d Compare June 27, 2017 01:55
@@ -32,23 +32,6 @@ class TabPage extends React.Component {
this.onMouseLeave = this.onMouseLeave.bind(this)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think those should be removed too

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe remove it all given other handlers are not bound to the constructor but curious if that affects reduxComponent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually I'm surprised this doesn't cause an error, but I'll remove it

Copy link
Contributor

Choose a reason for hiding this comment

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

btw there's no listener for tab page previews anymore and I can't preview a tab set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah, I think I accidentally grouped them together. Is there a test for it that is failing or did you just find it by manual testing?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, you can try npm run test -- --grep="tab pages tab page previews hovering over a tab page changes it"

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.

Feature works fine, had a suspicious failling test with "tab tests webview previews when tab is hovered does not show tab previews when setting is off" but passing locally so intermittent. Thanks ++

@cezaraugusto cezaraugusto merged commit 0bd0287 into master Jun 29, 2017
@cezaraugusto cezaraugusto deleted the issue-9306-related branch June 29, 2017 01:21
cezaraugusto added a commit that referenced this pull request Jun 29, 2017
* This sets the ground for the *new* tab preview behavior
* making component dumb and letting the reducer to
* decide what actually needs to be done in response
@luixxiul
Copy link
Contributor

@cezaraugusto I added the QA steps for the tab preview issue to the 1st post based on your feedback here: #9542 (review). Please correct them if they are not right (I replaced fourth tab with 3rd tab as there should be only 3 tabs opened).

@cezaraugusto
Copy link
Contributor

@luixxiul awesome, thanks for that

cezaraugusto added a commit that referenced this pull request Jul 8, 2017
* This sets the ground for the *new* tab preview behavior
* making component dumb and letting the reducer to
* decide what actually needs to be done in response
bsclifton added a commit that referenced this pull request Jul 10, 2017
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