Add traditional pagination to both admin bridges#61
Merged
xavierlacot merged 15 commits intojolicode:mainfrom Dec 1, 2025
Merged
Add traditional pagination to both admin bridges#61xavierlacot merged 15 commits intojolicode:mainfrom
xavierlacot merged 15 commits intojolicode:mainfrom
Conversation
- Add server-side pagination to OriginalStorage - Add Config options for per_page and infinite_scroll - Implement infinite scroll with Intersection Observer - Add lazy loading for images - Update MediaAdminController for paginated listings - Add comprehensive test coverage
446bd52 to
7d4bb38
Compare
Member
|
Hi @ahmed-bhs Thanks a lot for this first contribution that relates to #52 👍 While I appreciate it a lot, may I ask for some changes?
Thanks again! |
- Add trailing comma to function parameters - Reorder imports alphabetically - Move private methods to end of class - Remove unused imports
f80dc0a to
479685c
Compare
- Add Media type hints to array properties and parameters - Fix missing iterable value type specifications - Ensures PHPStan level compliance
6e1b23f to
348adcc
Compare
Contributor
Author
|
Hi @xavierlacot , nice to meet you and thanks for taking the time to review! I originally developed this feature for my own needs and thought it would be nice to share it as a pull request rather than keep it private. Don't worry at all about the code removal. I completely understand your point about maintaining UX consistency with the native admin frameworks. It makes total sense! All requested changes are done. Still unsure about using EasyAdmin and Sonata’s native pagination—this part need to be reviewed. |
f64b084 to
dcd1e91
Compare
BriceFab
reviewed
Nov 26, 2025
| default => 'explore', | ||
| }; | ||
|
|
||
| $page = max(1, (int) $request->query->get('page', '1')); |
5458f6f to
3520642
Compare
3520642 to
9d92777
Compare
…n Sonata Admin values. Also, do not allow invalid page numbers
Member
|
Thanks for the hard work @ahmed-bhs 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds traditional pagination to both EasyAdmin and Sonata Admin bridges, addressing performance issues when browsing large media libraries. Previously, all media items
were loaded at once, causing slow page loads and high memory usage with libraries containing hundreds or thousands of files.
This implementation uses native pagination components from each framework to ensure a consistent UX that follows admin interface conventions.
Changes
EasyAdmin Bridge:
MediaPaginatoradapter compatible with EasyAdmin's pagination system@EasyAdmin/crud/paginator.html.twigtemplateSonata Admin Bridge:
MediaPagerimplementing Sonata'sPagerInterfaceCommon:
pagination.per_page(default: 50)Configuration Example