-
Notifications
You must be signed in to change notification settings - Fork 975
Refactor of tabs related components (redux component) #8396
Conversation
7e416ab
to
bc46948
Compare
ecde624
to
e44e6d4
Compare
01742ee
to
1ecede5
Compare
c0adaaf
to
ad1decb
Compare
I will squash it after a review, don't merge without squashing it first |
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.
sequential tab closing isn't recovering tab size after mouse leaves the tab. see https://github.com/brave/browser-laptop/pull/8396/files#diff-15331dd5e010a9a3d250a1a37d851653R48 this is the only blocker I could find. There is also wrong variable name for audio muted, but just for proper readability, feature works.
// We switch to blue top bar for all breakpoints but default | ||
return this.props.frame.get('breakpoint') === 'default' | ||
get audioIcon () { | ||
const isMuted = this.props.pageCanPlayAudio && !this.props.audioMuted |
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.
variable defines that page can play audio, and is not muted, maybe isNotMuted
?
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.
Fixed
get pageCanPlayAudio () { | ||
return !!this.props.frame.get('audioPlaybackActive') | ||
class AudioTabIcon extends React.Component { | ||
constructor (props) { |
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.
is props
required? maybe for redux component? afaik this is only needed if you want to use this.props
in the constructor.
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.
Yeah props
is required because of redux. More about this PR #9061
const frame = frameStateUtil.getFrameByKey(currentWindow, ownProps.frameKey) | ||
|
||
const props = {} | ||
// used in renderer |
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.
can we remove this comment to avoid confusion?
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.
Can you tell me a little bit more about this? I added this because this way you exactly know what is used in renderer and what in other functions in the component. Because of that changing and looking for thing should be easier then looking at a big list of variables.
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 agree, but // used in renderer
is followed by a blank line and then we have // used in other functions
. If both applies wouldn't be better to // used in render and in other functions
? Reading the code the blank line between both comments lead me to think that comment was left after some code removal.
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.
Yeah sorry, didn't check out the code. If nothing is added for a renderer, this line should be removed. I agree
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.
Fixed
app/renderer/lib/tabUtil.js
Outdated
@@ -32,85 +28,11 @@ module.exports.tabUpdateFrameRate = 66 | |||
|
|||
/** | |||
* Check whether or not current breakpoint match defined criteria | |||
* @param {Object} props - Object that hosts the tab breakpoint | |||
* @param {Object} breakpoint - Brake point value |
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.
minor: typo
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.
Fixed
app/renderer/components/tabs/tabs.js
Outdated
} | ||
|
||
onMouseLeave () { | ||
if (this.props.fixTabWidth) { | ||
return |
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.
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.
@cezaraugusto this if was copied from https://github.com/brave/browser-laptop/pull/8396/files#diff-15331dd5e010a9a3d250a1a37d851653L132. If I remove it from a function is working correctly, but I would like to understand why it was there in the first place
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.
Ok, now I can see where the problem was. I switched if statement. It's fixed now.
fyi and QA guidance I manually tested the following, all passing.
|
23252c5
to
84fd57a
Compare
@cezaraugusto thank you very much for a thorough review. I think that all you comments were addressed. |
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.
automated tests pass, str pass, own manual tests pass, comments addressed, nice work lgtm
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.
While testing, I found some issues and fixed (see 446a7f2)
Changes look good! I manually tested (see feedback about close button not auto-highlighting). Other than that, I didn't find any issues 😄
(More tests are always welcome 😄 )
resolve(iconHref + resolution) | ||
} | ||
}) | ||
} |
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.
Nice! Thanks for removing this 😄
… way: - iconSize was not being exported correctly (it always had undefined). I moved to config and verified it has a value now - the tab size methods now handle null/undefined properly - updated tabContentState to use the braveExtensionId constant Auditors: @NejcZdovc
Refactor of tabs related components (redux component)
git rebase -i
to squash commits (if needed).Resolves #8690
Test Plan: