Skip to content

Switch history page to numbered pagination#12624

Merged
lokesh merged 1 commit into
internetarchive:masterfrom
lokesh:version-pagination
May 5, 2026
Merged

Switch history page to numbered pagination#12624
lokesh merged 1 commit into
internetarchive:masterfrom
lokesh:version-pagination

Conversation

@lokesh
Copy link
Copy Markdown
Collaborator

@lokesh lokesh commented May 5, 2026

#12624

Replaces arrow-only pagination on the page-history view with the numbered OlPagination component, so users can jump to any page directly.

Technical details

The full page count was already available via page.revision. Easy upgrade.

Screenshots

Before

image

After
Screenshot 2026-05-05 at 10 53 15 AM

Test plan

Visit history page and confirm numbered pagination renders at top and bottom of table

Compute total pages from page.revision so users can jump to any page
instead of stepping through with arrows.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the page history view to use the numbered OlPagination component (instead of arrows-only pagination), enabling direct navigation to any page of revisions.

Changes:

  • Replaces the history page’s arrow-only pagination UI with the numbered OlPagination component (rendered above and below the revisions table).
  • Updates the history endpoint to compute page_num/total_pages and pass them into the history template.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
openlibrary/templates/history.html Switches template pagination rendering to macros.OlPagination at top and bottom, and updates template args to accept page_num/total_pages.
openlibrary/plugins/upstream/recentchanges.py Computes pagination state (page_num, offset, total_pages) for the history view and updates the render call signature accordingly.

Comment thread openlibrary/plugins/upstream/recentchanges.py
Comment thread openlibrary/plugins/upstream/recentchanges.py
Copy link
Copy Markdown
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it on testing and it looks/works beautiful.

Here's a case with a lot of revisions: https://testing.openlibrary.org/works/OL82563W/Harry_Potter_and_the_Philosopher's_Stone?m=history&page=8

BEFORE:
image

AFTER:
Image

One note is that if the page is set higher than the number that exist the UX is off but that's a pretty extreme edge case that's already not looking good in the current state.

So I think this is a nice improvement and good to go!

Image

@lokesh lokesh merged commit 77d486b into internetarchive:master May 5, 2026
7 checks passed
@RayBB RayBB self-assigned this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants