-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination algorithm enhancements #5504
Pagination algorithm enhancements #5504
Conversation
🦋 Changeset detectedLatest commit: e723e40 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
5a2568a
to
321642a
Compare
2b47044
to
c1d1901
Compare
Co-authored-by: Hector Garcia <hectahertz@users.noreply.github.com>
Co-authored-by: Hector Garcia <hectahertz@users.noreply.github.com>
…factor/pagination
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/358229 |
This reverts commit 9986d67.
🔴 golden-jobs completed with status |
This PR replaces the
Pagination
algorithm to optimize how we decide which page numbers to render so the buttons stay in place, so we can reduce friction and make it easier to use for users with dexterity issues.Changelog
New
Added a couple of tests for the new algorithm.
Changed
The algorithm has been completely rewritten, simplified and documented with the goal of increasing legibility and maintainability.
The previous algorithm relied heavily on traversing the list of pages back and forth and sliding counters and ranges. This new version calculates the dimensions of the different parts in one go, with visual explanations of the math in the comments.
The new algorithm has also two UX improvements:
Previous UX
previous.mov
New UX (same parameters)
new.mov
This PR also changed the styling of the
Previous
andNext
buttons so they always keep the chevron and their dimensions, even when disabled.Rollout strategy
Testing & Reviewing
Added two tests which should be pretty self explanatory
Merge checklist