Skip to content

Paginate the publication queue at 50 rows - #409

Merged
neuromechanist merged 1 commit into
stagingfrom
feature/queue-pagination
Oct 1, 2026
Merged

neuromechanist merged 1 commit into
stagingfrom
feature/queue-pagination

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Problem

The Published tab on /admin/publication-requests rendered every published dataset on one page: 780 cards, about 3.5 MB of HTML. It was noted as unchanged in #407.

Change

  • Each tab shows 50 rows per page, with Previous and Next, a "Page 3 of 16" label, and a "Showing 101 to 150 of 780" summary above and below the list. The pager is hidden when a tab fits on one page.
  • The page is ?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.
  • Tab counts are still totals. Switching tabs returns to page 1. The 20-second refresh and the dispatch reload keep the page you are on.
  • paginate and queueHref are pure and tested; queueHref also 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 build
  • Unit tests: page size, slicing, exact multiples, empty tab, malformed and out-of-range values, no mutation, link building and round trip
  • Rendered in dev against the full production-shaped list: Published page 1 shows 50 rows (HTML 365 KB instead of 3.5 MB), page 2 shows 51 to 100, page 16 shows the last 30, page 999 clamps to 16, page=abc is page 1, Pending (2 rows) shows no pager. Clicked Next in a browser; no horizontal overflow at phone width.

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).
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

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

View logs

@neuromechanist
neuromechanist merged commit 4cd3c7d into staging Oct 1, 2026
8 of 9 checks passed
@neuromechanist
neuromechanist deleted the feature/queue-pagination branch October 1, 2026 22:34
neuromechanist added a commit that referenced this pull request Oct 5, 2026
Cuts [Unreleased] into 0.2.28 (2026-10-05). Adds the missing entries
for #407 (queue lists nothing), #408 (web approval by dispatch) and #409
(50-row pages), and moves #422's Fixed entry, which had landed under
0.2.27, into 0.2.28.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant