-
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 custom workspace avatar border radius is different #24088
Conversation
@thesahindia Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Solved. Screenshots added! |
? [StyleUtils.getAvatarStyle(props.size), ...props.imageStyles, StyleUtils.getAvatarBorderRadius(props.size, props.type)] | ||
: [StyleUtils.getAvatarStyle(props.size), StyleUtils.getAvatarBorderStyle(props.size, props.type)]; | ||
? [StyleUtils.getAvatarStyle(props.size), ...props.imageStyles, styles.noBorderRadius] | ||
: [StyleUtils.getAvatarStyle(props.size), styles.noBorderRadius]; | ||
|
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.
Explanation of the problem:
In our previous PR, we are removing multiple border radius that is applied on both parent and child view. However, we forget to cover the case where the workspace avatar is a custom image because it is rendered differently.
Lines 91 to 114 in 2f750ad
{_.isFunction(props.source) || imageError ? ( | |
<View style={iconStyle}> | |
<Icon | |
src={imageError ? fallbackAvatar : props.source} | |
height={iconSize} | |
width={iconSize} | |
fill={imageError ? themeColors.offline : iconFillColor} | |
additionalStyles={[ | |
StyleUtils.getAvatarBorderStyle(props.size, props.type), | |
isWorkspace ? StyleUtils.getDefaultWorkspaceAvatarColor(props.name) : {}, | |
imageError ? StyleUtils.getBackgroundColorStyle(themeColors.fallbackIconColor) : {}, | |
...props.iconAdditionalStyles, | |
]} | |
/> | |
</View> | |
) : ( | |
<View style={[iconStyle, StyleUtils.getAvatarBorderStyle(props.size, props.type), ...props.iconAdditionalStyles]}> | |
<Image | |
source={{uri: props.source}} | |
style={imageStyle} | |
onError={() => setImageError(true)} | |
/> | |
</View> | |
)} |
So, in this PR, I removed the border radius from the image style.
The reason StyleUtils.getAvatarBorderStyle(props.size, props.type)
is added is because StyleUtils.getAvatarStyle(props.size)
set the border-radius value to be the same as the width and height of the avatar. This makes the avatar will always completely rounded, which is wrong for workspace avatar.
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 found that we have a previous commit that is trying to remove the redundant border-radius, but because there are lot of changes to the avatar, the redundant border-radius happen again.
Reviewer Checklist
Screenshots/VideosAndroid |
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 couldn't build the app on android. Approving it as it tested well on other platforms and @bernhardoj has already attached the screenshot for android.
@thesahindia thanks for the review. Btw, can we treat this as not a regression? This border issue exists on both default and custom workspace avatars, but in our previous PR, we only handle the default workspace avatar case by fixing the redundant border-radius and removing the background color workaround. Removing the background color workaround is the reason we can see the gap as shown below. cc: @danieldoglas |
@bernhardoj I won't treat this one as a regression because it was not caused by your previous PR, but I'll consider that both should have been fixed in the previous PR so the bounty will stay the same. Is that OK for you? |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@danieldoglas yes, that's totally fine. Thanks! |
🚀 Deployed to staging by https://github.com/danieldoglas in version: 1.3.54-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/danieldoglas in version: 1.3.54-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.54-13 🚀
|
Details
This is a regression of #23707 where we want to fix the workspace icon border radius. However, we forget to test the case when the workspace avatar is a custom image.
Fixed Issues
$ #24069
$ #23426
PROPOSAL:
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Prerequisite:
a. have more than 4 workspaces
b. the 4th workspace avatar should be a custom image
c. one of the 1st to 3rd workspace avatars should be a custom image
You can zoom in to notice it easier
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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android