Skip to content

Improve AnchorMode tests - #67639

Merged
ilonatommy merged 15 commits into
mainfrom
virtualize-fix-big-append-test-logic
Jul 20, 2026
Merged

ilonatommy merged 15 commits into
mainfrom
virtualize-fix-big-append-test-logic

Conversation

@ilonatommy

@ilonatommy ilonatommy commented Jul 7, 2026 •

Copy link
Copy Markdown
Member
  1. AnchorMode_End_LargeAppendAtBottom_StillFollows
    The existing AnchorMode_End_LargeAppendAtBottom_StillFollows E2E test did not actually verify auto-follow behavior. Its assertion re-scrolled the container to the bottom inside the polling loop.

Because the test itself performed the scroll-to-bottom that the engine is supposed to do on append, the assertion would be always true, whether or not End-mode auto-follow worked. It provided no real regression coverage for the "append at bottom keeps following" behavior it was named for.

That exposed a problem with the scenario variableHeight: True, useItemsProvider: False build1, build2.

The Virtualize.ts change adds a sticky reached flag so that End-anchored re-pinning triggers when the viewport is at the bottom now or has reached it and is still following - fixing large/async appends that arrive after the momentary at-bottom measurement has gone stale, which the previous single-frame wasAtBottom check missed and let the viewport drift off the tail.

end-large-append.mp4
  1. AsyncItemsProvider_DoesNotFlashPlaceholderRows_OnAnchoredEdgeGrowth and StartAnchoredPrepend_MovesViewportToNewHead_WithoutPlaceholderFlash were flaky

report: #67822 (comment)
build

This was test setup problem, we swallowed the OperationCanceledException from a superseded gated fetch and returned an empty-but-successful ItemsProviderResult, which made Virtualize  record that window as "loaded with zero items" and leave permanent, never-re-fetched placeholder rows that the test's Browser.Equal(0, placeholders) assertion timed out waiting to clear.

@ilonatommy ilonatommy added this to the 11.0-preview7 milestone Jul 7, 2026
@ilonatommy ilonatommy self-assigned this Jul 7, 2026
@ilonatommy
ilonatommy requested a review from a team as a code owner July 7, 2026 15:11
Copilot AI review requested due to automatic review settings July 7, 2026 15:11
@ilonatommy ilonatommy added area-blazor Includes: Blazor, Razor Components feature-blazor-virtualization This issue is related to the Blazor Virtualize component labels Jul 7, 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.

Pull request overview

Updates the Blazor virtualization E2E coverage to ensure the AnchorMode_End_LargeAppendAtBottom_StillFollows test actually validates End-mode auto-follow behavior after a large append, rather than forcing the scroll position in the assertion loop.

Changes:

  • Removed the test’s manual scrollTop = scrollHeight assignment from the polling assertion so it no longer “makes itself pass.”
  • Strengthened the scenario by additionally asserting that real items near the new end of the list (not provider placeholders) are materialized after the append.

Last row of 1k item 0-indexed list, after appending 100 items is 1099, not 1090.
@ilonatommy

ilonatommy commented Jul 10, 2026 •

Copy link
Copy Markdown
Member Author

Failing on delayed large append:

variable-async-delay-large-append.mp4

I suspect #67679 might fix it.
Edit: I checked and it does fix it. We can mark it as blocked by that PR.
Edit2: there's still a in-memory case that is failing, that one will be fixed in this PR by framework change.

@ilonatommy ilonatommy added blocked The work on this issue is blocked due to some dependency and removed blocked The work on this issue is blocked due to some dependency labels Jul 10, 2026
@ilonatommy

Copy link
Copy Markdown
Member Author

The remaining failure is for in-memory items, with default item provider: AnchorMode_End_LargeAppendAtBottom_StillFollows(variableHeight: True, useItemsProvider: False). The append handling differs by provider without a reason. While custom provider use the fix from "Fix placeholder flash" PR, default provider doesn't - the window is never re-pinned to the end on large appends there. It requires framework change.

@ilonatommy ilonatommy changed the title Improve AnchorMode_End_LargeAppendAtBottom_StillFollows Improve AnchorMode tests Jul 17, 2026
@ilonatommy
ilonatommy requested a review from dariatiurina July 17, 2026 11:22
Comment thread src/Components/Web.JS/src/Virtualize.ts Resolved
Comment thread src/Components/Web.JS/src/Virtualize.ts Resolved
@ilonatommy
ilonatommy enabled auto-merge (squash) July 17, 2026 14:30
@ilonatommy
ilonatommy requested a review from oroztocil July 17, 2026 15:45
@ilonatommy

Copy link
Copy Markdown
Member Author

/azp run aspnetcore-components-e2e

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@ilonatommy
ilonatommy merged commit bf41edc into main Jul 20, 2026
26 checks passed
@ilonatommy
ilonatommy deleted the virtualize-fix-big-append-test-logic branch July 20, 2026 15:43
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