Closed lanitochka17 closed 5 months ago
Job added to Upwork: https://www.upwork.com/jobs/~019fd6243b644a1821
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External
)
Triggered auto assignment to @johncschuster (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
The image is reduced for a moment when quickly slide forward/back images using the arrows
In here and here, we're showing the image even though the size was not determined, we use the DEFAULT_IMAGE_DIMENSION
as the default in that case, which leads to the image being small for a short time while it loads, then after the image dimensions are loaded, it will show in full size.
In here and here, make sure the image is not visible while its size is being loaded, we can use opacity: 0
, visibilityHidden
or similar. While the image is still loading the dimensions, the LoadingIndicator will show here so the UX is smooth.
So in here
style={[contentSize ?? DEFAULT_IMAGE_DIMENSION, !contentSize && {opacity: 0}]}
style={[fallbackSize, !contentSize && {opacity: 0}]}
(There're a couple more conditions to determine the fallbackSize
here, if we want to make sure to account for that condition, we can return undefined
there, then in here if fallbackSize
is undefined, fallback to DEFAULT_IMAGE_DIMENSION
, and set {opacity: 0}
just like we did above in this case)
If we're worried about the onLoad
not being triggered if the image is not visible (although when I test on Android, iOS it works fine), we can use Image.getSize
inside Image
component for native, to determine the sizes rather than relying on Image
's onLoad
.
Do not render the image altogether if the size is not determined, meanwhile the Image.getSize
can be used to populate the contentSize
instead
~Will work on review today~
Bumping for Melvin
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Sorry for the delay. Working on review now
@tienifr From the proposal here https://github.com/Expensify/App/issues/35615#issuecomment-1922853744,
To summarize, we show the image before the image size is determined by the system, causing it to show in a fallback size. The suggestion is to not show the image and show the loading indicator
.
@johncschuster This expectation seems fine IMO, But I would like to confirm the expectation.
Followup question to @tienifr Is there a way to re-use the image sizes which we got previously?
Followup question to @tienifr Is there a way to re-use the image sizes which we got previously?
@abdulrahuman5196 Yes, we can re-use it by not setting the contentSize
(and subsequently the cachedImageDimensions
cache value) to undefined
here when the current lightbox becomes invisible. But this won't fix the issue fully because the issue will still happen when the image is rendered the first time. I agree though that we can surely consider it as a further optimization.
@abdulrahuman5196 / @tienifr To make sure I understand:
The suggestion is to not show the image and show the loading indicator.
Are you suggesting that we shouldn't show an image at all when a user is in image preview mode and swiping through images, and instead show a loading indicator?
@johncschuster no, let me clarify
When swiping to the next image, currently it will show a small image in the center of the screen, with a loading indicator, then after the image is fully loaded, it will show with correct size.
The suggestion is to not show the small image initially. Instead, it will only show loading indicator while the image is loading (which is brief), then after the image is loaded and the size is known, the full image will be shown with the correct size from the start (rather than showing image with incorrect size first then change to correct size as currently)
Are you suggesting that we shouldn't show an image at all when a user is in image preview mode and swiping through images, and instead show a loading indicator?
Not a suggestion. I would put it as a question instead.
@tienifr proposal here https://github.com/Expensify/App/issues/35615#issuecomment-1922853744 targets to do, also explained in detail here https://github.com/Expensify/App/issues/35615#issuecomment-1946404643. My question would be, Is it good enough from UX perspective?
or should we try out for more optimized fix(which would be reach out for other proposals)?
@johncschuster @abdulrahuman5196 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@johncschuster, @abdulrahuman5196 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@tienifr
@johncschuster no, let me clarify
When swiping to the next image, currently it will show a small image in the center of the screen, with a loading indicator, then after the image is fully loaded, it will show with correct size.
The suggestion is to not show the small image initially. Instead, it will only show loading indicator while the image is loading (which is brief), then after the image is loaded and the size is known, the full image will be shown with the correct size from the start (rather than showing image with incorrect size first then change to correct size as currently)
Got it. That makes sense to me! Thank you for clarifying that!
@abdulrahuman5196
@tienifr proposal here #35615 (comment) targets to do, also explained in detail here #35615 (comment). My question would be, Is it good enough from UX perspective? or should we try out for more optimized fix(which would be reach out for other proposals)?
Fair question. I think I'd like to get some ideas from our @Expensify/design on the UX of this proposal.
@Expensify/design, we're trying to figure out the best way to address how images load when a user scrolls through a carousel of images in NewDot. There are a few suggestions (starting here) on how we can address this, but these might not consider the overall user experience. I'd love your thoughts!
I probably prefer us showing a loading indicator until we can properly display the images. I don't feel very strongly though, but the less "jumpy" we can make the UI, the better.
Unless we can somehow load all the image sizes as a request on the very first image, instead of as you scroll through the carousel?
Keen for rest of @Expensify/design opinions.
Yup, that makes sense to me. I basically agree with this comment too:
The suggestion is to not show the small image initially. Instead, it will only show loading indicator while the image is loading (which is brief), then after the image is loaded and the size is known, the full image will be shown with the correct size from the start (rather than showing image with incorrect size first then change to correct size as currently)
Yeah that sounds good to me too. Agree with Jon that the less jumpy we can make the UI, the better.
Awesome. Thanks for your feedback, team!
@johncschuster @abdulrahuman5196 this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@abdulrahuman5196 can you take a look at the comments above? Based on the design team's feedback, it sounds like we would go with @tienifr's proposal. Do you agree?
Hi, Reviewing now.
@tienifr I noticed that we are getting the contentSize from cachedImageDimensions
which is basically caching the image dimensions. Then how this issue happening even if we swipe for the second time without exiting the attachment corousel?
Then how this issue happening even if we swipe for the second time without exiting the attachment carousel?
@abdulrahuman5196 It's because the cached dimensions will be cleared as soon as the lightbox becomes invisible here. Only a limited number of the light boxes will be rendered at a time due to performance reasons.
Of course we can make it so that the Lightbox dimensions will keep being cached even though the lightbox has became invisible, but it will only fix it for second-time-rendering case.
Issue not reproducible during KI retests. (First week)
@mvtglobally can you share a video of what you saw instead? Was the image not reduced? Did you see the loading pattern?
Reviewing now again
Nope I still see the issue
@tienifr Thanks for the explanation here https://github.com/Expensify/App/issues/35615#issuecomment-1963996981. I think it fine to leave the number of lighboxes to be as it is for now to avoid any performance regressions.
Given the design discussions we had. @tienifr 's proposal here https://github.com/Expensify/App/issues/35615#issuecomment-1922853744 to show loading indicator instead of fallbackSize looks good and works well.
🎀 👀 🎀 C+ Reviewed
Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Hmmmm but is the proposal from @tienifr making the LoadingIndicator show? I see you said:
the LoadingIndicator will show here so the UX is smooth.
So, maybe how this works is like this?
@iwiznia @johncschuster @abdulrahuman5196 this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @abdulrahuman5196 is eligible for the Internal assigner, not assigning anyone new.
Current assignee @abdulrahuman5196 is eligible for the External assigner, not assigning anyone new.
Hmmmm but is the proposal from @tienifr making the LoadingIndicator show? I see you said:
the LoadingIndicator will show here so the UX is smooth.
So, maybe how this works is like this?
* Image is loading (loading indicator shows) * Image loaded, but dimensions not determined yet (loading indicator is not there and image is neither as its opacity is 0) * Image loaded, dimensions computed (image shows properly)
@iwiznia I don't exactly understand the question here. But as far as the usecase goes, we will show the image only after the image is loaded and the dimensions are computed. Until then loader will be shown
.
Hope it clarifies.
So, maybe how this works is like this?
@iwiznia There're only 2 phases instead of 3:
The only difference compared to the current flow is that in step 1:
Currently: loading indicator shows and the image with the wrong size is shown briefly
Ahhh got it!
📣 @abdulrahuman5196 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
PR ready for review https://github.com/Expensify/App/pull/37739.
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.55-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-03-29. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.35-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4265112 Email or phone of affected tester (no customers): applausetester+jp_e_category@applause.expensifail.com Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Expected Result:
The image size is normal when quickly slide forward/back images using the arrows
Actual Result:
The image is reduced for a moment when quickly slide forward/back images using the arrows
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/a99e901f-5fa3-4580-8113-aa288435f338
View all open jobs on GitHub
Upwork Automation - Do Not Edit