Repository navigation
Paginate the publication queue at 50 rows - #409
Merged
Merged
Conversation
The Published tab rendered all 780 cards on one page (about 3.5 MB of HTML). Each tab now shows 50 rows per page with Previous and Next, a Showing 51 to 100 of 780 summary above and below the list, and a ?page= parameter. A bad or out-of-range page falls back to the first or last page; tab counts stay totals. Tested: unit tests for paginate and queueHref, typecheck, lint, build, and the page in a browser against the full production list (50 rows on page 1, 30 on page 16, clamping, Next click, phone width).
Deploying nemar-website with
|
| Latest commit: |
bc3c84c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://895fede6.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-queue-pagination.nemar-website.pages.dev |
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.
Problem
The Published tab on
/admin/publication-requestsrendered every published dataset on one page: 780 cards, about 3.5 MB of HTML. It was noted as unchanged in #407.Change
?page=N. The default tab and the first page stay out of the URL. A value that is not a positive whole number is page 1, and a page past the end is the last page, so an old link, or a tab that shrank after an approval, still shows rows.paginateandqueueHrefare pure and tested;queueHrefalso builds the tab links, so there is one definition of the address.The list is still fetched whole (about 700 KB for 822 rows, and the page needs every dataset's latest request to count tabs correctly), so this removes the DOM and HTML weight, not the fetch. Paging that on the server would need a backend change.
Testing
bun run typecheck(0 errors),bun run lint,bun run test(2785 passed),bun run buildpage=abcis page 1, Pending (2 rows) shows no pager. Clicked Next in a browser; no horizontal overflow at phone width.