-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Editor External Media: improve perceived performance by rendering more loading placeholders #25776
Editor External Media: improve perceived performance by rendering more loading placeholders #25776
Conversation
Previously enough loading placeholders were rendered to cover the end of the row. However, users were reporting that the external media library loading was slow. After discussion design input suggested loading lots of placeholders than necessary would improve the perception of speed. This has been implemented. See * #22681 * #25581
Could we add some screen capture GIFs here to show before & after? |
Yes sorry @ehg, would have been good to illustrate the different visually. OriginalAs you can see sometimes you only get a few loading squares showing up. This stops you from scrolling which provides the feeling of being "stuck". Also it's easy to missing the loading squares as there aren't many of them. RevisedNow we added a number of loading squares as per design guidance from @drw158. This makes the entire scrolling experience feel a lot more fluid and less restrictive. Whilst the speed of loading is actually no faster it feels much quicker to the user. Questions
|
Much much better! I don't think there are too many loading squares. Some things I notices that may or may not be a separate issue:
|
Thanks @drw158. Let me have a look into those issues for you. [Update]
I've added logic to remove the icon we're adding if the source if Google Photos
@drw158 Can you please use the Network section under devtools to debug this a bit?:
I'm seeing mine bottom out at 237 photos. This looks like a bug because Picasa should allow at least 1000 photos. @johngodley may be able to add some context here. Looking at the • |
Video items coming from the Google Photos API have video icons automatically added as part of the thumbnail image. However, Calypso was then adding it’s own video icon over the top of this (as picked up in this PR #25776 (comment)). Fixes this by removing video icon if the source is Google Photos
@jakejones1984 yes it appears to be maxing out. I've previously tested this up to 1000 so it definitely used to work that far. This leads me to think that a change has since occurred in Calypso or the WordPress API that is somehow limiting this. It's also possible that Picasa itself has changed. Certainly worth exploring while you are digging into this part of the code. |
@johngodley I've done some testing and I can confirm Picasa is maxing out at the request where I get back a response from the Picasa API with absolutely no I suspect this issue is happening because we are defaulting to the My theory is that the Picassa API has a limit on what they allow you paginate through within the "recent" folder. Moreover, the concept of "recent" suggests that there will be an arbitary limit on the number of photos Google classify as "recent". To test this I made a request for a specific folder/album which I know has over 2000 photos in it. I passed a
My recommendation is that we talk to Google to try and find out:
...and yes I've noticed the tests are failing and I will fix them tomorrow! @drw158 I've now added an clear notice (see screenshot below which shows the bottom half of the media list) that will appear when there are no more results to display. Obviously the core bug is still there (read above for explanation) but at least we're clearly notifying the user that we can't get any more results. |
Previously when you reached the end of the available photos from the external media library nothing happened. Users had no feedback they’d reached the end of the list. Adds a Notice component which clearly states that there are no more photos to display. Also upgrades the notice that appears when you’ve reached the max results upper limit of 1000.
I've also confirmed this behaviour myself, and it seems the new max is 300. It used to be 1000, so this seems to be Google thing.
This is standard media library behaviour. The proposed changes here will affect the behaviour of the media library for everything, not just Google Photos. As such I think it should be done elsewhere. Also to note that the notice will be shown even if you have a single photo, making it a bit overpowering.
The 'recent' term is our concept, and Google is just returning photos in reverse date order so there shouldn't be a limit on what recent means.
Existing restrictions/bugs in Picasa are going to remain - Google won't change anything outside of the new API. My feeling is this adds more weight to using the new API. In the mean time we should reduce the current max limit check to 300, and then the existing |
…edia List" This reverts commit 55884c4.
@johngodley Thank you for your feedback. My responses below:
Agreed. I've reverted this.
I understand. However, if you don't request a specific Album from the API it appears to default to a kind of "recent" folder. I cannot confirm this but the following evidence leads me towards that conclusion
I wasn't clear here. I meant, we should see if they are willing to confirm whether there is a limit when not requesting a specific folder/album. I feel it would be good to know for certain if possible.
Absolutely. For now however, please see my Album PR which provides a workaround to the hard limit.
I'm going to propose keeping this PR related to the performance. @drw158 raised a couple of issues which I should have addressed elsewhere. We seem to agree that goal of "improving perceived performance" has been met and the other issues raised are now being solved in other PRs or workstreams. Nonetheless, if you're happy for me to flip the value from |
@@ -23,11 +23,13 @@ export default class extends React.Component { | |||
media: PropTypes.object, | |||
maxImageWidth: PropTypes.number, | |||
thumbnailType: PropTypes.string, | |||
showIcon: PropTypes.bool, |
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.
We should move this showIcon
fix into its own PR.
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.
Previously icon could not be disabled. In certain situations you might need to do this. For example, Google Photos automatically embeds a video icon on to the thumbnails of all videos coming through from it’s API. As a result we need to disable our icon so as not to double up. See #25776 (comment) Originally part of PR above but moved on advice from @ehg #25776 (review)
This reverts commit acb7d23.
Is this one close to being able to be merged? |
@alisterscott Apologies for the delay here (been away). I believe it's nearly there. Just need @johngodley to confirm he's happy with
@johngodley Are you able to confirm you're happy with the above? Much appreciated |
Yep, let's move to 300. |
@johngodley The hard limit is resolved in this PR so we might need to merge both PRs at the same time. @alisterscott There's quite lot of PRs so apologies for any confusion. |
This PR may be made redundant as part of the changes discussed at |
This issue has been marked as stale and will be closed in seven days. This happened because:
You can keep the issue open by adding a comment. If you do, please provide additional context and explain why you’d like it to remain open. You can also close the issue yourself — if you do, please add a brief explanation. |
Previously enough loading placeholders were rendered to cover the end of the row. However, users were reporting that the external media library loading was slow. After discussion design input suggested loading lots of placeholders than necessary would improve the perception of speed. This PR implements that feedback.
Steps to test:
On
master
:Now checkout this branch and repeat the process. Notice how much faster it feels now more placeholders are loaded at once.
Todo