-
Notifications
You must be signed in to change notification settings - Fork 3k
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: Image shrinks while loading in carousel #37739
Conversation
@abdulrahuman5196 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] |
There's an issue on mWeb Safari that the order of attachments in carousel is messed up. This issue already exists on Screen.Recording.2024-03-05.at.19.43.07-compressed.mov |
src/components/Lightbox/index.tsx
Outdated
@@ -217,7 +217,7 @@ function Lightbox({isAuthTokenRequired = false, uri, onScaleChanged: onScaleChan | |||
> | |||
<Image | |||
source={{uri}} | |||
style={contentSize ?? DEFAULT_IMAGE_DIMENSION} | |||
style={[contentSize ?? DEFAULT_IMAGE_DIMENSION, !contentSize && {opacity: 0}]} |
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.
Kindly remove inline styles.
And contentSize ?? DEFAULT_IMAGE_DIMENSION
why are we still setting DEFAULT_IMAGE_DIMENSION and hiding via opacity.
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.
Updated! Removed DEFAULT_IMAGE_DIMENSION
fallback and used styles.opacity0
.
We still need the default image size, otherwise Image
's onLoad
function wouldn't trigger.
invisibleImage: {
opacity: 0,
width: 200,
height: 200,
}
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.
Got it.
@tienifr I am see loader shown for a moment even after the image is shown, even in your android video I am seeing the same. could you kindly check on this? |
That already happened in production app: video_2024-03-11_16-12-48.mp4I noticed the loading on simulator is a little bit (not considerably) longer, maybe because |
Reviewing now |
Bump @abdulrahuman5196. |
@abdulrahuman5196 Do we have any blocker? |
Hi, I will work on this today |
Sorry for the delay. I am reviewing now. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-18.at.10.59.19.PM.mp4Android: mWeb ChromeScreen.Recording.2024-03-18.at.11.09.24.PM.mp4iOS: NativeScreen.Recording.2024-03-18.at.10.51.15.PM.mp4iOS: mWeb SafariScreen.Recording.2024-03-18.at.10.52.11.PM.mp4MacOS: Chrome / SafariScreen.Recording.2024-03-18.at.9.43.16.PM.mp4MacOS: DesktopScreen.Recording.2024-03-18.at.9.45.05.PM.mp4 |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @iwiznia
🎀 👀 🎀
C+ Reviewed
✋ 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/iwiznia in version: 1.4.55-0 🚀
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 1.4.55-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.55-3 🚀
|
Details
This PR hides the image while it's still loading and only shows the loading indicator then, to avoid the issue that image shrinks to default size (200x200) on native devices since its size is not known yet.
Fixed Issues
$ #35615
PROPOSAL: #35615 (comment)
Tests
Offline tests
NA
QA Steps
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
Screen.Recording.2024-03-05.at.19.45.29-compressed.mov
Android: mWeb Chrome
Screen.Recording.2024-03-05.at.19.49.57-compressed.mov
iOS: Native
Screen.Recording.2024-03-05.at.19.42.15-compressed.mov
iOS: mWeb Safari
Screen.Recording.2024-03-05.at.19.43.07-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2024-03-05.at.19.51.34-compressed.mov
MacOS: Desktop
Screen.Recording.2024-03-05.at.19.51.34-compressed.mov