-
Notifications
You must be signed in to change notification settings - Fork 971
Conversation
app/browser/reducers/tabsReducer.js
Outdated
if (nextTabId === tabState.TAB_ID_NONE) { | ||
nextTabId = tabState.get('tabs').first() | ||
} | ||
|
||
if (nextTabId !== tabState.TAB_ID_NONE) { |
There was a problem hiding this comment.
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?
This PR was changes I made that turned out not to be necessary for the fix and this is just leftover. It's actually not correct anyway because it should get the first tab in the window and that is already covered by "next" so this isn't needed
… On Jun 17, 2017, at 11:13 PM, Brian Clifton ***@***.***> wrote:
@bsclifton commented on this pull request.
In app/browser/reducers/tabsReducer.js:
> @@ -67,6 +67,11 @@ const updateActiveTab = (state, closeTabId) => {
}
}
+ // fall back to first tab
+ if (nextTabId === tabState.TAB_ID_NONE) {
+ nextTabId = tabState.get('tabs').first()
+ }
+
if (nextTabId !== tabState.TAB_ID_NONE) {
When I wrote the unit tests for this, I was unable to find a way to hit this condition. 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?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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 |
0dfa3ee
to
7cc5e1b
Compare
7cc5e1b
to
c8d2fad
Compare
@cezaraugusto it looks like this overrides some recent changes you made to the component. Can you make sure this covers whatever changes you made? |
I think #8852 is actually moving in the wrong direction with |
there is an issue with this PR that I am fixing right now |
c8d2fad
to
2d77f3c
Compare
updated @cezaraugusto |
2d77f3c
to
3bb6b1f
Compare
There was a problem hiding this 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:
- Have three tabs open
- Set first as active
- Hover over second, close
- Fourth tab is previewed as expected, but before preview happens you can see active tab content..
0615d5b
to
9c46c3d
Compare
@@ -32,23 +32,6 @@ class TabPage extends React.Component { | |||
this.onMouseLeave = this.onMouseLeave.bind(this) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"
9c46c3d
to
a9cfb1d
Compare
There was a problem hiding this 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 ++
* 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
@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 |
@luixxiul awesome, thanks for that |
* 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
…(yet) in 0.17.x Auditors: @cezaraugusto
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
git rebase -i
to squash commits (if needed).Test Plan: #9542 (review)
Reviewer Checklist:
Tests