Skip to content

[Android]Fix KeepItemsInView mode not scrolling to first item on collection update - #39491

Merged
kubaflo merged 3 commits into
dotnet:candidate/11.0.1xx-sr2from
SuthiYuvaraj:Fix-26810
Nov 12, 2026
Merged

kubaflo merged 3 commits into
dotnet:candidate/11.0.1xx-sr2from
SuthiYuvaraj:Fix-26810

Conversation

@SuthiYuvaraj

@SuthiYuvaraj SuthiYuvaraj commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

When the ItemsUpdatingScrollMode is set to KeepItemsInView, the items doesnot scroll to the first item , it maintains the current item

Root Cause

In the MauiRecyclerView, the data change observer is paused for KeepItemsInView in ItemsUpdatingScrollMode to maintain the first position of the item.

Description of Change

We need to observe the data changes for the KeepItemsInView option, as there may be cases where the item might not remain in view.The issue is fixed by restarting the data change observer in MauiRecyclerView.

Reference PR : #27153

Issues Fixed

Fixes #26810
Fixes #28006
Fixes #29153
Fixes #29145

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before Issue Fix After Issue Fix
Screen.Recording.2026-10-14.at.6.58.26.PM.mov
Screen.Recording.2026-10-20.at.3.45.06.PM.mov

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

Or

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

@azure-pipelines

This comment has been minimized.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 20, 2026
@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 20, 2026
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@SuthiYuvaraj SuthiYuvaraj changed the title [WIP][Android]Fix KeepItemsInView mode not scrolling to first item on collection update [Android]Fix KeepItemsInView mode not scrolling to first item on collection update Oct 22, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review October 22, 2026 11:19
Copilot AI balanced review requested due to automatic review settings October 22, 2026 11:19

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 observer resets scrolling for non-add updates and is not reattached after runtime item-template replacement.

2 open issues
What changed in this PR

Updates Android CollectionView scrolling so KeepItemsInView returns to the first item after collection updates, while preserving CarouselView’s separate position handling.

Changes:

  • Enables observer-driven first-item scrolling and updates the scroll-mode documentation.
  • Makes invalid observable-source lookups return null in both Android implementations.
  • Adds horizontal and vertical UI scenarios, adjusts existing scroll-mode expectations, and adds index-boundary device tests.
File Description
src/​Controls/​tests/​TestCases.Shared.Tests/​Tests/​Issues/​Issue26810Vertical.cs Adds vertical scroll-mode UI coverage.
src/​Controls/​tests/​TestCases.Shared.Tests/​Tests/​Issues/​Issue26810.cs Adds horizontal scroll-mode UI coverage.
src/​Controls/​tests/​TestCases.Shared.Tests/​Tests/​Issues/​CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs Updates Android insertion expectations.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue26810Vertical.cs Provides the vertical test page.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue26810.cs Provides shared test controls and the horizontal page.
src/​Controls/​tests/​DeviceTests/​Elements/​CollectionView/​CollectionViewTests.Android.cs Tests invalid indices and cleared collections.
src/​Controls/​src/​Core/​Items/​ItemsUpdatingScrollMode.cs Revises KeepItemsInView documentation.
src/​Controls/​src/​Core/​Handlers/​Items/​Android/​MauiRecyclerView.cs Enables observation and first-item scrolling outside CarouselView.
src/​Controls/​src/​Core/​Handlers/​Items/​Android/​ItemsSources/​ObservableItemsSource.cs Returns null for invalid item lookups.
src/​Compatibility/​Core/​src/​Android/​CollectionView/​ObservableItemsSource.cs Applies matching lookup behavior to compatibility code.

Review effort: Balanced

}

if (ItemsView.ItemsUpdatingScrollMode == ItemsUpdatingScrollMode.KeepItemsInView)
if (ItemsView is CarouselView && ItemsView.ItemsUpdatingScrollMode == ItemsUpdatingScrollMode.KeepItemsInView)
Comment on lines +1124 to +1125
ScrollTo(new ScrollToRequestEventArgs(0, -1,
Microsoft.Maui.Controls.ScrollToPosition.Start, false));
@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

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

Could you please check the ai's suggestions?

