Skip to content

feat(listings): add pagination window options and label pagination - #13126

Open
mcanouil wants to merge 27 commits into
quarto-dev:mainfrom
mcanouil:feat/issue12031-listing-pagination
Open

mcanouil wants to merge 27 commits into
quarto-dev:mainfrom
mcanouil:feat/issue12031-listing-pagination

Conversation

@mcanouil

@mcanouil mcanouil commented Jul 24, 2025 •

Copy link
Copy Markdown
Collaborator

Description

Listings get a pagination option to choose how many page links the control shows, as requested in discussion #12031.

listing:
  page-size: 10
  pagination:
    inner-window: 1
    outer-window: 1

inner-window sets the links on each side of the current page.
outer-window sets the links at both ends, and outer-window-left or outer-window-right overrides one end, including with 0.
Quarto passes these to list.js as innerWindow, left and right.
A value that isn't a whole number at or above its minimum (1 for inner-window, 0 for the others) prints a warning and is ignored.
Without pagination, the listing script is the same as before.

Today every paginated listing shows the same links, with no way to change them.
Here is page 6 of 10:

Page links: gap, 4, 5, 6 as the current page, 7, 8, gap

There is no link to the first or the last page.
To reach page 1 from page 6, a reader has to step back through the window, from 6 to 4, then 2, then 1.
outer-window: 1 could be hardcoded, but letting user customise this seems better to me here.

With the new options, the same page shows:

outer-window-left: 2 outer-window: 1 inner-window: 1, outer-window: 2, outer-window-left: 0
Page links: 1, 2, gap, 4, 5, 6 as the current page, 7, 8, gap Page links: 1, gap, 4, 5, 6 as the current page, 7, 8, gap, 10 Page links: gap, 5, 6 as the current page, 7, gap, 9, 10

The control is now labelled for screen readers.
The nav is named "Pagination" and each link "Page n", from two new language keys.
The current page has aria-current="page", and the "..." gaps are no longer focusable.
The new keys show in English for now; once this is merged, I'll open a translation issue under #14822.
Several paginated listings on one page still share the same nav name, as they did before.

Tests cover the emitted options, the warning, and, in Playwright, the links, labels, keyboard use and axe checks in all three engines.
The documentation is in quarto-dev/quarto-web#2339.

Checklist

I have (if applicable):

AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

@mcanouil mcanouil self-assigned this Jul 24, 2025
@posit-snyk-bot

posit-snyk-bot commented Jul 24, 2025 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cscheid cscheid added this to the v1.9 milestone Aug 19, 2025
@mcanouil
mcanouil force-pushed the feat/issue12031-listing-pagination branch from fa98912 to bfef90b Compare January 14, 2026 20:55
@mcanouil
mcanouil marked this pull request as ready for review January 14, 2026 21:09
@mcanouil
mcanouil force-pushed the feat/issue12031-listing-pagination branch from a58b65b to d9b15fd Compare January 14, 2026 21:10
@mcanouil

Copy link
Copy Markdown
Collaborator Author

This PR is finally ready with appropriate tests.

@mcanouil mcanouil changed the title feat: customise pagination options for listings feat(listings): customise pagination options for website listings Jan 14, 2026
@cscheid cscheid modified the milestones: v1.9, v1.10 Feb 17, 2026
@datawookie

Copy link
Copy Markdown

This is a really useful enhancement. Looking forward to seeing this merged!

@mcanouil mcanouil modified the milestones: v1.10, v1.11 Jul 30, 2026
@mcanouil
mcanouil marked this pull request as draft October 19, 2026 11:53
@cderv cderv modified the milestones: v1.11, v1.12 Oct 29, 2026
@mcanouil
mcanouil force-pushed the feat/issue12031-listing-pagination branch from d9b15fd to e09ac81 Compare November 4, 2026 00:10
@mcanouil mcanouil changed the title feat(listings): customise pagination options for website listings feat(listings): add pagination window options and label the pagination control Nov 4, 2026
@mcanouil mcanouil changed the title feat(listings): add pagination window options and label the pagination control feat(listings): add pagination window options and label pagination Nov 4, 2026
@mcanouil
mcanouil marked this pull request as ready for review November 4, 2026 00:11
@datawookie

Copy link
Copy Markdown

Great! A lot of thought has clearly gone into this.

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.

5 participants