Uh oh!
There was an error while loading. Please reload this page.
Pagination algorithm enhancements - #5504
Merged
Merged
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 |
Contributor
👋 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! |
Contributor
size-limit report 📦
|
jonrohan
reviewed
Jan 8, 2025
Uh oh!
There was an error while loading. Please reload this page.
nafeef123
approved these changes
Jan 8, 2025
nafeef123
approved these changes
Jan 8, 2025
hectahertzforce-pushed
the
hectahertz/pagination-algorithm-enhancements
branch
from
January 10, 2025 15:55
5a2568a to
321642aComparehectahertztemporarily deployed
to
github-pages
January 10, 2025 15:57 — with
GitHub Actions
Inactive
hectahertztemporarily deployed
to
github-pages
January 10, 2025 15:59 — with
GitHub Actions
Inactive
francineluccaforce-pushed
the
hectahertz/pagination-algorithm-enhancements
branch
from
January 10, 2025 20:53
2b47044 to
c1d1901CompareCo-authored-by: Hector Garcia <hectahertz@users.noreply.github.com>
francineluccatemporarily deployed
to
github-pages
January 14, 2025 01:22 — with
GitHub Actions
Inactive
Merged
francineluccatemporarily deployed
to
github-pages
January 15, 2025 16:29 — with
GitHub Actions
Inactive
francineluccatemporarily deployed
to
github-pages
January 15, 2025 16:36 — with
GitHub Actions
Inactive
francineluccatemporarily deployed
to
github-pages
January 15, 2025 22:14 — with
GitHub Actions
Inactive
jonrohan
approved these changes
Jan 16, 2025
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/358229 |
francinelucca added a commit
that referenced
this pull request
Jan 16, 2025
🔴 golden-jobs completed with status |
github-merge-queueBot
pushed a commit
that referenced
this pull request
Jan 30, 2025
* Revert "Revert "Pagination algorithm enhancements (#5504)" (#5560)" This reverts commit b8284ce. * Remove 'rel' attribute for disabled pagination * Revert "Remove 'rel' attribute for disabled pagination" This reverts commit 8c0c656. * Set aria-disabled=true * fix(Pagination): correct maxVisiblePages calculation * test(Pagination): correct test --------- Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com> Co-authored-by: Marie Lucca <francinelucca@github.com>
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 freeto 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.
This PR replaces the
Paginationalgorithm 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
PreviousandNextbuttons 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