Skip to content

[iOS] Restore horizontal CollectionView intrinsic height in Auto rows - #40226

Merged
kubaflo merged 1 commit into
candidate/11.0.1xx-sr2from
kubaflo-horizontal-collection-sizing
Nov 13, 2026
Merged

kubaflo merged 1 commit into
candidate/11.0.1xx-sr2from
kubaflo-horizontal-collection-sizing

Conversation

@kubaflo

@kubaflo kubaflo commented Nov 13, 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!

Target Branch

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

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

This is explicitly coordinated stabilization of candidate/11.0.1xx-sr2 for #40116, based on 41458556cf5d13573a632b83f89072f8badfb205. No retargeting or merging is requested.

Description of Change

Fix the repeated iOS Issue16320Test regression without changing its sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from returning the temporary 10,000-point frame as content height. However, the horizontal fallback still resets height to zero. A horizontal CollectionView in an Auto row, without an explicit height/minimum/maximum, therefore never receives usable native bounds and cannot realize its items. The unchanged UI test finds and taps Add, then times out waiting for item: 1.

For horizontal linear CollectionViews that reach this unbounded fallback, measure the first actual item's intrinsic height instead of returning zero. Reuse normal templated-cell binding, including template selection and binding context; skip empty leading groups; support the native default cell when there is no template. Unbind and disconnect the temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint resolution remain unchanged. Finite probes, vertical layouts, CarouselView, grids, controller/scroll-update logic, and the original UI test/sample are unchanged.

Native causal evidence

All local native runs used an isolated iPhone 11 Pro CoreSimulator, iOS 26.5. Production source was rebuilt with the available .NET SDK 11.0.100 / iOS SDK 27.2 / Xcode 27.2. These are diagnostic source builds, not a replay of the exact CI binary or validation of the unavailable pinned Xcode 27.0 toolchain. No SDK-version check was disabled.

State Actual native result
Original candidate Unchanged Issue16320Test fails at line 22 after tapping Add.
Causal control: remove only the unbounded-probe guard Original UI test passes 1/1; this control is not included in the fix.
Intended correction Original UI test passes 3/3; focused device sizing suite passes 18/18.
Restore the exact original production file, retain new tests All 3 new cases fail at height 0; all 15 existing constraint/probe cases pass.
Restore the correction Focused device sizing suite passes 18/18 again.

The three new device cases cover bound templates, grouping with an empty leading group, and default/native content. Heights are compared with actual label measurements, without fixed-height requests; each case repeats measurement and verifies native-frame restoration. Existing #39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'

Passed 3/3 against the correction, with DEVICE_UDID targeting the isolated simulator and HEADLESS=true. Native XHarness ran these exact discovered method selectors:

[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent

The device diagnostic runner used a session-only standard scene manifest and registered subclass of the existing test scene delegate; scene validation stayed enabled. Its pre-existing obsolete legacy-handler warning was nonfatal (WarningsNotAsErrors=CS0618). None of these diagnostic provisioning files/settings are committed.

Formatting passed with:

dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still pending. Open and recently merged sizing PRs were checked: this corrects #39778 rather than duplicating it or reverting its protection; #39882's controller/shrinking logic and open #39935's header-resizing work are not changed.

Issues Fixed

Relates to #40116 and #16320. Corrects the candidate regression introduced by #39778 while preserving its fix for #39770.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 13, 2026 13:25 — with GitHub Actions Inactive
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

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

MauiBot commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

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

Result INCONCLUSIVE Platform Android


🧪 Gate analysis — click to expand

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

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

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

No immutable without-fix baseline was prepared.

@kubaflo

kubaflo commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

/rebase

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 13, 2026
Preserve the unbounded native-probe guard while bootstrapping horizontal linear CollectionViews from a real item measurement. Cover templated, grouped and default content without fixed-height requests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot force-pushed the kubaflo-horizontal-collection-sizing branch from 8ef940a to 7505cf8 Compare November 13, 2026 15:27
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

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

MauiBot commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

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

Result INCONCLUSIVE Platform Android


🧪 Gate analysis — click to expand

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

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

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

No immutable without-fix baseline was prepared.

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expert Review — 0 findings

Reviewed commit 7505cf8.

@kubaflo
kubaflo merged commit 674a2c4 into candidate/11.0.1xx-sr2 Nov 13, 2026
72 of 174 checks passed
@kubaflo
kubaflo deleted the kubaflo-horizontal-collection-sizing branch November 13, 2026 18:34
kubaflo added a commit that referenced this pull request Nov 13, 2026
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

<!--
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
…#40226)

<!-- 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 stabilization of `candidate/11.0.1xx-sr2`
for #40116, based on `41458556cf5d13573a632b83f89072f8badfb205`. No
retargeting or merging is requested.

### Description of Change

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

Fix the repeated iOS `Issue16320Test` regression without changing its
sample, assertions, timeouts, snapshots, or layout requests.

#39778 correctly prevents an unbounded cross-axis native probe from
returning the temporary 10,000-point frame as content height. However,
the horizontal fallback still resets height to zero. A horizontal
CollectionView in an Auto row, without an explicit
height/minimum/maximum, therefore never receives usable native bounds
and cannot realize its items. The unchanged UI test finds and taps
`Add`, then times out waiting for `item: 1`.

For horizontal **linear** CollectionViews that reach this unbounded
fallback, measure the first actual item's intrinsic height instead of
returning zero. Reuse normal templated-cell binding, including template
selection and binding context; skip empty leading groups; support the
native default cell when there is no template. Unbind and disconnect the
temporary template tree after measurement.

The native-probe guard and explicit/minimum/maximum constraint
resolution remain unchanged. Finite probes, vertical layouts,
CarouselView, grids, controller/scroll-update logic, and the original UI
test/sample are unchanged.

#### Native causal evidence

All local native runs used an isolated **iPhone 11 Pro CoreSimulator,
iOS 26.5**. Production source was rebuilt with the available **.NET SDK
11.0.100 / iOS SDK 27.2 / Xcode 27.2**. These are diagnostic source
builds, **not** a replay of the exact CI binary or validation of the
unavailable pinned Xcode 27.0 toolchain. No SDK-version check was
disabled.

| State | Actual native result |
| --- | --- |
| Original candidate | Unchanged `Issue16320Test` fails at line 22 after
tapping Add. |
| Causal control: remove only the unbounded-probe guard | Original UI
test passes 1/1; this control is not included in the fix. |
| Intended correction | Original UI test passes 3/3; focused device
sizing suite passes 18/18. |
| Restore the exact original production file, retain new tests | All 3
new cases fail at height 0; all 15 existing constraint/probe cases pass.
|
| Restore the correction | Focused device sizing suite passes 18/18
again. |

The three new device cases cover bound templates, grouping with an empty
leading group, and default/native content. Heights are compared with
actual label measurements, without fixed-height requests; each case
repeats measurement and verifies native-frame restoration. Existing
#39778 tests remain unchanged and passing.

Executed the unchanged UI oracle with:

```sh
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj -f net11.0 -c Debug --no-build --no-restore --filter 'FullyQualifiedName~Issue16320Test'
```

Passed 3/3 against the correction, with `DEVICE_UDID` targeting the
isolated simulator and `HEADLESS=true`. Native XHarness ran these exact
discovered method selectors:

```text
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightMeasuresContent
[CollectionView] [NavigationRenderer] HorizontalCollectionViewPreMountHeightRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountWidthRespectsConstraints
[CollectionView] [NavigationRenderer] VerticalCollectionViewPreMountHeightMeasuresContent
```

The device diagnostic runner used a session-only standard scene manifest
and registered subclass of the existing test scene delegate; scene
validation stayed enabled. Its pre-existing obsolete legacy-handler
warning was nonfatal (`WarningsNotAsErrors=CS0618`). None of these
diagnostic provisioning files/settings are committed.

Formatting passed with:

```sh
dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs --verbosity quiet
```

Exact pinned-toolchain CI and Mac Catalyst runtime validation are still
pending. Open and recently merged sizing PRs were checked: this corrects
#39778 rather than duplicating it or reverting its protection; #39882's
controller/shrinking logic and open #39935's header-resizing work are
not changed.

### 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 and #16320. Corrects the candidate regression
introduced by #39778 while preserving its fix for #39770.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants