Skip to content

Stabilize Virtualize mid-list scroll setup - #69465

Merged
ilonatommy merged 1 commit into
dotnet:mainfrom
ilonatommy:fix-deletion-mid-list-falky-test
Sep 25, 2026
Merged

ilonatommy merged 1 commit into
dotnet:mainfrom
ilonatommy:fix-deletion-mid-list-falky-test

Conversation

@ilonatommy

@ilonatommy ilonatommy commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

AnchorMode_DeleteBelowViewport_ViewportStaysStable failed 3 times recently during the test's setup. Also reported in #69425 (comment).

This change stabilizes it by ensuring its setup actually positions the viewport in the middle of the list before deleting items from the bottom.

Background

#69310 changed Virtualize End anchoring so the initial render converges to the tail, which is the intended behavior. This exposed a race in the existing test setup:

  1. The test selects End mode.
  2. It request scrollTop = 5000
  3. On slower Mono CI runs, delayed End-anchor convergence can subsequently move the viewport back to the tail.
  4. ScrollMidListAndWaitForRender previously accepted any scrollTop > 4000, so the tail position around 49700 incorrectly satisfied the condition.

The resulting failure was:

Expected: "995"
Actual:   "985"

At item 995, the viewport is at the tail. Deleting the final ten items removes items 990-999 , including the visible anchor. Item 985 becoming visible is expected - the test was no longer checking deletion below the viewport.

Fix

Make sure the "middle" is real middle, not the end of the list. 4000 < scrollTop < 6000 is a newly defined "middle" now.

@ilonatommy ilonatommy self-assigned this Sep 23, 2026
Copilot AI lite review requested due to automatic review settings September 23, 2026 14:54
@ilonatommy
ilonatommy requested a review from a team as a code owner September 23, 2026 14:54
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Sep 23, 2026
@ilonatommy ilonatommy added the feature-blazor-virtualization This issue is related to the Blazor Virtualize component label Sep 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Stabilizes Virtualize mid-list scroll setup by preventing delayed anchoring from falsely accepting the list tail.

Changes:

  • Restricts valid scrollTop values to 4000–6000.
  • Reissues the mid-list scroll when rendering shifts outside that range.
File Description
src/​Components/​test/​E2ETest/​Tests/​VirtualizationTest.cs Strengthens shared mid-list scroll setup.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@ilonatommy
ilonatommy merged commit a435c3a into dotnet:main Sep 25, 2026
39 checks passed
@mmitche

mmitche commented Oct 1, 2026

Copy link
Copy Markdown
Member

@ilonatommy I think we wnat to backport this to net11. Flaky failure also seen there.

/backport to release/11.0

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 1, 2026
wtgodbe pushed a commit that referenced this pull request Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components feature-blazor-virtualization This issue is related to the Blazor Virtualize component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants