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

Hide paged items in Pagination component on narrow viewports #714

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

rezrah
Copy link
Collaborator

@rezrah rezrah commented Aug 23, 2024

Summary

Resolves https://github.com/github/primer/issues/3744

Numbered pagination items are now hidden on narrow viewports by default. This prevents horizontal overflow / scrolling issues when a large number of items are present.

While the API already supports showPages, this enforces that behavior by default while retaining the option to customize it.

🔗 Storybook preview

List of notable changes:

  • showPages now undefined by default (prev true)
  • showPages is true if viewport is > isMedium
  • showPages continues to be customizable and forwarded by end-users (backwards compatible)

What should reviewers focus on?

  • Are there any edge cases that haven't been handled?

Steps to test:

  1. Use the dedicated story to see new default behaviour
  2. Scroll through all other stories and check the behavior matches the expectations (hidden on mobile, still visible on medium+)

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • New visual snapshots have been generated / updated for any UI changes
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Please try to provide before and after screenshots or videos

Before After

image

Screenshot 2024-08-23 at 11 05 31

Copy link

changeset-bot bot commented Aug 23, 2024

🦋 Changeset detected

Latest commit: a28be6c

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

This PR includes changesets to release 6 packages
Name Type
@primer/react-brand Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook 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

Copy link
Contributor

github-actions bot commented Aug 23, 2024

🟢 No design token changes found

@@ -76,6 +76,7 @@ describe('BreakoutBanner', () => {
it('renders primary link with arrow by default', () => {
const {getAllByRole} = render(
<BreakoutBanner>
<BreakoutBanner.Heading>Required heading</BreakoutBanner.Heading>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI: Unrelated to the pagination change. This fixes some noisy test logs.

Copy link
Contributor

github-actions bot commented Aug 23, 2024

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

Copy link
Contributor

@danielguillan danielguillan left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@simmonsjenna simmonsjenna left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@rezrah rezrah merged commit fb1980b into main Aug 23, 2024
17 of 18 checks passed
@rezrah rezrah deleted the rezrah/pagination-reflow-fix branch August 23, 2024 15:50
@primer-css primer-css mentioned this pull request Aug 23, 2024
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.

3 participants