fix tooltip not visible for task assignee#23461
Conversation
| isPressed={pressed} | ||
| icons={props.icon} | ||
| size={CONST.AVATAR_SIZE.DEFAULT} | ||
| size={props.avatarSize || CONST.AVATAR_SIZE.DEFAULT} |
There was a problem hiding this comment.
Let's set the default value of avatarSize size to CONST.AVATAR_SIZE.DEFAULT and remove this kind of fallback.
| if (props.size === CONST.AVATAR_SIZE.SMALLER) { | ||
| avatarContainerStyles = [styles.emptyAvatarSmaller, styles.emptyAvatarMargin]; | ||
| } |
There was a problem hiding this comment.
Move this logic at the top where avatarContainerStyles is initially set
| 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.
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.
Hmm, maybe write a function that accepts a size and in that function use switch.
| containerStyles = [styles.emptyAvatarSmall, styles.emptyAvatarMarginSmall]; | ||
| break; | ||
| case CONST.AVATAR_SIZE.SMALLER: | ||
| containerStyles = [styles.emptyAvatarSmaller, styles.emptyAvatarMargin]; |
There was a problem hiding this comment.
| 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.
@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.
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.
@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.
@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.
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.
@s77rt Committed. Please recheck again. Thanks.
Reviewer Checklist
Screenshots/Videos |
roryabraham
left a comment
There was a problem hiding this comment.
Sorry, I'm actually confused a bit by this PR. It seems different than the proposal?
AFAICT, this PR makes the following changes:
- Update
MenuItemto have a default value foravatarSize - Update
MultipleAvatarsto supportCONST.AVATAR_SIZE.SMALLER - Update
TaskViewto pass an array of avatars toMenuItemas theiconprops, 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Safari.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Desktop.mov
iOS
Android