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

Stop Showing Pagination Buttons When There is only one page #10210

Closed
SharkyBytes opened this issue Dec 27, 2024 · 2 comments · Fixed by #10221
Closed

Stop Showing Pagination Buttons When There is only one page #10210

SharkyBytes opened this issue Dec 27, 2024 · 2 comments · Fixed by #10221
Assignees
Labels
Affects: UI Issues with the web site's user interface. [managed] Lead: @RayBB Issues overseen by Ray (Onboarding & Documentation Lead) [manages] Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. Priority: 4 An issue, but should be worked on when no other pressing work can be done. [managed] Type: Bug Something isn't working. [managed]

Comments

@SharkyBytes
Copy link
Contributor

SharkyBytes commented Dec 27, 2024

Problem

This issue of hiding the pager when there is only one page was proposed by @RayBB. I am raising the issue on his behalf.

I also believe that if certain buttons are unclickable, we should stop giving false indications to users. For example, when we are already on first page, there's no use in showing the 'First' and 'Previous' buttons, as they serve no purpose. It's better to avoid showing these buttons.

What do you think about this, @RayBB, @mekarpeles?

image

Reproducing the bug

  1. Go to ... Any of the Author's works -> View all Editions (https://openlibrary.org/works/OL20929W/The_Spanish_gypsy?mode=all)
  • Expected behavior:

image
image
image

  • Actual behavior:

Context

  • Browser (Chrome, Safari, Firefox, etc):
  • OS (Windows, Mac, etc):
  • Logged in (Y/N):
  • Environment (prod, dev, local): prod

Breakdown

Requirements Checklist

  • [ ]

Related files

Stakeholders


Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
@SharkyBytes SharkyBytes added Needs: Breakdown This big issue needs a checklist or subissues to describe a breakdown of work. [managed] Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Bug Something isn't working. [managed] labels Dec 27, 2024
@RayBB RayBB added Affects: UI Issues with the web site's user interface. [managed] Lead: @RayBB Issues overseen by Ray (Onboarding & Documentation Lead) [manages] and removed Needs: Breakdown This big issue needs a checklist or subissues to describe a breakdown of work. [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Needs: Lead labels Dec 27, 2024
@RayBB
Copy link
Collaborator

RayBB commented Dec 27, 2024

@SharkyBytes this looks good. I assigned you and you can go ahead and work on it.
We want to hide the pager if there is only one page.

@SharkyBytes
Copy link
Contributor Author

SharkyBytes commented Dec 28, 2024

Hi @RayBB, @mekarpeles & @cdrini ,

I’ve implemented the fix you mentioned, Ray, and I wanted to share some updates along with a suggestion I’ve worked on. I’ve addressed the issue as per your request, but I also made an additional improvement that I believe aligns with how pagination is handled elsewhere in the application (e.g., on the Trending page Video).

To give you a clear view, I’ve recorded two versions for comparison:

->The implementation based on your suggestion
Here’s the version with the fix you asked for:
Video Link

->The version with my additional suggestion
In this version, I’ve implemented your fix as well as a behavior where navigation buttons (e.g., "Previous" and "First") are hidden when they aren’t needed on the first page, and similarly, "Next" and "Last" are hidden on the last page. This approach is consistent with how pagination works on the trending page.
Video Link

Could you please have a look and let me know your thoughts? I’d love to hear your feedback on both implementations and understand which one you feel works best.

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Dec 29, 2024
@RayBB RayBB removed the Needs: Response Issues which require feedback from lead label Dec 29, 2024
@RayBB RayBB changed the title Showing Pagination Buttons Even When They Are Not Useful Stop Showing Pagination Buttons When There is only one page Dec 29, 2024
@mekarpeles mekarpeles added the Priority: 4 An issue, but should be worked on when no other pressing work can be done. [managed] label Dec 29, 2024
@RayBB RayBB added the Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. label Dec 30, 2024
mekarpeles pushed a commit that referenced this issue Dec 30, 2024
* Fix: Hide pager in legacy datatables when only one page
---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: UI Issues with the web site's user interface. [managed] Lead: @RayBB Issues overseen by Ray (Onboarding & Documentation Lead) [manages] Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. Priority: 4 An issue, but should be worked on when no other pressing work can be done. [managed] Type: Bug Something isn't working. [managed]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants