Skip to content

[release/11.0] Stabilize Virtualize initial item positioning - #69170

Open
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-68886-to-release/11.0
Open

[release/11.0] Stabilize Virtualize initial item positioning#69170
github-actions[bot] wants to merge 1 commit into
release/11.0from
backport/pr-68886-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Backport of #68886 to release/11.0

/cc @ilonatommy

Stabilize Virtualize initial item positioning

Prevent viewport oscillation while applying InitialItemIndex.

Description

When Virtualize or a virtualized QuickGrid initially positions a large list near its end, rendered-item measurements can repeatedly change the spacer geometry while the requested item is still being aligned. This creates a feedback loop:

measure rows -> resize spacers -> realign item -> measure rows -> ...

Depending on rendering and network timing, users can see the viewport repeatedly jump, temporarily become empty, or finish at the wrong item.

This change keeps spacer geometry fixed while the initial viewport is being filled. Once real items cover the viewport, the accumulated measured item size is applied once and the requested item is realigned against the resulting spacer geometry.

The positioning process is split into two explicit phases:

  • FillingViewport: grow the rendered window and collect measurements without changing spacer geometry.
  • ApplyingMeasuredGeometry: apply the accumulated measurement once and perform the final alignment.

The existing running average is preserved. The change also corrects the E2E viewport-coverage helper to compare against the scroll container's scaled content viewport instead of its outer border box, and unquarantines the existing QuickGrid regression test.

Fixes #68724

Customer Impact

Customers using InitialItemIndex with Virtualize or virtualized QuickGrid, particularly with tall containers and rendered rows whose size differs from the initial estimate, can see severe initial viewport instability (a few seconds of jumps).

The reported behavior includes repeated visible jumps, blank viewport frames, and the requested item being lost under slower Server-side rendering or network conditions. Avoiding InitialItemIndex or disabling virtualization are the only practical application-level workarounds.

Regression?

  • Yes
  • No

InitialItemIndex is new functionality in net11.

Risk

  • High
  • Medium
  • Low

The change is limited to InitialItemIndex positioning and does not modify public API or normal user-driven virtualization behavior. However, it changes the internal measurement, spacer, and alignment lifecycle used by both Virtualize and QuickGrid.

Verification

  • Manual (required)
  • Automated

Manual verification was performed with Server-side and WebAssembly QuickGrid scenarios using provider delay, CPU throttling, and network throttling. Before the fix, the viewport visibly oscillated and could lose the target item. After the fix, the requested item remained stable while the viewport filled.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

* Stabilize Virtualize initial item positioning.

* Rename.

* Boarder should not take part in calculations.

* Improve unit test readibility.

* Treat unavailable final InitialItemIndex alignment as aborted.

* Preserve Virtualize running item size average. Use the accumulated measurement when applying initial-index geometry instead of replacing it with the latest rendered window, and add regression coverage for the measurement history.

* Unquarantine.
@github-actions
github-actions Bot requested a review from a team as a code owner September 9, 2026 10:04
@ilonatommy ilonatommy self-assigned this Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants