LearnNewsExamplesServices
Frontmatter
id9475
titleGrid: Remove `#initialChunkSize` DOM pooling bypass & fix pool shrink bug
stateClosed
labels
enhancementaiarchitecturegrid
assigneestobiu
createdAtMar 14, 2026, 1:34 PM
updatedAtMar 14, 2026, 1:36 PM
githubUrlhttps://github.com/neomjs/neo/issues/9475
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 14, 2026, 1:36 PM

Grid: Remove #initialChunkSize DOM pooling bypass & fix pool shrink bug

Closed v12.1.0 enhancementaiarchitecturegrid
tobiu
tobiu commented on Mar 14, 2026, 1:34 PM

The Problem

  1. The Shrink Bug: In #9474, the GridBody#createRowPool logic was updated to cap the pool size based on store.count. However, this aggressively destroyed DOM nodes when a Store was filtered (e.g. from 100 items down to 2), completely breaking the virtual scroller's "Fixed-DOM-Order" strategy which requires unused nodes to be recycled and hidden via display: none rather than destroyed.
  2. The Chunking Bypass: When a data chunk was loaded (store.add(items, false) with initialChunkSize), the grid bypassed pooling and attempted to render the entire chunk into the DOM at once to provide "immediate scrollability".

The Solution

  1. Prevent Pool Shrinkage: Updated createRowPool() to Math.min(windowSize, Math.max(me.items.length, countRecords)). The pool will grow to accommodate data (up to the viewport size limit), but it will never shrink during filtering operations, preserving existing DOM nodes for instant reuse when the filter is cleared.
  2. Remove Chunking Bypass: Completely removed #initialChunkSize usage from GridBody. The grid now correctly utilizes standard row pooling (rendering only the viewport range) during a chunked load. Immediate scrollability is fully preserved because #initialTotalSize is still used to immediately size the scroll container bounds accurately.
tobiu added the enhancement label on Mar 14, 2026, 1:34 PM
tobiu added the ai label on Mar 14, 2026, 1:34 PM
tobiu added the architecture label on Mar 14, 2026, 1:34 PM
tobiu added the grid label on Mar 14, 2026, 1:34 PM
tobiu referenced in commit c457d06 - "fix(grid): Prevent DOM node destruction on filter and remove chunking bypass (#9475)" on Mar 14, 2026, 1:35 PM
tobiu assigned to @tobiu on Mar 14, 2026, 1:35 PM
tobiu
tobiu Mar 14, 2026, 1:36 PM

Input from Gemini 3.1 Pro:

✦ The bug preventing "Fixed-DOM-Order" during filtering has been resolved. The #initialChunkSize pooling bypass has also been entirely removed from the grid body, meaning chunked data loads will now properly undergo virtualization. The test suite is passing again.

tobiu closed this issue on Mar 14, 2026, 1:36 PM