#53827 closed enhancement (fixed)
Increase number of media items displayed when clicking button to "Load More"
Reported by: | antpb | Owned by: | antpb |
---|---|---|---|
Milestone: | 5.8.1 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Media | Keywords: | has-patch commit fixed-major |
Focuses: | accessibility | Cc: |
Description
In #50105 a "Load More" button was introduced to improve the experience for more people. It has been reported in various forms of feedback that the number of items displayed when clicking "Load More" is too low.
We should consider increasing this number in 5.8.x to load more attachments so folks can get through their Media Library faster as we prepare to make this setting more configurable in 5.9 or later. It's worth noting that the aim of the experience we're trying to emulate is the ability folks once had to navigate to a deeper page than "next batch."
#53787 has been created to handle the configurable bits of this feature.
Attachments (2)
Change History (26)
#1
@
3 years ago
- Summary changed from Increase number of media items displayed when clicking button to display more to Increase number of media items displayed when clicking button to "Load More"
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
3 years ago
#5
@
3 years ago
At the moment each page is 40 images, do you have any thoughts about how much that should be increased? My instinct is 60 or 80 but that could still be seen as too low for sites with enormous media libraries.
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
3 years ago
#7
@
3 years ago
I agree with double the default (80) as a temporary solution so folks can load more and get through their libraries faster.
This ticket was mentioned in Slack in #core-media by pbiron. View the logs.
3 years ago
#10
follow-up:
↓ 12
@
3 years ago
I've noticed the default value is hard coded in the JavaScript default options without an filter.
I think allowing devs to filter this would be appreciated, is it possible to either:
- use @wordpress/hooks to add a filter in JavaScript
- cease sending the default value and setting it in
wp_ajax_query_attachments()
so developers can set the default value in PHP? The filterajax_query_attachments_args
already exists but sending the requested arguments as a second parameter would probably be needed so devs can figure out if the value in$query
is the default or coming from the ajax request.
#11
@
3 years ago
- Type changed from defect (bug) to enhancement
Hi,
I would like to add a suggestion here that while making the default 80 rather than 40 would be quite helpful, it would be nice to have a button that could automatically take the user to the bottom of their media library - like a 'Jump to the End' button. So if we know we are looking for something near the bottom of the list, we can jump right to that area without needing to expand the media library multiple times.
Edit - I'm sorry this is the first time I've ever added a comment into this area, so I did not realize I changed the type from defect (bug) to enhancement
#12
in reply to:
↑ 10
;
follow-up:
↓ 20
@
3 years ago
Replying to peterwilsoncc:
I've noticed the default value is hard coded in the JavaScript default options without an filter.
I think allowing devs to filter this would be appreciated, is it possible to either:
- use @wordpress/hooks to add a filter in JavaScript
- cease sending the default value and setting it in
wp_ajax_query_attachments()
so developers can set the default value in PHP? The filterajax_query_attachments_args
already exists but sending the requested arguments as a second parameter would probably be needed so devs can figure out if the value in$query
is the default or coming from the ajax request.
I think this is a great idea. We may want to reserve it for a separate ticket to handle the filter as this issue is aiming to be added in the next minor release. I could be wrong, but I believe we cannot add new filters unless in a major point release. Happy to add that to the scope of this ticket if I'm wrong! :)
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
3 years ago
#15
@
3 years ago
- Keywords has-patch needs-testing added; needs-patch removed
Adding to my testing queue. Testing report coming shortly, though the patch is a safe change (since it's a hard-coded default value).
#16
@
3 years ago
- Keywords needs-testing removed
Test Report
Env
- WordPress: 5.8.0
- Browser: Chrome 92.0.4515.131
- OS: macOS Big Sur 11.5
- Localhost: Local and
wp-env
- Theme: Twenty Twenty-One
- Plugins: none
- Scripts: none
Steps to Test
- Add at least 80 items into the Media Library (okay to copy same items over and over again)
- Refresh the Media Library page in the browser
- Scroll down to the
Load more
button - Notice the
Showing 40 of xx media items
message - Apply 53827.diff patch
- Refresh the Media Library page in the browser
- Scroll down to the
Load more
button - Notice the
Showing 80 of xx media items
message and the number of media items rendered is doubled
Test Results
As shown in 53827-diff-test.png, the patch works as expected ✅
This ticket was mentioned in Slack in #core-media by hellofromtonya. View the logs.
3 years ago
#20
in reply to:
↑ 12
@
3 years ago
Replying to antpb:
I think this is a great idea. We may want to reserve it for a separate ticket to handle the filter as this issue is aiming to be added in the next minor release. I could be wrong, but I believe we cannot add new filters unless in a major point release. Happy to add that to the scope of this ticket if I'm wrong! :)
Yes, let's do it in a follow up for a major release. Sometimes filters are added in minors but only as bug fixes and this is an enhancement.
#22
@
3 years ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for merging in to the 5.8 branch.
This doesn't really have any accessibility issues related to it, but I want the accessibility team to be aware of this.