Load wishlist entries 25 at a time with Load More #368

Closed
opened 2026-06-09 11:35:49 -05:00 by Codex · 1 comment
Member

Summary

Update the Wish List page so it initially loads only the newest 25 eligible wishlist entries, then lets the user load 25 more at a time.

Current behavior

WishlistController::show() loads every eligible wishlist entry for the selected user with get(). The page currently orders by sort_order and id.

Desired behavior

  • Show the first 25 eligible wishlist entries on initial page load.
  • Order wishlist entries by wishlists.created_at newest first, with a stable secondary order.
  • Add a Load More button similar to the existing /lists behavior.
  • Each Load More action appends the next 25 eligible wishlist entries without replacing already loaded entries.
  • Hide the Load More button once all eligible wishlist entries have been loaded.
  • Preserve the existing owner/viewer action behavior for Add to List, favorite, and wishlist buttons.
  • Keep public username views and the authenticated user's own /wishlist view working.

Implementation notes

The /lists page already has a progressive Load More pattern in GameListController and resources/js/app.js. Reuse that approach where practical instead of introducing a separate pagination style.

Acceptance criteria

  • /wishlist/{username?} initially renders at most 25 eligible wishlist entries.
  • Entries are ordered by newest wishlists.created_at first.
  • Clicking Load More appends the next 25 entries.
  • The Load More button is hidden when no more wishlist entries are available.
  • Existing empty-state behavior still works.
  • Existing game action buttons continue to work on initially loaded and appended rows.
  • Feature tests cover the initial limit, newest-first ordering, loading more, and final-button hiding behavior.
## Summary Update the Wish List page so it initially loads only the newest 25 eligible wishlist entries, then lets the user load 25 more at a time. ## Current behavior `WishlistController::show()` loads every eligible wishlist entry for the selected user with `get()`. The page currently orders by `sort_order` and `id`. ## Desired behavior - Show the first 25 eligible wishlist entries on initial page load. - Order wishlist entries by `wishlists.created_at` newest first, with a stable secondary order. - Add a Load More button similar to the existing `/lists` behavior. - Each Load More action appends the next 25 eligible wishlist entries without replacing already loaded entries. - Hide the Load More button once all eligible wishlist entries have been loaded. - Preserve the existing owner/viewer action behavior for Add to List, favorite, and wishlist buttons. - Keep public username views and the authenticated user's own `/wishlist` view working. ## Implementation notes The `/lists` page already has a progressive Load More pattern in `GameListController` and `resources/js/app.js`. Reuse that approach where practical instead of introducing a separate pagination style. ## Acceptance criteria - [x] `/wishlist/{username?}` initially renders at most 25 eligible wishlist entries. - [x] Entries are ordered by newest `wishlists.created_at` first. - [x] Clicking Load More appends the next 25 entries. - [x] The Load More button is hidden when no more wishlist entries are available. - [x] Existing empty-state behavior still works. - [x] Existing game action buttons continue to work on initially loaded and appended rows. - [x] Feature tests cover the initial limit, newest-first ordering, loading more, and final-button hiding behavior.
jimmyb self-assigned this 2026-06-10 10:40:29 -05:00
Author
Member

Implemented in aa009fd on dev.

Notes:

  • WishlistController::show() now cursor-paginates eligible wishlist rows 25 at a time, ordered by wishlists.created_at descending with wishlists.id as the stable secondary order.
  • The wishlist page now exposes a Load More control and the JS appends returned rows, updates the cursor URL, and removes the control when next_url is null.
  • Public username wishlist views and the authenticated /wishlist view both continue to use the existing route.
  • Added the load-more/order coverage directly to tests/Feature/WishlistTest.php.

Verification:

  • php artisan test --compact tests/Feature/WishlistTest.php passed: 27 tests, 166 assertions.
  • vendor/bin/pint --dirty --format agent passed.
  • npm run build passed.
Implemented in `aa009fd` on `dev`. Notes: - `WishlistController::show()` now cursor-paginates eligible wishlist rows 25 at a time, ordered by `wishlists.created_at` descending with `wishlists.id` as the stable secondary order. - The wishlist page now exposes a Load More control and the JS appends returned rows, updates the cursor URL, and removes the control when `next_url` is `null`. - Public username wishlist views and the authenticated `/wishlist` view both continue to use the existing route. - Added the load-more/order coverage directly to `tests/Feature/WishlistTest.php`. Verification: - `php artisan test --compact tests/Feature/WishlistTest.php` passed: 27 tests, 166 assertions. - `vendor/bin/pint --dirty --format agent` passed. - `npm run build` passed.
Codex closed this issue 2026-06-10 11:32:41 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#368
No description provided.