Skip to content

Use the declared spacer height for the Virtualize scale factor - #70629

Open
joshbarros wants to merge 11 commits into
dotnet:mainfrom
joshbarros:fix/70553-fractional-height-scale
Open

joshbarros wants to merge 11 commits into
dotnet:mainfrom
joshbarros:fix/70553-fractional-height-scale

Conversation

@joshbarros

Copy link
Copy Markdown
Contributor
  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making.

Description

getScaleFactor divided the measured spacer height by offsetHeight, which is rounded to whole pixels. With fractional row heights the ratio drifts from 1 even without a zoom or transform (the report measures 0.999756 for 53.015625px rows). Dividing the large spacer separations by that scale moves the rendered window behind the viewport until the list stays blank.

Use the fractional inline height the spacer was given when present, and fall back to offsetHeight otherwise.

Adds VirtualizationFractionalHeightTable, a table with fractional row heights inside a container scroller, and an E2E test that scrolls with the report's cadence (25 steps of 120px, 60ms apart) and asserts that a rendered row stays visible.

Validation

  • tsc --noEmit on Virtualize.ts passes.
  • The E2E suite could not be run in this environment because the JavaScript workspace prerequisites are not built here; the new Selenium test is left to CI.

Fixes #70553

getScaleFactor divided the measured spacer height by offsetHeight, which is rounded to whole pixels. With fractional row heights the ratio drifts from 1 even without a zoom or transform, and dividing the large spacer separations by it moved the window behind the viewport until the list stayed blank.

Use the fractional inline height the spacer was given when present and fall back to offsetHeight otherwise. Add a table-in-a-container test page and an E2E test that scrolls with the report's cadence and asserts a rendered row stays visible.

Fixes dotnet#70553
@joshbarros
joshbarros requested a review from a team as a code owner November 16, 2026 19:14
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Nov 16, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @joshbarros. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@PureWeen

Copy link
Copy Markdown
Member

/review

@github-actions github-actions Bot 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.

Source-only review of frozen head e474cfaea0eae97dc2f4868894b29b801656e5ec.

One candidate is published inline as externally unresolved: repository source proves the changed scale calculation and its downstream item-distribution path, but the decisive browser box-model and IntersectionObserver behavior is not present in the frozen evidence. No existing feedback duplicated this concern; the frozen feedback contained only assignment/status comments.

Both routed guides completed: docs/CrossCuttingGuidance.md and docs/BlazorComponentsGuidance.md. Each used the requested gpt-5.6-sol worker model; reasoning effort was not supplied (runtime default). The post-gate verifier also used gpt-5.6-sol and downgraded the candidate for missing external contract evidence. No materially changed area was left without a routed guide.

Guidance provenance: immutable workflow commit 18781e9d03cba0f3df9cdf7fae90f77771ca9f00. Product evidence was limited to tracked frozen source for head, merge base dd1062f94f356d6be59ad340e5aff2fd829165c6, and base tip 18781e9d03cba0f3df9cdf7fae90f77771ca9f00. Tests, CI, browser workflows, and implementation samples were not executed; changed tests were assessed from source. Security assessment was excluded by repository policy. Symlink, submodule, LFS-target, runtime, and external browser-contract behavior remain outside this proof.

Generated by ASP.NET Core Pull Request Review for #70629 · copilot · gpt56 · 220.3 AIC · ⌖ 8.49 AIC · ⊞ 20.1K
Comment /review to run again

Comment thread src/Components/Web.JS/src/Virtualize.ts Resolved
@PureWeen

Copy link
Copy Markdown
Member

/review

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.

🟡 Changes recommended

The regression test can pass without exercising the stalled-window failure because provider completion is not gated and the placeholder-only state is never verified.

1 open issue
What changed in this PR

This PR addresses #70553 by reducing rounding error in Blazor Virtualize scale calculations, which can leave fractional-height lists with a blank viewport.

Changes:

  • Uses the fractional declared spacer height when it closely matches the rendered box, otherwise retaining the offsetHeight fallback.
  • Adds a fractional-height table scenario with asynchronous loading.
  • Adds a Selenium test that reproduces the reported scroll cadence and checks for visible rows afterward.
