Skip to content
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

feat: add image loading placeholder #7723

Merged
merged 4 commits into from
Feb 23, 2022
Merged

feat: add image loading placeholder #7723

merged 4 commits into from
Feb 23, 2022

Conversation

mdneyazahmad
Copy link
Contributor

Details

Add a loading indicator while loading an image.

Fixed Issues

$ #7584

Tests

  1. Open a chat with images
  2. Verify that a loading indicator appears for images that are loading
  • Verify that no errors appear in the JS console

QA Steps

  1. Same as test steps
  • Verify that no errors appear in the JS console

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

web

Mobile Web

mweb

Desktop

desktop

iOS

ios

Android

android

@mdneyazahmad mdneyazahmad requested a review from a team as a code owner February 13, 2022 19:00
@MelvinBot MelvinBot requested review from mountiny and rushatgabhane and removed request for a team February 13, 2022 19:00
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump for lint error, thank you for fixing it. Gonna wait for Rushat for when he gets time to have a look.


this.state = {
loading: true,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdneyazahmad Thank you for the PR! Got one styling mistake here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the linting error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the bump Vit :)

@rushatgabhane
Copy link
Member

@mdneyazahmad there's a regression - loading indicator isn't show when image is being uploaded.
Let's fix this 💪

Screencast.from.14-02-22.09-57-05.AM.+03.mp4

@mdneyazahmad
Copy link
Contributor Author

@rushatgabhane could you retest? It seems to work as expected.

test2.mp4

@mdneyazahmad
Copy link
Contributor Author

Also after this pr, dimension jumping issue is even more highlighted. That does not look good.

@rushatgabhane
Copy link
Member

rushatgabhane commented Feb 14, 2022

could you retest? It seems to work as expected.

@mdneyazahmad hmm i can still repro it after hard refresh, and in incognito mode.

Can you try disabling your cache from chrome dev tools -> network tab -> disable cache

@mdneyazahmad
Copy link
Contributor Author

@rushatgabhane I did the same it still works.

@mdneyazahmad
Copy link
Contributor Author

Could you please do npm install and then npm run web?

@rushatgabhane
Copy link
Member

@mdneyazahmad nope that didn't help.

@mountiny could you please help us verify this whenever you can, thanks!

@mountiny
Copy link
Contributor

Sorry for the delay, I will be able to have a look into this later today or tomorrow the latest.

@mountiny
Copy link
Contributor

@mdneyazahmad Hmm, weird, I am getting the same problem as Rushat 😬
https://user-images.githubusercontent.com/36083550/154113512-1e0c9aa9-3bf3-4884-9716-b5442ffd9d39.mov

@mdneyazahmad
Copy link
Contributor Author

I tested in (Chrome/Firefox/Safari), it works on all these browser.

@mdneyazahmad there's a regression - loading indicator isn't show when image is being uploaded.
Let's fix this 💪

Here is the issue with this feature. #7463

I am not sure why. Could you please try with merging main (if not). If still does not work, I will have to find the root cause for it.

@rushatgabhane

@mountiny
Copy link
Contributor

@mdneyazahmad Tested again with merged main in Chrome and the same result. This time the blank placeholder disappeared, then the spinner showed up and then the picture showed up. Lots of jumping, not a great experience. I am not sure what is going on there.

Also I got confused with the linked issue since it looks almost the same. If I understand the difference, this PR should focus on spinner for the image being loaded in chat if not cached, the other one for when it is uploaded.

Either way it seems like it is not working as expected right now, but I am not sure how to help with debugging now, odd you cant reproduce the problem since it happens everytime for me.

@mountiny
Copy link
Contributor

I am using local set up which might influence the way/speed the upload is happening but I think Rushat is using the same setup as you do.

@rushatgabhane
Copy link
Member

rushatgabhane commented Feb 16, 2022

Yep, I'm using local setup and it happens everytime.

@mountiny
Copy link
Contributor

@mdneyazahmad Any progress on this one? Have you been able to replicate it?

@okansahin
Copy link
Contributor

okansahin commented Feb 22, 2022

Hello guys,

Sorry I saw this issue recently and no one mentioned me too. I wish you to mention me in here.

First of all, jumping problem is looks bad. But it is already at there before my PR. So there is no relation with the code I sent in PR. It is a different issue.

As for the problem some of you are having here, it stands before your eyes :)

It's just about @mdneyazahmad uploads by clicking add attachment button, @rushatgabhane and @mountiny upload by dragging. I fixed this and sent to related branch.

Please try to reproduce it with drag&drop before getting branch to confirm me.

After I fixed it:
okansahin@63213b0

