Skip to content

[Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView - #40368

Merged
kubaflo merged 2 commits into
dotnet:candidate/11.0.1xx-sr2from
devanathan-vaithiyanathan:fix_40239
Nov 20, 2026
Merged

kubaflo merged 2 commits into
dotnet:candidate/11.0.1xx-sr2from
devanathan-vaithiyanathan:fix_40239

Conversation

@devanathan-vaithiyanathan

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into net11; agents must not retarget or merge.

Issue Details:

On Windows CV1, a CollectionView using GridItemsLayout stops firing RemainingItemsThresholdReached after item containers are recycled. The Scrolled event also reports incorrect visible item indexes.
The handler counted positions within realized containers rather than actual collection indexes, preventing the remaining-items threshold from being reached.

Description of Changes:

Updated ItemsViewHandler.Windows.cs to read FirstVisibleIndex and LastVisibleIndex directly from ItemsWrapGrid for ungrouped sources.
This keeps indexes accurate after recycling and allows incremental loading to continue.

Issues Fixed

Fixes #40239

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac
Before After
Windows
Before-40239.mp4
Windows
After-40239.mp4

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40368

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40368"

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Nov 18, 2026
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@devanathan-vaithiyanathan devanathan-vaithiyanathan changed the title [Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView [WIP][Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView Nov 18, 2026
@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 18, 2026
@kubaflo

kubaflo commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

/rebase

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@MauiBot

MauiBot commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@devanathan-vaithiyanathan — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Windows


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 18, 2026

@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.

Expert Review — 1 finding

Reviewed commit d698fbd.

See inline comments for details.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
@MauiBot

MauiBot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@devanathan-vaithiyanathan — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Windows


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026

@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.

Expert Review — 1 finding

Reviewed commit 687293e.

See inline comments for details.

@devanathan-vaithiyanathan devanathan-vaithiyanathan changed the title [WIP][Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView [Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView Nov 19, 2026
@vishnumenon2684

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@devanathan-vaithiyanathan devanathan-vaithiyanathan changed the title [Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView [WIP][Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView Nov 19, 2026
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
@MauiBot

MauiBot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@devanathan-vaithiyanathan — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Windows


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026

@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.

Expert Review — 1 finding

Reviewed commit 450566c.

See inline comments for details.

@devanathan-vaithiyanathan devanathan-vaithiyanathan changed the title [WIP][Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView [Windows][CV1] Fix RemainingItemsThresholdReached Not Firing with GridItemsLayout in CollectionView Nov 20, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review November 20, 2026 07:10
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 20, 2026
@MauiBot

MauiBot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@devanathan-vaithiyanathan — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Windows


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 20, 2026

@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.

Expert Review — 1 finding

Reviewed commit 450566c.

See inline comments for details.

firstVisibleItemIndex = itemsPanel.FirstVisibleIndex;
lastVisibleItemIndex = itemsPanel.LastVisibleIndex;
}
else if (CollectionViewSource?.IsSourceGrouped == false && ListViewBase.ItemsPanelRoot is ItemsWrapGrid itemsWrapGrid)

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.

[moderate] Regression Prevention and Test Coverage - The grouped-source exclusion has no discriminating negative-case test. All three added tests use ungrouped sources, so removing CollectionViewSource?.IsSourceGrouped == false && leaves every new assertion unchanged while routing grouped grids through native-panel indexes instead of the intentionally retained presenter fallback. Existing grouped-grid tests check rendering and group styles, not visible indexes. Add a multi-group CV1 ItemsWrapGrid scrolling test that distinguishes the fallback from the native-panel calculation, so accidental removal of this exclusion is detected.

@kubaflo
kubaflo changed the base branch from net11 to candidate/11.0.1xx-sr2 November 20, 2026 19:23
@kubaflo
kubaflo merged commit 0d7f770 into dotnet:candidate/11.0.1xx-sr2 Nov 20, 2026
139 of 181 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView collectionview-winui-cv1 community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants