feat: add table virtualization (v0, opt-in windowed scrolling) [WIP]#4821
Draft
ernst-dev wants to merge 1 commit into
Draft
feat: add table virtualization (v0, opt-in windowed scrolling) [WIP]#4821ernst-dev wants to merge 1 commit into
ernst-dev wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4821 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 952 953 +1
Lines 30816 30858 +42
Branches 11318 11334 +16
=======================================
+ Hits 30081 30122 +41
- Misses 688 689 +1
Partials 47 47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
[WIP] First-cut (v0) of opt-in windowed / virtual scrolling for
Table— tracking Epic AWSUI-39656 ("Add virtualisation to table component").This is an epic-scale, multi-week effort. This PR is an intentionally-scoped v0 draft meant to establish the shape of the API and the row-windowing mechanism, not a finished feature. It is additive and fully opt-in — behaviour is unchanged unless the new
virtualScrollprop is set.What this does
When
virtualScrollis enabled, the table body renders only the rows within (and near) the visible viewport instead of the whole dataset, keeping very large tables performant. Total scroll height is preserved with lightweight top/bottom spacer rows.v0 scope (done in this PR)
virtualScroll?: boolean | TableProps.VirtualScrollConfig(tagged@awsuiSystem core), withVirtualScrollConfig(rowHeight,overscan). Full JSDoc.useVirtualScrollhook (src/table/use-virtual-scroll.ts): computes the visible row window from the scroll container'sscrollTop/clientHeight, with overscan and uniform estimated row height.src/table/internal.tsx: reuses the existingallRowspipeline and wrapper scroll container; slices the rendered rows and emitsaria-hiddenspacer rows. Absolute row indices preserved so selection / prev-next / role props are unaffected.pages/table/virtual-scroll.page.tsx(10k-row table in a bounded-height scroll container, toggle).use-virtual-scroll.test.tsx, 5 cases) + component (virtual-scroll.test.tsx, 4 cases).Remaining work (follow-ups — NOT in this PR)
rowHeight). Consider leveraging the already-vendoredsrc/internal/vendor/react-virtual.js.stickyHeader.aria-rowindex/aria-rowcountwithGridNavigationProviderwhen only a window is rendered; keyboard navigation into off-screen rows; screen-reader verification.core).Ticket note
The referenced SIM AWSUI-39656 resolves correctly to "Add virtualisation to table component" — it matches this task. No ticket mismatch.
How has this been tested?
eslint(Node v24) — clean on all changed files.stylelint— clean.gulp quick-buildand fullgulp build(incl.docs) — green.table,progressive-loading,expandable-rows,selection) — 103/103 pass (no regressions).#/light/table/virtual-scrollrenders a 10k-row table; only a window of rows is in the DOM.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
Security
Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.