kubaflo added a commit that referenced this pull request Nov 13, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 14, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
…ection update (#39491)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details

When the `ItemsUpdatingScrollMode` is set to `KeepItemsInView,` the
items doesnot scroll to the first item , it maintains the current item

### Root Cause

In the `MauiRecyclerView`, the data change observer is paused for
`KeepItemsInView` in `ItemsUpdatingScrollMode` to maintain the first
position of the item.

### Description of Change

We need to observe the data changes for the `KeepItemsInView` option, as
there may be cases where the item might not remain in view.The issue is
fixed by restarting the data change observer in `MauiRecyclerView`.

### Reference PR : #27153 

### Issues Fixed
Fixes #26810 
Fixes #28006
Fixes #29153
Fixes #29145 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="200" height="200" alt="Before Fix video"
src="https://github.com/user-attachments/assets/8adbd870-9c8f-4ac2-bdf2-93301ef0e073">|<video
width="200" height="200" alt="After Fix video"
src="https://github.com/user-attachments/assets/5edb1a05-2a81-46ba-bb1f-353530b4fbc9">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
…40227)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, branched from
`41458556cf5d13573a632b83f89072f8badfb205`. No rebase, retarget, product
change, or merge is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Correct the stale `KeepItemsInView` UI-test contract exposed by #40116.
The [CollectionView
documentation](https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/collectionview/scrolling.md#control-scroll-position-when-new-items-are-added)
and current enum XML documentation specify keeping the **first item in
the list** displayed. #39491 and #39493 intentionally implement that
behavior. The remaining Apple test instead expected the previously
visible middle item; the Android branch only checked that this old item
disappeared.

Use the same positive assertions on Android, iOS and MacCatalyst,
retaining the existing Windows exclusion and CollectionView shard.
Verify the initial middle item is actually displayed, insert once, and
positively assert that `cover1.jpg, 0` is displayed. Scroll away again
and verify the new middle identity (`photo.jpg, 9`), then perform the
remaining 24 insertions and positively assert the first item again. This
preserves 25 total updates and prevents the second check from passing
merely because the first insertion already scrolled to the top.

The existing sample inserts at `(Count / 2) - 1`, **not** at index zero;
the first item's identity remains unchanged. No sample IDs, product
behavior, `KeepScrollOffset`, `KeepLastItemInView`, timeouts, retries,
skips, screenshots, tolerances, or CI configuration are changed.
Upstream searches found the existing product fixes above but no
competing test-contract correction.

**Native validation**

Used the original `ui-tests-samples-coreclr` HostApp from
[maui-pr-uitests
1678816](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1678816),
source `fd2f3ce40199b5c48e31a1814a23919f41f6c3d3`, on an isolated iPhone
11 Pro **CoreSimulator iOS 26.5**. The gallery, data source, template,
Apple scroll helper, and both Apple layout implementations have no
source diff between that CI source and this branch's candidate base.
This does not claim the entire binary tree is identical. HostApp
executable SHA-256:
`895101edc9254a6e235051f77cd2bc8e72d4646477b1ed4b308d8de86392396c`.

| Native oracle on the unchanged CI app | Result |
| --- | --- |
| Original Apple test, 25 insertions, old middle-item expectation |
Failed at final `WaitForElement("Vegetables.jpg, 10")`, reproducing CI
(42 s) |
| Corrected positive first-item test | Passed 3/3 (29 s, 31 s, 29 s) |
| Negative mutation: expect the old middle item after the first
insertion | Failed at that wrong-target oracle (25 s) |
| Restored corrected test after the negative mutation | Passed 2/2;
included in the 3/3 above |

Exact test command for the first corrected run (passed 1/1; repeated
with separate result/log paths for the other runs):

```sh
DEVICE_UDID=05DEC405-3AC9-4F2E-8DBC-8B75A0CF9F4C PLATFORM_VERSION=26.5 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/appium-corrected.log dotnet test artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net11.0/Controls.TestCases.iOS.Tests.dll --filter 'FullyQualifiedName~KeepItemsInView' --logger 'trx;LogFileName=corrected.trx' --results-directory /Users/kubaflo/.copilot/session-state/1a025737-fc40-4295-929e-719007b50025/files/native-corrected
```

The native HostApp was **not rebuilt** using the locally installed Xcode
27.2 or SDK-check bypasses. Only the platform-neutral net11.0 NUnit
runner was rebuilt using installed .NET SDK 11.0.100. The artifact route
deliberately avoids the local HostApp runner's source rebuild and
shutdown of other sessions' simulators. An initial overly specific
discovery filter selected zero tests; it was corrected to the command
above before collecting these outcomes.

Exact compilation/formatting commands and results:

```sh
# Passed: iOS NUnit runner, final corrected source.
dotnet msbuild src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Android NUnit runner compilation; not an Android native execution.
dotnet msbuild src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed: Catalyst NUnit runner compilation; not a Catalyst native execution.
dotnet msbuild src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -restore -t:Build -p:IncludeAndroidTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -v:q -nologo
# Passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs --verify-no-changes --verbosity quiet
# Passed.
git diff --check
```

Native Android and MacCatalyst execution and full-suite CI are not
claimed. No duplicate candidate-wide CI run was queued; candidate-wide
coverage remains coordinated separately.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #39493. These references are
intentionally non-closing; this fixes the test contract, not the
underlying product issues.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
…ng (#40258)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### 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 |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

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.

This is explicitly coordinated candidate-validation work targeting
`candidate/11.0.1xx-sr2`, based on
`dca0930d7167052b18c0fa25b1995fa416c2bb06`. No merge, retarget, rebase,
or manual CI/review request is included.

### Description of Change

<!-- Enter description of the fix in this section -->

Make the `Github5623` incremental-loading sample explicitly use
`KeepScrollOffset`. Its implicit `KeepItemsInView` default now
intentionally scrolls to the first item after an insertion (#39491).
That behavior is correct for that mode, but inappropriate for this
sample's continuous user scrolling through asynchronously appended
pages. #40227's documented first-item contract and the production
implementation remain intact.

The original API30 `Github5623(Android).CollectionViewInfiniteScroll`
oracle reproduced the candidate timeout at
`AppiumTouchActions.ScrollTo:333` / original test line 27. Separate
native diagnostics observed successful page appends `10 -> 20 -> 30 ->
40`, each immediately followed by a native zero-delta callback with the
first cell back at index 0/top 0. These rewinds explain the large
cumulative managed scroll offset despite low visible indexes.
Temporarily removing that native rewind as a **diagnostic control only**
eliminated the resets. The native control and all diagnostic code were
then restored and hash-verified before committing.

The committed change is exactly one XAML attribute. The original NUnit
method, discovery of item `12` by actual user gestures, random 20-319
item heights, `MeasureAllItems`, threshold 25, initial/page size 10,
loading implementation, original 15-second `ScrollTo` deadline, waits,
assertions, retries, categories, and screenshots are unchanged. This is
a sample contract correction, not a production rollback or a weakened
test.

Upstream open/recently merged PR searches covered `Github5623`, infinite
scrolling, `KeepItemsInView`, and `KeepScrollOffset`, together with the
exact sample file history. They identified #39491 and #40227 but no
competing sample repair.

**Native evidence**

Used one task-owned API30 Google APIs ARM64 Nexus 5X emulator, 1080x1920
at 420 dpi, with .NET SDK 11.0.100/runtime 11.0.0, source-built Release
HostApp, embedded assemblies, and the original Android NUnit assembly.
Appium transport alone was adapted locally to private ports
4793/8293/7893 and the owned emulator; that adaptation is not committed.
No physical Apple device or host macOS XCTest automation was used.

| Phase | Actual cases | Result |
| --- | --- | --- |
| Unchanged original sample/oracle | 1 | Failed: exact scrolling-to-12
timeout, 18.233251 s |
| Instrumented native trigger-removal control, not the published fix | 1
| Passed, 7.563766 s; appends retained without rewind |
| Non-instrumented sample-only fix | 3 | Passed: 10.791304 / 8.946879 /
8.947579 s |
| Revert only the sample attribute, restore and rebuild original sources
| 1 | Failed: same scrolling-to-12 timeout, 17.930881 s |
| Restore fix, rebuild immutable
`026e646e5f820804ca655813a9a5c0e83e40e115` | 3 | Passed: 8.922002 /
11.637289 / 10.590518 s |
| Unchanged original `TestCategory=CollectionView2` selector on that
pushed immutable head | 77 | **77 passed, 0 failed, 0 skipped**;
original infinite-scroll case passed in 7.278173 s |

Raw TRX and NUnit XML were checked independently and retained for every
invocation. A separate diagnostic run with the original rewind still
enabled passed in 16.054472 s and is **not** counted as a
non-instrumented baseline pass. Five initial zero-test selector
invocations and one Appium argument-quoting setup failure are retained
separately; none establishes an original-oracle outcome.

Immutable-head APK SHA-256:
`1b3cf5c30f5c001919874e540f52183cf41d346a4b7b2bcfa8ab4b1cd687b9f8`.

**Limits:** the local causal chain proves the sample repair on API30
ARM64/.NET 11 GA, and the completed exact-source API30 CI suite below
now supplies CI-servicing confirmation for the original 77-case Android
suite. Other-platform and whole-pipeline clearance are not claimed. The
supplied newest exact-target CI case was green; this PR does not claim
that the latest target was red or that the unrelated managed-unit
correction caused the failure. Candidate-wide CI remains
parent-coordinated.

**CI validation and remaining limits (2026-11-14 UTC snapshot)**

The live PR remains at head `026e646e5f820804ca655813a9a5c0e83e40e115`,
candidate base `dca0930d7167052b18c0fa25b1995fa416c2bb06`, and synthetic
merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. The human-issued
review, rebase, and pipeline requests on November 14 did not change
those source identities.

The earlier [maui-pr
1681455](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681455)
and [maui-pr-uitests
1681457](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681457)
were **canceled**, not complete passing runs. Before cancellation, the
four managed-unit Helix jobs completed and all **50 product work-item
XML reports** were audited, excluding controller work items, with no
named failures, assembly errors, or XML/count gaps. In each of
Debug/Release on macOS ARM64/Windows x64, Core recorded **1,125 passed,
0 skipped** and SourceGen **733 passed, 53 existing gated skips**. Those
skips are not passes; configuration counts are not summed into a
unique-test total. This source does not include the separate metadata
correction in #40252. Completed unit XML evidence remains valid despite
cancellation; it does not establish a full build, pack, integration, UI,
or device-test pass.

The human-requested replacement runs use the **same synthetic merge**.
They were initially confirmed **in progress**; the later terminal
UI/device status and remaining main-pipeline coverage are recorded
below:

| Pipeline | Existing replacement run | Queued (UTC) |
| --- | --- | --- |
| `maui-pr` |
[1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489)
| 16:45:42 |
| `maui-pr-uitests` |
[1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
| 16:45:45 |
| `maui-pr-devicetests` |
[1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
| 16:45:48 |

Reuse those runs; no additional pipelines or reviews were queued for
this description update. The native causal chain and original local **77
passed / 0 failed / 0 skipped** result above remain separate evidence,
not replacement-CI results.

The human-requested `maui-copilot` review gate
[16033607](https://dev.azure.com/DevDiv/DevDiv/_build/results?buildId=16033607)
is
**[INCONCLUSIVE](#40258 (comment):
provisioning stopped before verifying/checking out the PR head,
establishing a baseline, or running tests. Its trusted runner source
`e1140933230eabacbaf6412c0b8d80ece38f2d48` is not the tested PR source.
Original Azure raw log 12 contains 32 physical lines; lines 13, 21, and
29 repeat the protection refusal across the three existing setup
attempts: "The new servicing/staging target must have branch protection
before credential-bearing provisioning can run. Refusing to switch."
GitHub independently reports `candidate/11.0.1xx-sr2` as
`protected=false`.

This gate supplied **no test execution or causal-baseline result**. It
is not a test-red verdict or evidence against the sample fix. Deploying
the required candidate branch protection is a **maintainer action**; do
not bypass or modify the guard. Full replacement-CI outcomes and a
successfully provisioned review gate remain outstanding.

**Later CI/review evidence (2026-11-14 UTC)**

[Expert review
5905946810](#40258 (review))
reviewed exact head `026e646e5f820804ca655813a9a5c0e83e40e115` and
reported **zero findings**. Its state is `COMMENTED`, not human approval
or a successful runtime gate. Candidate protection is still `false`; the
provisioning gate described above remains blocked.

In [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
at the same `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` merge, the
**CoreCLR device-test build failed before runtime execution**. Original
raw log 63 records nine CA1416 diagnostics while compiling Essentials
`net11.0-ios27.0`: three deprecated `UIGraphics` calls in
`MediaPicker/ImageProcessor.ios.cs` and six availability calls in
`Passkeys/Passkeys.ios.cs`. The original binlog confirms those nine
diagnostics plus one outer `BuildFailed`, not independent faults in
every downstream project. Three dependent CoreCLR runtime stages were
skipped, leaving a coverage gap.

Those two Essentials source files are byte-identical on the target and
candidate. The actual candidate control [device run
1681310](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681310),
source `77a87edc03aa2728d7e0a51050da0e424a82c801`, completed the CoreCLR
build successfully with zero errors (original raw log 67). This build
failure is unrelated to the sample's one XAML attribute; the precise
analyzer-input divergence remains **unproven**. No speculative
availability/source fix or analyzer suppression is proposed.

Completed portions of [replacement UI run
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490),
on the same merge, supply separate unchanged MacCatalyst evidence:
CollectionView7 run **46901196** recorded **52 passed, 0 skipped**,
including both #31899 header/footer cases, with no retry; mixed drag
shard run **46901170** recorded **57 passed, 1 existing skip**,
including the #12060 and #28416 cases, with no retry. These are not
evidence of a causal MacCatalyst repair by this Android
incremental-sample change.

The MacCatalyst Navigation shard still has **two failures on both the
original attempt and existing retry**: #21814 receives an empty
navigation-event string, and #23902 receives "NavigatedTo called 2
times" instead of 3. Original raw log 3790 and publisher log 3792
correlate to run **46901248** (**85 passed, 2 failed, 1 skipped**);
failure details are
[#21814](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087)
and
[#23902](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086).
These repeat separately observed candidate/branch failures and are not
attributed to the unrelated sample delta.

The replacement Android `Github5623`/original 77-case CollectionView2 CI
result is published and passed on its first attempt, as detailed below.
Overall UI run **1681490** and device run **1681491** have completed
failed; main run **1681489** remains in progress with passing
Build/Pack/Unit stages and incomplete integration coverage. Keep the
original local causal/full-77 evidence distinct from completed CI shard
results, recovered initial failures, and remaining pipeline outcomes. No
new queues, review replies, source changes, or protection changes were
made.

**Completed exact-source Android CI (2026-11-14 UTC)**

The original API30 CollectionView2 suite completed in [maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
at synthetic merge `b79d6d1607e0fe3707f502bbde84ffbe1ac07c23` (PR head
`026e646e5f820804ca655813a9a5c0e83e40e115`, candidate base
`dca0930d7167052b18c0fa25b1995fa416c2bb06`). [Original run
46901428](https://dev.azure.com/dnceng-public/public/_TestManagement/Runs?runId=46901428&_a=runCharts)
recorded **77 passed, 0 failed, 0 skipped on the first attempt**. The
actual [Github5623(Android).CollectionViewInfiniteScroll result
100042](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901428/Results/100042)
passed in **9,353 ms**, without a harness retry.

Original Azure [raw log
4026](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4026)
contains 1,254 physical lines and the successful 77-pass summary, with
no failed case or harness retry. [Publisher log
4028](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1681490/logs/4028)
links those exact 77 results to run 46901428. All 77 automated names and
their multiplicities match actual-candidate original run 46895912; the
selector, original oracle, and 15-second scroll deadline were not
reduced or changed. This closes the previously recorded local
ARM64/GA-versus-CI-servicing runtime gap **for this original Android
suite only**; the local causal chain remains independently documented
above.

This is not a whole-pipeline or other-platform clearance. The two
MacCatalyst Navigation failures above remain. A separate MacCatalyst
[#25074
result](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228)
fails `ButtonResizesWhenTitleOrImageChangesAltered.png` with **1.14%
difference on both the original attempt and existing retry**; it is
unrelated to this sample delta, not an Android-oracle failure. The
CoreCLR availability-build failure and skipped-runtime coverage gap in
device run 1681491 remain; that overall device run has completed
**failed**, as has UI run 1681490. Candidate protection is still
`false`, so the runtime review gate remains blocked despite the
exact-head zero-findings expert review. Main run 1681489 has passing
Build/Pack/Unit stages, but its incomplete Integration stage prevents a
whole-main pass. The full terminal UI and measured integration scopes
are detailed below. No new queues, review replies, source changes, or
protection changes were made.

**Terminal UI audit and remaining validation (2026-11-14 UTC)**

[maui-pr-uitests
1681490](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681490)
has completed **failed** at exact merge
`b79d6d1607e0fe3707f502bbde84ffbe1ac07c23`. All **129 original UI task
raw logs**, their own publishers, and **129 actual final result sets**
were audited. Final published records across platforms/categories are
**14,907 passed, 302 NotExecuted, 3 failed**. These are execution
records, **not unique methods or first-attempt green results**. Nineteen
eventually successful tasks retain **71 original failed records** in
their raw logs; retry recovery does not erase those failures or
establish causal repairs. Every raw failure method name appears in a
corresponding final run, but this is a method-name presence check, not a
claim of fully qualified oracle identity equivalence.

The only three final failures are the MacCatalyst cases already
documented: [#25074's 1.14% altered-button
snapshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901776/Results/100228),
[#23902's two-versus-three navigation
count](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100086),
and [#21814's empty navigation-event
text](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/46901248/Results/100087).
The original Android API30 CollectionView2 suite above remains **77
passed, 0 failed, 0 skipped on its first attempt, with no harness
retry**; the full terminal audit independently preserves its original
log 4026, publisher 4028, and run 46901428. The unrelated Mac failures
do not invalidate that exact Android result.

[maui-pr
1681489](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681489),
on the same merge, now has completed passing **Build, Pack, and Helix
Unit Test stages**, but **the whole pipeline is not yet passed**. Only
**20 of 23 original integration tasks** have completed measured
summaries: **311 passed, 10 existing skips, 0 failed** in those
completed tasks. Three tasks remain unmeasured/in progress:
`mac_buildtemplate_previous_tests`, Windows `Build`, and Windows
`Blazor`. Their absent results are not zero failures or passes.

Terminal [device run
1681491](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681491)
remains **failed**. Its **31 available product XML reports** contain
**22,318 passed, 2 existing Windows Border failures, 549 existing
skips**, with available per-assembly counts checked and no
assembly-error/count gaps. Skip identities, reasons, and multiplicities
match the candidate; counts span available execution/configuration
records, not unique methods. The nine-CA1416 CoreCLR compile failure and
three skipped dependent runtime stages remain a separate coverage gap:
available XML results do not certify the missing CoreCLR matrix.

The PR head, candidate base, and synthetic merge are unchanged.
Candidate protection remains `false`, the provisioning review gate
remains blocked, and zero-findings expert review is still not human
approval or runtime-gate success. No source changes, pushes, new queues,
review replies, or protection changes were made for this validation
update.

**Exact validation commands and results**

```sh
# Passed: Android-only repository build tasks.
dotnet build ./Microsoft.Maui.BuildTasks.slnf -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:BuildTaskOnlyBuild=true -v:q -nologo

# Passed for original, diagnostic control, fixed, reverted, restored, and immutable-head builds.
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj -c Release -f net11.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true -v:q -nologo

# Passed: original Android NUnit runner, with private transport only.
dotnet build src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false -p:IncludeAndroidTargetFrameworks=true -v:q -nologo

# Same command for each original-oracle phase; $resultdir selected a separate retained phase/attempt directory.
# Results are the actual cases in the phase table above; no automatic test retry was added.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE="$resultdir/appium.log" dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'Name=CollectionViewInfiniteScroll' --logger 'trx;LogFileName=original.trx' --results-directory "$resultdir" -v:q -nologo -- "NUnit.TestOutputXml=$resultdir/nunit"

# Passed: original 77-case selector, after pushing and verifying the exact immutable head.
DEVICE_UDID=emulator-5582 DEVICE_SKIN=Nexus_5X PLATFORM_VERSION=11 HEADLESS=true APPIUM_LOG_FILE=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/appium.log dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj -c Release --no-build --no-restore --filter 'TestCategory=CollectionView2' --logger 'trx;LogFileName=collectionview2.trx' --results-directory /Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2 -v:q -nologo -- NUnit.TestOutputXml=/Users/kubaflo/.copilot/session-state/0f3d8462-8297-42f8-95e8-06e582359747/files/original-collectionview2/nunit

# Passed.
xmllint --noout src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml
# Passed.
git diff --check

# Not completed: bounded/stopped during full-solution loading without output; no formatting pass claimed.
# Only XAML changed; native XAML compilation and XML syntax checks above passed.
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Github5623.xaml --verify-no-changes --verbosity quiet
```

Direct source build/install/NUnit commands mirror the existing Cake
UI-test recipe and deliberately avoid the local wrapper's global ADB
restart/recovery behavior in this shared environment. Pre-existing
emulators and their ADB server were preserved.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116, #39491, and #40227. These references are
intentionally non-closing; this corrects the incremental-loading
sample's scroll-mode contract.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

partner/syncfusion Issues / PR's with Syncfusion collaboration s/agent-review-in-progress AI review is currently running for this PR

Projects

None yet

3 participants