fix(table): keep rows rendered when pageSizes prop changes at runtime - #1157
Merged
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1157 +/- ##
==========================================
+ Coverage 85.00% 85.07% +0.06%
==========================================
Files 1230 1230
Lines 21587 21593 +6
Branches 8209 8211 +2
==========================================
+ Hits 18351 18371 +20
+ Misses 3150 3136 -14
Partials 86 86 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
agupta-eightfold
force-pushed
the
agupta/table-pagesizes-resize-empty-fix
branch
from
July 27, 2026 08:15
792a9c2 to
287ef4c
Compare
Pagination's mount effect persists the initial page size into Table's
internal pagination state. If a consumer later passes a different
pagination.pageSizes (e.g. derived from the viewport height), the stale
internal pageSize no longer matches any entry: the pageData memo's lookup
loop falls through to return null and the table renders its empty state
("No data found") with data still present, recovering only on remount.
Two-layer fix:
- usePagination: normalize a merged pageSize that is not contained in the
merged pageSizes to pageSizes[0], keeping the data slice, pager count,
and currentPage clamp consistent.
- Table pageData memo: replace the terminal return-null fallthrough with a
defensive slice using the first available size.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
agupta-eightfold
force-pushed
the
agupta/table-pagesizes-resize-empty-fix
branch
from
July 27, 2026 12:35
287ef4c to
70863f1
Compare
ychhabra-eightfold
approved these changes
Jul 27, 2026
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.
SUMMARY:
Issue - If Table's internal pageSize is no longer present in an updated
pagination.pageSizesprop, the pageData lookup finds no match and returns null. The table renders "No data found" with data still loaded, and only a remount recovers it.How it happens - Pagination's mount effect persists the initial size into Table's inner pagination state, so any consumer that recomputes pageSizes later hits the mismatch. This is what blanked the Position Overview drill-in lists in vscode on window resize (found during ENG-203034 verification; product-side fix in EightfoldAI/vscode#113083).
Fix - In usePagination, normalize the merged pageSize to
pageSizes[0]when pageSizes no longer contains it. In Table's pageData, replace the return-null fallthrough with a slice using the first size.GITHUB ISSUE (Open Source Contributors)
NA
JIRA TASK (Eightfold Employees Only):
https://eightfoldai.atlassian.net/browse/ENG-205018
CHANGE TYPE:
TEST COVERAGE:
TEST PLAN:
pageSizes: [10], re-renders withpageSizes: [9], asserts rows still render. Fails without the fix (0 rows).