Skip to content

bugfix/pin 9329 elements per page visible when table is empty#84

Open
martinaCampoli wants to merge 5 commits intodevelopfrom
bugfix/PIN-9329-elements-per-page-visible-when-table-is-empty
Open

bugfix/pin 9329 elements per page visible when table is empty#84
martinaCampoli wants to merge 5 commits intodevelopfrom
bugfix/PIN-9329-elements-per-page-visible-when-table-is-empty

Conversation

@martinaCampoli
Copy link
Copy Markdown

@martinaCampoli martinaCampoli commented Feb 25, 2026

Issue

PIN-9329
PIN-9341

Description / Context / Why

This pull request updates the default rows-per-page options in the pagination component from [10, 24, 36] to [12, 24, 36], and ensures that the rows-per-page selector is only shown when there are pages to display. Related tests have also been updated to reflect the new default options.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses PIN-9329 and PIN-9341 by updating the default rows-per-page options from [10, 24, 36] to [12, 24, 36] and hiding the rows-per-page selector when tables are empty (totalPages = 0). The changes aim to improve the pagination UX by preventing the display of pagination controls when there's no data to paginate.

Changes:

  • Updated default rows-per-page options from [10, 24, 36] to [12, 24, 36] in the Pagination component
  • Added condition to hide rows-per-page selector when totalPages is 0
  • Updated test expectations to reflect the new default options [12, 24, 36]

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/features/pagination/components/Pagination.tsx Updated defaultOptions constant to [12, 24, 36] and added totalPages > 0 condition to conditionally render the rows-per-page selector
src/features/pagination/tests/Pagination.test.tsx Updated test description and assertions to match new default options [12, 24, 36]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/pagination/components/Pagination.tsx
{...stackProps}
>
{rowPerPageOptions && (
{rowPerPageOptions && totalPages > 0 && (
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The condition added here (totalPages > 0) successfully hides the rows-per-page selector when the table is empty. However, there's a layout consideration: the parent Stack's justifyContent is set to 'space-between' when rowPerPageOptions is provided (line 55, which is outside the diff), but now the selector won't render when totalPages is 0. If both the selector (totalPages = 0) and the pagination controls (totalPages <= 1) don't render, you'll have an empty Stack with 'space-between' justification. While this doesn't break functionality, it may be worth ensuring the justifyContent logic aligns with the actual rendering conditions.

Copilot uses AI. Check for mistakes.
Comment thread src/features/pagination/components/Pagination.tsx
Copy link
Copy Markdown
Collaborator

@Alepazz Alepazz left a comment

Choose a reason for hiding this comment

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

I totally agree with Copilot review.
I think that there isn't the test for totalPages == 0 case scenario. Could you verify?

Comment thread src/features/pagination/hooks/usePagination.ts Outdated
Copilot AI review requested due to automatic review settings February 26, 2026 11:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/pagination/__tests__/Pagination.test.tsx
Comment thread src/features/pagination/stories/PaginationExample.tsx
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