Screen.Recording.2022-02-22.at.13.54.19.mov

Thank you

okansahin added a commit to okansahin/App that referenced this pull request Feb 22, 2022
@mdneyazahmad
Copy link
Contributor Author

Thanks @okansahin for figuring it out. I was able to reproduce it with drag and drop.
@rushatgabhane and @mountiny Could you confirm that it works when add attachment button is clicked and uploaded?

super(props);

this.state = {
loading: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdneyazahmad for the jumping issue.
We could reduce the number of jumps from 2 to 1, if we use the same thumbnail styles as the upload preview thumbnail.

What do you think? Can we do any better?

Screencast.from.22-02-22.04-38-40.PM.+03.mp4

@mountiny
Copy link
Contributor

@rushatgabhane how many jumps are there without this PR? If there is just one and this PR changes it to 2, then we should fix it here.

But if there already were 2 jumps before this PR, we should keep that in a separate job just to be atomic with the issues. Feel free to report the issue/bug!

@mountiny
Copy link
Contributor

@okansahin Aaand thank you very much for this of course! Really appreciate your help 🙇

@rushatgabhane
Copy link
Member

There are 2 jumps without this PR.

we should keep that in a separate job just to be atomic with the issues.

Sure! That makes sense, thanks for jumping in :)

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mountiny LGTM! 🎉 Tests well on all platforms.

Kudos to @okansahin for connecting the dots 🙌
I've commented on #7463 to get the upload preview fixed

@okansahin
Copy link
Contributor

Thanks to you too, all. 🙌

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you @mdneyazahmad for the patience and work on this PR. thanks to @okansahin for help as well and great job @rushatgabhane testing and reviewing it!

@mountiny mountiny merged commit cc90f56 into Expensify:main Feb 23, 2022
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @mountiny in version: 1.1.40-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@roryabraham
Copy link
Contributor

This PR was confirmed to cause a regression, and has been reverted.

@OSBotify
Copy link
Contributor

OSBotify commented Mar 1, 2022

🚀 Deployed to production by @yuwenmemon in version: 1.1.40-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Stutikuls
Copy link

Stutikuls commented Mar 9, 2022

Issue 1 -

Title- [Medium]: Chrome+ Jaws : Screen reader : Name & Role is not defined for 'Actions (+)' control.
Actual - Screen reader is reading some other information on Actions(+) control.
Expected - Role = 'Button' and Name = 'Actions/Add attachments' should defined for Actions(+) control.
WCAG failure - 4.1.2
Reproducible in staging?: - Yes
Version Number : - v1.1.40-2
Platforms - Web (Chrome + Jaws), iOS, Desktop (MAC)

7723_NAme.role.is.not.defined.for.Action.+.control.mp4

Issue 2 -

Title- [Medium]: Chrome+ Jaws : Keyboard : 'Actions (+)' control is not accessible using screen reader.
Actual - 'Actions (+)' control is not accessible using screen reader, while press Enter on the control focus moves to another control.
Expected - Actions (+)' control should accessible using screen reader.
WCAG failure - 2.1.1
Reproducible in staging?: - Yes
Version Number: - v1.1.40-2
Platforms - Web (Chrome + Jaws), iOS, Mobile-web(iOS)

7723_Actions.+.control.is.not.accessible.using.screen.reader.mp4

Issue 3 -

Title- [Medium]: Chrome+ Jaws : Screen reader: Role is not defined for 'Send' control.
Actual - 'Actions (+)' control is not accessible using screen reader, while press Enter on the control focus moves to another control.
Note- On MAC screen reader is reading "Send Group".
Expected - Actions (+)' control should accessible using screen reader.
WCAG failure - 4.1.2
Reproducible in staging?: - Yes
Version Number: - v1.1.40-2
Platforms - Web (Chrome + Jaws), iOS, Mobile-web (iOS), Desktop(MAC)

7723_Role.is.not.defined.for.Send.control.mp4

Issue 4 -

Title- [Medium]: Chrome+ Jaws : Screen reader: Status message is not being announced by screen reader after activate the 'Send' control.
Actual - Status message is not being announced by screen reader after activate the 'Send' control. Screen reader is silent and focus lands on the Action(+) button.
Expected - Status message should announce by screen reader after uploading the attachment. Screen reader should read like "Image/video has been uploaded".
WCAG failure - 4.1.3
Reproducible in staging?: - Yes
Version Number: - v1.1.40-2
Platforms - Web (Chrome + Jaws), iOS, Mobile-web (iOS), Desktop(MAC). Android

7723_SCreen.reader.is.not.provide.the.information.after.sent.the.attachement.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants