feat: add grid virtualization continer - #2382
Draft
rkaraivanov wants to merge 4 commits into
Draft
rkaraivanov wants to merge 4 commits into
rkaraivanov wants to merge 4 commits into
Conversation
…red virtualization internals - Add `SizeIndex` with an O(1) `UniformSizes` implementation, `engine.fixed` and `engine.setSizes()`; `fixed-item-size` skips per-item measurement - Move timing, scroll settle, layout settle and indexed resize helpers to `#internals` for reuse by the upcoming `igc-virtual-grid` - Add `FixedItemSize` story with 1M rows and changelog entry
…tion component Add a row-major 2-D virtualizer on top of the shared virtual scroll engine. Two axis engines sit behind a `VirtualGridEngine` facade; each rendered row is a CSS grid driven by a `--igc-grid-cols` track on the content wrapper, with the first window cell placed at a named `[window-start]` line so pinned tracks can be prepended later. Rows are fixed height by default with `auto-row-height` opt-in; column widths come from `columnWidth` as a number or a per-column function. Host defaults to `role="grid"` and a focusable tabindex, with `aria-rowindex`/`aria-colindex` on cells. Extract the scroll-to correction loop into `ScrollCorrectionController` and light-DOM style adoption into `LightDomStylesController`, both now shared with `igc-virtual-scroll`. The engine gains `getRangeOffset`, `sizeAt`, `resolveScrollOffset` and range/normalization helpers.
…t` and `getCellElement` `headerTemplate` renders a sticky row of `columnheader` cells before the track that shares the column tracks of the rows. Its measured height is reserved from the vertical axis and taken off the row viewport. `pinned-columns-start` and `pinned-columns-end` keep that many leading and trailing columns in view as sticky cells, each with its own inset, placed through the named `window-start` and `pinned-end` grid lines. The `VirtualGridEngine` facade owns the split between pinned and scrollable columns and the viewport narrowing, so column indexes at its boundary are plain indexes into `columns`. `igcDataRequest` asks for more rows near the end of `data` through a `DataRequestTracker` shared with `igc-virtual-scroll`, and `getCellElement` returns the rendered wrapper of a cell for focus management. Shared changes: `reservedSize` on the virtual scroll engine so a track plus its siblings stays within the browser limit under compression; `ResizeObserverController.sync` to follow one element; the layout settle controller now yields one task after the frame so a ResizeObserver-driven render is covered by a single `layoutComplete`.
…choring `rowTemplate` renders a row as one `full-width-cell` part; a `null` result falls back to the cell template. `autoSizeColumn` measures the rendered cells at `max-content` and stores the width in the grid engine facade, which now owns the widths array (`setColumns`, `setPinned`, `setColumnWidth`). The shared `VirtualScrollEngine` gains `anchorOffset` and `takeMeasureShift()` so the grid keeps the row under the scroll position stable when `auto-row-height` measurements change.
| let notifications = 0; | ||
| engine.onSizeChange = () => notifications++; | ||
|
|
||
| engine.fixed = true; |
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
Add a row-major 2-D virtualizer on top of the shared virtual scroll engine.
Two axis engines sit behind a
VirtualGridEnginefacade; each rendered rowis a CSS grid driven by a
--igc-grid-colstrack on the content wrapper,with the first window cell placed at a named
[window-start]line sopinned tracks can be prepended later. Rows are fixed height by default
with
auto-row-heightopt-in; column widths come fromcolumnWidthas anumber or a per-column function. Host defaults to
role="grid"and afocusable tabindex, with
aria-rowindex/aria-colindexon cells.Type of Change
Checklist