File Description
src/​Components/​Web.JS/​src/​Virtualize.ts Updates the scale-factor denominator to avoid integer-height rounding error.
src/​Components/​test/​testassets/​BasicTestApp/​VirtualizationFractionalHeightTable.razor Adds the fractional-height table fixture.
src/​Components/​test/​testassets/​BasicTestApp/​Index.razor Registers the fixture in the test component selector.
src/​Components/​test/​E2ETest/​Tests/​VirtualizationTest.cs Adds browser coverage for row visibility after repeated scrolling.

Review effort: Balanced

@github-actions github-actions Bot 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.

Source-only review of frozen head 9908afea5bd1f9c6aa8ce748b3f124160c1b6d92.

One P3 candidate is published inline as externally unresolved: source proves the final assertion accepts any positive row intersection, but the frozen evidence contains no target-browser red/green artifact establishing that the reverted production path yields a substantially blank viewport that still passes this predicate.

Existing-feedback coverage was assessed without endorsement: inline comment 4609151068 already covers the distinct provider-timing false-pass risk, so it was not repeated. Inline thread 4591757756/reply 4600341383 covers spacer padding or border affecting the scale denominator; frozen source shows the one-pixel boundary remains accepted, but browser box-model/IntersectionObserver proof and the resulting observable failure are unavailable, so that concern remains unresolved rather than republished.

Both routed guides completed: docs/CrossCuttingGuidance.md and docs/BlazorComponentsGuidance.md. Each worker used gpt-5.6-sol; reasoning effort was not supplied (runtime default). The post-gate verifier also used gpt-5.6-sol. No materially changed area was left without a routed guide.

Guidance provenance: immutable workflow commit c5baf473f31fa3bbe9f8201e3411361c632f3a91. Product evidence was limited to tracked frozen source for the head, merge base dd1062f94f356d6be59ad340e5aff2fd829165c6, and base tip c5baf473f31fa3bbe9f8201e3411361c632f3a91. Tests, CI, browser workflows, and implementation samples were not executed; changed tests were assessed from source. Security assessment was excluded by repository policy. Symlink, submodule, LFS-target, runtime, and external browser-contract behavior remain outside this proof.

Generated by ASP.NET Core Pull Request Review for #70629 · copilot · gpt56 · 217.5 AIC · ⌖ 8.52 AIC · ⊞ 20.1K
Comment /review to run again

@PureWeen

Copy link
Copy Markdown
Member

The local review panel (GPT-5.6, GPT-6.1 and Opus 5.5) completed review of 9908afea5bd1f9c6aa8ce748b3f124160c1b6d92. No new verified defects or intent questions remained after deduplication.

The current-head Copilot feedback is still unresolved, so the campaign label is agent-reviewed-needs-changes. This reflects outstanding agent feedback, not a new local-panel finding.

Informational discarded check: A reviewer considered residual subpixel table-layout snapping at src/Components/Web.JS/src/Virtualize.ts:81-85. The arm discarded this hypothesis without a binding browser contract, demonstrated regression or user-visible effect. No candidate-verifier invocation was needed.

Posted for informational purposes so the author can confirm the verifier didn't discard or leave unresolved a real finding; this item does not block agent-reviewed-approved.

Untested coverage: The panel did not establish identical-test browser fail-before/pass-after evidence. The spacer-decoration and provider/viewport-assertion diagnostics are already recorded in the current-head hosted review and existing feedback, so they are not repeated inline.

Routine discarded checks: No new issue was established in invalid-height fallback, transform/zoom handling, cancellation, style synchronization or test-asset registration.

Validation boundary: All three local arms assessed frozen source; none ran a target build, test or browser.

Human-directed and GitHub Copilot-generated.

@joshbarros

Copy link
Copy Markdown
Contributor Author

CI is green except VariableHeightTable_FractionalRowHeights_KeepViewportFilled, which timed out waiting for the gated provider to show placeholders before the code under test ran. That looks like the provider/gating test timing out rather than the scale-factor change. Could the E2E job be rerun?

@ilonatommy

Copy link
Copy Markdown
Member

Could the E2E job be rerun?

It can but since the failure is in the newly added test, it's not a good idea to let it be flaky. What's more, the problem seems to be deterministic.. It looks like the test waits for placeholders before the item provider had a chance to return. The provider waits for release button before returning the total item count. Without it, we cannot render any placeholder.

In such cases, it's always good to run the tests locally. Was it passing locally for you?

@ilonatommy ilonatommy added the feature-blazor-virtualization This issue is related to the Blazor Virtualize component label Nov 18, 2026
@PureWeen
PureWeen requested a balanced review from Copilot November 18, 2026 20:07
@PureWeen

