🐛 fix: show VirtualizedTable bottom borders when pagination bar is hidden#657
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
VirtualizedTablehas pagination enabled (showPaginationor any of its variants) buttotalItems <= DEFAULT_PAGE_SIZE(10), thePaginationfooter returnsnull— yetWrapperBodyandBodystill style the table as if the footer were going to draw the bottom edge. The result is square bottom corners and a missing bottom border (especially visible in dark mode).Fix
The mismatch existed because three components decided the bottom edge from
showPaginationalone, while onlyPaginationalso consideredtotalItems:isPaginationBarVisible(totalItems)predicate inVirtualizedTable/utilsas the single source of truth for whether the pagination bar actually renders.Paginationnow uses the predicate for its early return (same behavior as before).WrapperBodyalso appliesrounded-lgwhen the bar is hidden due to few items.Bodygatesrounded-bl-lg/rounded-br-lg, the dark-mode last-row bottom border, andExpandableRow'sisLastRowon the bar actually being visible, not just onshowPagination.useMemoderivingshowPaginationinVirtualizedTable.tsxhad empty deps, so it never recomputed when pagination props changed — proper deps added.Testing
VirtualizedTable.test.tsxcovering: no pagination, pagination enabled with few items (bar hidden → borders closed by the table), and pagination visible (bar closes the borders), plus jest-axe.PaginationWithFewItemsstory in Light and Dark to verify visually.npm run test(455 passed),npm run check:types,npm run lintall green.