Skip to content

feat: Add Page X of Y indicator to pagination controls#2564

Open
TarunyaProgrammer wants to merge 8 commits intomeshery:masterfrom
TarunyaProgrammer:Pagination
Open

feat: Add Page X of Y indicator to pagination controls#2564
TarunyaProgrammer wants to merge 8 commits intomeshery:masterfrom
TarunyaProgrammer:Pagination

Conversation

@TarunyaProgrammer
Copy link

Add page indicator to catalog pagination (Page X of Y)

What this PR does

This PR adds a page indicator to the catalog pagination UI to display the current page and total number of pages (e.g., Page 2 of 6).

The enhancement improves navigation clarity while keeping pagination entirely client-side.


Problem

The catalog pagination on https://meshery.io/catalog/designs currently only provides “Prev” and “Next” buttons.

As a result, users cannot:

  • identify the current page
  • know how many pages exist
  • estimate how much content remains

This makes navigation less intuitive, especially when browsing large result sets.


Solution

  • Introduced a small page indicator (Page X of Y) in the pagination UI.
  • The indicator updates dynamically when:
    • navigating between pages
    • applying filters or search queries
  • No backend changes are required.

Implementation details

  • Pagination is fully client-side and already calculates total pages using:
    • matchingCards.length
    • itemsPerPage
  • Logic is centralized in _includes/patterns-filter.html.
  • This PR:
    • adds a lightweight UI element for page info
    • updates the existing pagination logic to inject the page text

This ensures accuracy even when the result set changes due to filtering.


Screenshots

Before: Pagination shows only “Prev” / “Next”

Before.Meshery-1.mov

After: Pagination displays Page X of Y between navigation buttons

After.Meshery-1.mov

Related Issue

Closes #2563


Checklist

  • Frontend-only change
  • No breaking changes
  • Consistent with existing pagination logic
  • Improves usability without altering behavior

@welcome
Copy link

welcome bot commented Feb 3, 2026

Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Newcomers' Guide and sure to join the community Slack.
Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while peforming a commit.

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for mesheryio-preview ready!

Name Link
🔨 Latest commit 276ab3b
🔍 Latest deploy log https://app.netlify.com/projects/mesheryio-preview/deploys/69b477eb7422440008deaa51
😎 Deploy Preview https://deploy-preview-2564--mesheryio-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @TarunyaProgrammer, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the user experience of the catalog pagination by introducing a "Page X of Y" indicator. This client-side enhancement provides users with immediate context about their current position within large result sets and the total number of available pages, addressing a previous limitation where only "Prev" and "Next" buttons were present. The changes are purely frontend, integrating seamlessly with existing pagination logic.

Highlights

  • Pagination Clarity: Implemented a "Page X of Y" indicator for catalog pagination, enhancing user navigation by providing context on the current page and total pages.
  • Client-Side Solution: The entire feature is implemented client-side, leveraging existing JavaScript logic without requiring any backend modifications.
  • Dynamic Updates: The page indicator dynamically updates in response to page navigation, filtering, and search queries, ensuring accuracy with changing result sets.
  • Centralized Logic: Core logic for the indicator is integrated into _includes/patterns-filter.html, ensuring consistency across different catalog views.
Changelog
  • _includes/patterns-filter.html
    • Added CSS styling for the new .page-info element to control its appearance.
    • Implemented JavaScript logic within the updatePaginationButtons function to calculate and dynamically display the current page and total pages within the .page-info element.
  • collections/_pages/designs.html
    • Injected a <div class="page-info"></div> element into the pagination structure to serve as the placeholder for the page indicator.
  • collections/_pages/filters.html
    • Injected a <div class="page-info"></div> element into the pagination structure.
  • collections/_pages/models.html
    • Injected a <div class="page-info"></div> element into the pagination structure.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds a page indicator to the catalog pagination, which is a great usability improvement. The implementation is straightforward and correctly handles the client-side logic. I have one suggestion to make the JavaScript selector more robust and maintainable.

Signed-off-by: Tarunya K <tarunya.programmer@gmail.com>
@TarunyaProgrammer
Copy link
Author

@meshery/maintainers
This PR adds a small frontend-only page indicator (Page X of Y) to catalog pagination.
All logic is client-side and centralized in _includes/patterns-filter.html.
Would appreciate a review when you have time. Thank you!

@Bhumikagarggg
Copy link
Contributor

@TarunyaProgrammer Thank you for your contribution! Let's discuss this during the website call tomorrow at 6:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

Signed-off-by: Tarunya K <84562027+TarunyaProgrammer@users.noreply.github.com>
@TarunyaProgrammer
Copy link
Author

@kishore08-07 kindly review the PR when convenient. Thanks!

@Bhumikagarggg
Copy link
Contributor

@TarunyaProgrammer Thank you for your contribution! Let's discuss this during the website call tomorrow at 6:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

@Bhumikagarggg
Copy link
Contributor

@TarunyaProgrammer Thank you for your contribution! Let's discuss this during the website call tomorrow at 6:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Add page indicator to catalog pagination (Page X of Y)

3 participants