Copy link
Copy Markdown
Member

/review

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.

🟡 Changes recommended

The test waits for placeholders while the provider blocks the initial load, leaving the item count at zero and causing a timeout before scrolling or releasing the pending load.

1 open issue
1 resolved since last review

Review effort: Balanced

@PureWeen

Copy link
Copy Markdown
Member

The local review panel (GPT-5.6, GPT-6.1 and Opus 5.5) completed review of 5c9b0c1ef5c981df34e361d405bbf62f06a85eba. No new verified defects or intent questions remained after deduplication.

The current-head Copilot feedback is still unresolved, so agent-reviewed-needs-changes remains. That existing thread covers the initial-provider/placeholder wait dependency; this panel is not posting another inline copy.

Informational discarded/unresolved check: The panel revisited the one-pixel spacer-decoration boundary at src/Components/Web.JS/src/Virtualize.ts:81-85. One arm retracted a persistent under-capacity claim after tracing the shared geometry scaling and managed item-size recalibration. Broader browser-specific layout/observer effects remain unproven, not a verified defect. No new candidate required verifier dispatch.

Posted for informational purposes so the author can confirm the verifier didn't discard or leave unresolved a real finding; this item does not block agent-reviewed-approved.

Untested coverage: Identical-test real-browser fail-before/pass-after evidence for the fractional-height fix was not established. VariableHeightTable_FractionalRowHeights_KeepViewportFilled cannot reach its viewport assertion as written: its first provider response must establish the item count, but it is gated until after the placeholder wait. This is the existing feedback linked above, not a separate finding.

Routine discarded checks: No additional issue was established in invalid-height fallback, invariant pixel production, transform/zoom compensation, canceled-result handling, height synchronization/clamping, subpixel snapping, or the awaited scroll cadence.

Validation boundary: All three local arms reviewed frozen source; none ran a target build, test or browser.

Human-directed and GitHub Copilot-generated.

Signed-off-by: Josue Barros <goldenglowitsolutions@gmail.com>
@PureWeen

Copy link
Copy Markdown
Member

Hosted CI /review, Copilot code review, and Local GPT-6.2 code-review completed at commit a6773c9f with active review feedback to address (validation boundary: source-only).

Human-directed and GitHub Copilot-generated.

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.

🟡 Changes recommended

The spacer scale calculation can misclassify bordered content-box spacers as scaled, distorting the opposite-spacer distance and rendered-window positioning.

2 open issues

Review effort: Balanced

Comment thread src/Components/Web.JS/src/Virtualize.ts Resolved
@PureWeen

Copy link
Copy Markdown
Member

/review

@PureWeen

Copy link
Copy Markdown
Member

Hosted CI /review, Copilot code review, and Local GPT-6.2 code-review completed at commit 5f8b6ed3f6 with active review feedback to address (validation boundary: source-only).

Human-directed and GitHub Copilot-generated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟢 Approval recommended

No active review issues are reported for the change addressing fractional-height rounding errors in Virtualize.

1 open issue
1 resolved since last review

Review effort: Balanced

@PureWeen

Copy link
Copy Markdown
Member

/review

@PureWeen

Copy link
Copy Markdown
Member

Hosted CI /review, Copilot code review, and Local GPT-6.2 code-review completed at commit d0d89a1ac1 with no blocking issues remaining (validation boundary: source-only).

Human-directed and GitHub Copilot-generated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟢 Approval recommended

No active review issues are reported for the fractional-height virtualization fix.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@PureWeen

PureWeen commented Dec 1, 2026

Copy link
Copy Markdown
Member

/review

@PureWeen

PureWeen commented Dec 1, 2026

Copy link
Copy Markdown
Member

Hosted CI /review, Copilot code review, and Local GPT-6.2 code-review completed at commit 161d0578ac with no blocking issues remaining (validation boundary: source-only).

Human-directed and GitHub Copilot-generated.

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.

🟢 Approval recommended

No active review issues were identified in the fractional-height virtualization changes.

No open issues 🎉

Review effort: Balanced

@PureWeen

PureWeen commented Dec 1, 2026

Copy link
Copy Markdown
Member

/review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-reviewed-approved area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member 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.

Virtualize regression in .NET 11: fractional row heights stop the window following the scroll and leave the viewport blank

6 participants