-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix tooltip not visible for task assignee #23461
Conversation
src/components/MenuItem.js
Outdated
@@ -150,7 +150,7 @@ function MenuItem(props) { | |||
isHovered={isHovered} | |||
isPressed={pressed} | |||
icons={props.icon} | |||
size={CONST.AVATAR_SIZE.DEFAULT} | |||
size={props.avatarSize || CONST.AVATAR_SIZE.DEFAULT} |
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.
Let's set the default value of avatarSize
size to CONST.AVATAR_SIZE.DEFAULT
and remove this kind of fallback.
src/components/MultipleAvatars.js
Outdated
if (props.size === CONST.AVATAR_SIZE.SMALLER) { | ||
avatarContainerStyles = [styles.emptyAvatarSmaller, styles.emptyAvatarMargin]; | ||
} |
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.
Move this logic at the top where avatarContainerStyles
is initially set
src/components/MultipleAvatars.js
Outdated
let avatarContainerStyles = props.size === CONST.AVATAR_SIZE.SMALL ? [styles.emptyAvatarSmall, styles.emptyAvatarMarginSmall] : [styles.emptyAvatar, styles.emptyAvatarMargin]; | ||
avatarContainerStyles = props.size === CONST.AVATAR_SIZE.SMALLER ? [styles.emptyAvatarSmaller, styles.emptyAvatarMargin] : avatarContainerStyles; |
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 merge those?
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.
If merge with two ternary expressions, lint error "Do not nest ternary expressions." is shown. What do you think about 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.
Hmm, maybe write a function that accepts a size and in that function use switch
.
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.
@s77rt Please recheck again.
src/components/MultipleAvatars.js
Outdated
containerStyles = [styles.emptyAvatarSmall, styles.emptyAvatarMarginSmall]; | ||
break; | ||
case CONST.AVATAR_SIZE.SMALLER: | ||
containerStyles = [styles.emptyAvatarSmaller, styles.emptyAvatarMargin]; |
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.
containerStyles = [styles.emptyAvatarSmaller, styles.emptyAvatarMargin]; | |
containerStyles = [styles.emptyAvatarSmaller, styles.emptyAvatarMarginSmaller]; |
I think you meant to set emptyAvatarMarginSmaller
for margin, but it's value being 0 does not look good. Maybe variables.avatarChatSpacing - 6
would be a better fit.
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.
@s77rt
I tested with variables.avatarChatSpacing - 6
, below is the screenshot.
And this is a original margin style.
As you can see, if we set to variables.avatarChatSpacing - 6
, the name is moved to left.
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, previously the margin was set to 12 but that was probably not intended it just was there for not having another style. Can you please upload screenshots for different values 12 8 6
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.
@shawnborton Can you please help us choose the best one here? Previously it was 12. I think 8 would be best to be consist with the margin on the thread replies.
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.
8 works for me!
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.
@shawnborton Thanks for your confirm.
@s77rt So we can use styles.emptyAvatarMarginSmall
without adding new style? styles.emptyAvatarMarginSmall
is 8.
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 adding the new style for this case would be better for future use in case we wanted to change one value and keep the other
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.
@s77rt Committed. Please recheck again. Thanks.
Reviewer Checklist
Screenshots/Videos |
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.
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.
Sorry, I'm actually confused a bit by this PR. It seems different than the proposal?
AFAICT, this PR makes the following changes:
- Update
MenuItem
to have a default value foravatarSize
- Update
MultipleAvatars
to supportCONST.AVATAR_SIZE.SMALLER
- Update
TaskView
to pass an array of avatars toMenuItem
as theicon
props, instead of a single avatar. - Some additional styles to account for
CONST.AVATAR_SIZE.SMALLER
How does this result in a tooltip being displayed where it wasn't before?
Oh, I see ... passing an array of styles to |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.3.45-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.45-7 🚀
|
Details
Fixed Issues
$ #21713
PROPOSAL: #21713 (comment)
Tests
(Web and Desktop only)
Offline tests
N/A
QA Steps
(Web and Desktop only)
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Safari.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Desktop.mov
iOS
Android