Skip to content
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

Allow NavList to paginate multiple groups #2406

Merged
merged 5 commits into from
Nov 30, 2023
Merged

Conversation

strackoverflow
Copy link
Member

Authors: Please fill out this form carefully and completely.

Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.

What are you trying to accomplish?

This PR moves the "show more" pagination to the NavList group level, allowing each group to receive pagination within a NavList. Previously, only the first group would receive pagination.

Demo

navlist.mov

Integration

This change shouldn't break existing usage of "show more", and when this change is integrated into GitHub dotcom we can remove the local workaround to allow pagination in the left-hand global side panel groups.

List the issues that this change affects.

Closes #1885

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

What approach did you choose and why?

I largely implemented the same workaround that I did when we added pagination to the NavList in dotcom's global side panel, which is pulling all "show more" related code out of the nav-list element and into a new nav-list-group element. With that change, each group can now manage its own pagination state.

Anything you want to highlight for special attention from reviewers?

  1. I added some more sample "foods" to differentiate the two NavList groups in the Lookbook preview, with the second group fetching up to four pages of items and the first group only fetching two. I stuck with the Futurama theme 😄
  2. Does the focusMarkers behavior still work as expected with this change? It seems like it to me but it's worth double-checking.

Accessibility

  • No new axe scan violation - This change does not introduce any new axe scan violations.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@strackoverflow strackoverflow self-assigned this Nov 28, 2023
Copy link

changeset-bot bot commented Nov 28, 2023

🦋 Changeset detected

Latest commit: f4cc085

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

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

@github-actions github-actions bot added javascript Pull requests that update Javascript code ruby Pull requests that update Ruby code labels Nov 28, 2023
Copy link
Contributor

⚠️ Visual differences found

Our visual comparison tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional.

Review visual differences

@jonrohan
Copy link
Member

Looks like there's a failing system test

@camertron
Copy link
Contributor

This is looking great! Just that one system test issue, but I'm a soft 🚢

@strackoverflow
Copy link
Member Author

Thanks @jonrohan & @camertron - that system test that I missed has been updated!

@jonrohan jonrohan merged commit fb9bf25 into main Nov 30, 2023
30 checks passed
@jonrohan jonrohan deleted the multi-group-pagination branch November 30, 2023 17:45
@primer primer bot mentioned this pull request Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code patch release ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NavList::Group - Pagination doesn't work if there's more than one group in the NavList
3 participants