Skip to content

[75258] Hide pagination buttons when they are disabled - #463

Merged
bsatarnejad merged 10 commits into
mainfrom
75258-hide-pagination-buttons-when-they-are-disabled
May 28, 2026
Merged

[75258] Hide pagination buttons when they are disabled#463
bsatarnejad merged 10 commits into
mainfrom
75258-hide-pagination-buttons-when-they-are-disabled

Conversation

@bsatarnejad

@bsatarnejad bsatarnejad commented May 26, 2026

Copy link
Copy Markdown

What are you trying to accomplish?

  • Hide Previous and Next pagination links when there is no page to navigate to
  • Remove disabled Previous/Next rendering logic from the pagination component
  • Update pagination tests to cover first page, last page, and single-page behavior

Screenshots

Before:
Screenshot 2026-05-26 at 15 54 45

After:
Screenshot 2026-05-26 at 15 54 25

Closes https://community.openproject.org/wp/75258

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.

@changeset-bot

changeset-bot Bot commented May 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 876c8ad

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

This PR includes changesets to release 1 package
Name Type
@openproject/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 commented May 26, 2026

Copy link
Copy Markdown

Uh oh! @bsatarnejad, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:

  • Images should have meaningful alternative text (alt text) at line 8
  • Images should have meaningful alternative text (alt text) at line 11

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@bsatarnejad bsatarnejad self-assigned this May 27, 2026

@HDinger HDinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know that it was not specified but what do you think about hiding the Pagination completely when there is only one page? Currently there is only one button shown which basically does nothing, so there is no real value in it imho.

Comment thread previews/primer/open_project/pagination_preview.rb Outdated
@HDinger

HDinger commented May 27, 2026

Copy link
Copy Markdown
Collaborator

I know that it was not specified but what do you think about hiding the Pagination completely when there is only one page? Currently there is only one button shown which basically does nothing, so there is no real value in it imho.

Primer seems to recommend that as well: https://primer.style/product/components/pagination/guidelines/#best-practices

@bsatarnejad
bsatarnejad force-pushed the 75258-hide-pagination-buttons-when-they-are-disabled branch from 582224f to a1e5ba2 Compare May 27, 2026 13:52
@bsatarnejad
bsatarnejad requested a review from HDinger May 27, 2026 14:20
Comment thread .changeset/hot-taxis-hunt.md Outdated
"@openproject/primer-view-components": patch
---

[75258] Don't render the pagination component when there is only one page

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nitpick: I think this is only part of the truth.. The bit about hiding buttons when you are at the edge of the pagination is missing.

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown

⚠️ Visual or ARIA snapshot differences found

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

Review differences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants