Repository navigation
[iOS] Restore horizontal CollectionView intrinsic height in Auto rows - #40226
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
PR Test Gate
🧪 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. |
|
/rebase |
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>
8ef940a to
7505cf8
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
PR Test Gate
🧪 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. |
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 7505cf8.
…#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>
…#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>
…#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>
…#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>
…#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>
…#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>
…#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>
…#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>
…#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>
…#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>
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
mainnet11, for reviewFor .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-sr2for #40116, based on41458556cf5d13573a632b83f89072f8badfb205. No retargeting or merging is requested.Description of Change
Fix the repeated iOS
Issue16320Testregression 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 foritem: 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.
Issue16320Testfails at line 22 after tapping Add.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:
Passed 3/3 against the correction, with
DEVICE_UDIDtargeting the isolated simulator andHEADLESS=true. Native XHarness ran these exact discovered method selectors: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:
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.