Repository navigation
Add iPhone Duo support to Controls.Foldable - #38915
Conversation
Use iOS 27.1 division reserved regions for per-view TwoPaneView layout and UIHingeInteraction for hinge angle updates. Keep the implementation compile-gated until the corresponding dotnet/macios bindings flow into MAUI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38915Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38915" |
This comment has been minimized.
This comment has been minimized.
|
@PureWeen could you please review this staged iPhone Duo support, particularly the per-view/window service lifecycle and the compile gate for the pending iOS 27.1 bindings from dotnet/macios#26705? I also verified that |
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.
|
Note 🔍
|
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 3 findings
See inline comments for details.
Use element-scoped DualScreenInfo and platform-neutral UI so the existing TwoPaneView gallery page demonstrates iPhone Duo division regions and hinge updates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Create element-scoped foldable state when the page appears and report layout state from TwoPaneView so the gallery reflects the active iPhone Duo division immediately. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
iPhone Duo gallery validationBook posture — active division region Open posture Captured from the updated Controls.Sample gallery on the iOS 27.1 iPhone Duo simulator using local-only bindings matching dotnet/macios#26705. The Book posture reports |
Attach UIHingeInteraction to the window controller root view following UIKit guidance and retain its escaping update handler for the monitor lifetime. Add focused coverage for all TwoPaneView controls exposed by the foldable gallery. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Foldable gallery functionality audit
Focused tests now cover 22 scenarios and pass. The clean Controls.Sample iOS build and Foldable build matrix also pass. |
Reconnect monitoring after a view enters a window, centralize service subscription cleanup, and avoid retaining DualScreenInfo through a direct HandlerChanged subscription. Add lifecycle regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge-safety reviewRecommendation: hold merge pending validation, not because of a confirmed new code defect. Reviewed commit No confirmed introduced source defect surfaced, and all 39 platform-neutral Foldable unit tests passed locally. Earlier findings around subscription balancing, handler/service rebinding, trigger cleanup, geometry refresh, and retained-window cleanup are addressed in the current code. In particular,
The remaining concerns are validation gaps, not proven regressions:
Several red results should not be reported as new regressions: the Android image-background assertion, Mac WebView timeout, and Mac translation/layout assertion have matching failures on Before merge: obtain current-head iOS 27.1 evidence for live fold/unfold transitions, resizing and element/ancestor movement, trigger detach/reattach, shared monitor consumers, and window/scene teardown. Rerun or conclusively attribute the remaining failures and restore required CI coverage. No replacement implementation is recommended without a verified defect. |
Keep the Foldable test project mapping while preserving removal of obsolete Compatibility mappings. Select the two-argument MainThread test hook explicitly after net11 added an overload. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Resolved and pushed the conflicts with The two conflicts were in test-runner/project maps. Kept this PR's Validation also caught an integration issue: net11 added a second PowerShell syntax parsing passed for both resolved scripts and the automatically merged detection-test file. Direct invocation of |
| <IosDuoBindingsAvailable Condition="'$(IosDuoBindingsAvailable)' == '' and '$(TargetPlatformVersion)' != ''">$([MSBuild]::VersionGreaterThanOrEquals('$(TargetPlatformVersion)', '27.1'))</IosDuoBindingsAvailable> | ||
| <IosDuoBindingsAvailable Condition="'$(IosDuoBindingsAvailable)' == ''">false</IosDuoBindingsAvailable> | ||
| <DefineConstants Condition="'$(IosDuoBindingsAvailable)' == 'true'">$(DefineConstants);IOS_DUO_BINDINGS</DefineConstants> |
| bool IsInMultipleRegions(Rect layoutBounds, Rect hinge) | ||
| { | ||
| bool isInMultipleRegions = false; |
| _info?.PropertyChanged -= OnDualScreenInfoPropertyChanged; | ||
|
|
||
| _visualElement = visualElement; | ||
| _info = new DualScreenInfo(visualElement); |
| var windowRegion = platformView.ConvertRectToView( | ||
| new CoreGraphics.CGRect(localRegion.X, localRegion.Y, localRegion.Width, localRegion.Height), | ||
| platformView.Window); | ||
|
|
||
| return new Rect(windowRegion.X, windowRegion.Y, windowRegion.Width, windowRegion.Height); |
|
@kubaflo , is this getting back ported to .NET 10 MAUI as well? |
|
@beeradmoore, sorry but it won't |
|
@beeradmoore actually, let me discuss with the team |
|
Not critical if they are not, at least for us we plan to move to .NET 11 when we can. MAUI/iOS always gets caught up in a weird iOS release thing. New iOS comes out (iOS 27.0) |
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Backports [#38915](#38915), "Add iPhone Duo support to Controls.Foldable", from squash commit `a561eaec4aacbe962416c64491aa5ffbc6bde9ae` to **`inflight/current`**, as explicitly requested. Preserves the source implementation: view/window-scoped reserved-region geometry, hinge monitoring and lifecycle cleanup, scene activation support, shared layout refresh, state triggers, sample updates, and Foldable unit tests. Original author and source coauthors are preserved. The only cherry-pick conflicts were in `.github/scripts/RunTests.ps1` and `.github/scripts/shared/Detect-TestsInDiff.ps1`. Resolution retains this branch's Compatibility test entries and adds the source Foldable mappings. Formatting is scoped to changed C# files; the formatter's unrelated Android null-conditional event rewrite was not retained. **SDK limitation:** the source's native Duo path is enabled only for iOS target platform version 27.1+ (or an explicit `IosDuoBindingsAvailable` override with compatible bindings). This target branch currently defaults to iOS 26.0, so its default build retains fallback behavior rather than enabling Duo APIs. This PR does not upgrade the branch-wide SDK/workload or remove capability/runtime guards. Publishing actual Duo-enabled artifacts requires a compatible iOS 27.1 SDK build configuration. **Validation run in this backport worktree** using .NET SDK `11.0.100-preview.6.26359.118`, targeting this branch's `net10.0` TFMs, and Xcode 26.6: | Command | Result | | --- | --- | | `dotnet test src/Controls/Foldable/test/Controls.Foldable.UnitTests.csproj --nologo --verbosity minimal` | Passed: 39, failed: 0, skipped: 0; rerun after formatting and normal restore. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios26.0 --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-maccatalyst26.0 --no-restore --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-android36.0 --no-restore --nologo --verbosity minimal` | Passed: 3 Gradle Java 8 obsolescence warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios27.1 -p:TargetFrameworks=net10.0-ios27.1 --nologo --verbosity minimal` | Blocked: NETSDK1140, local SDK supports iOS 26.0/26.5, not 27.1. | | `git diff --cached --check` | Passed. | | `git diff --check` | Passed. | Formatting command (passed; `changed_files` contains staged changed `.cs` paths): ```bash changed_files=() while IFS= read -r file; do changed_files+=("$file"); done < <(git diff --cached --name-only -- '*.cs') dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include "${changed_files[@]}" --verbosity quiet ``` PowerShell syntax check (passed for all three source script files): ```powershell $files=@(".github/scripts/RunTests.ps1", ".github/scripts/shared/Detect-TestsInDiff.ps1", ".github/scripts/shared/Detect-TestsInDiff.Tests.ps1") foreach ($file in $files) { $tokens=$null; $errors=$null [System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PWD $file), [ref]$tokens, [ref]$errors) > $null if ($errors.Count) { $errors | Write-Error; exit 1 } Write-Output "Parsed $file" } ``` Build/test/format subprocesses ran with `GH_TOKEN`, `GITHUB_TOKEN`, and `COPILOT_GITHUB_TOKEN` removed from their environments. A `--no-restore` test attempt after the explicit 27.1 restore probe encountered changed assets; normal restore and the full 39-test rerun above succeeded. **Not run:** native iOS 27.1/Duo compilation or simulator/device runtime validation, sample app build/runtime validation, Windows validation, or pipeline Pester tests. No XCTest or host UI automation was used. Source PR validation is not claimed as a result of this backport. ### 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. --> Backport of [#38915](#38915); no separate issue. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741e14bf-fe5c-4150-857c-40b354de3403
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Backports [#38915](#38915), "Add iPhone Duo support to Controls.Foldable", from squash commit `a561eaec4aacbe962416c64491aa5ffbc6bde9ae` to **`inflight/current`**, as explicitly requested. Preserves the source implementation: view/window-scoped reserved-region geometry, hinge monitoring and lifecycle cleanup, scene activation support, shared layout refresh, state triggers, sample updates, and Foldable unit tests. Original author and source coauthors are preserved. The only cherry-pick conflicts were in `.github/scripts/RunTests.ps1` and `.github/scripts/shared/Detect-TestsInDiff.ps1`. Resolution retains this branch's Compatibility test entries and adds the source Foldable mappings. Formatting is scoped to changed C# files; the formatter's unrelated Android null-conditional event rewrite was not retained. **SDK limitation:** the source's native Duo path is enabled only for iOS target platform version 27.1+ (or an explicit `IosDuoBindingsAvailable` override with compatible bindings). This target branch currently defaults to iOS 26.0, so its default build retains fallback behavior rather than enabling Duo APIs. This PR does not upgrade the branch-wide SDK/workload or remove capability/runtime guards. Publishing actual Duo-enabled artifacts requires a compatible iOS 27.1 SDK build configuration. **Validation run in this backport worktree** using .NET SDK `11.0.100-preview.6.26359.118`, targeting this branch's `net10.0` TFMs, and Xcode 26.6: | Command | Result | | --- | --- | | `dotnet test src/Controls/Foldable/test/Controls.Foldable.UnitTests.csproj --nologo --verbosity minimal` | Passed: 39, failed: 0, skipped: 0; rerun after formatting and normal restore. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios26.0 --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-maccatalyst26.0 --no-restore --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-android36.0 --no-restore --nologo --verbosity minimal` | Passed: 3 Gradle Java 8 obsolescence warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios27.1 -p:TargetFrameworks=net10.0-ios27.1 --nologo --verbosity minimal` | Blocked: NETSDK1140, local SDK supports iOS 26.0/26.5, not 27.1. | | `git diff --cached --check` | Passed. | | `git diff --check` | Passed. | Formatting command (passed; `changed_files` contains staged changed `.cs` paths): ```bash changed_files=() while IFS= read -r file; do changed_files+=("$file"); done < <(git diff --cached --name-only -- '*.cs') dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include "${changed_files[@]}" --verbosity quiet ``` PowerShell syntax check (passed for all three source script files): ```powershell $files=@(".github/scripts/RunTests.ps1", ".github/scripts/shared/Detect-TestsInDiff.ps1", ".github/scripts/shared/Detect-TestsInDiff.Tests.ps1") foreach ($file in $files) { $tokens=$null; $errors=$null [System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PWD $file), [ref]$tokens, [ref]$errors) > $null if ($errors.Count) { $errors | Write-Error; exit 1 } Write-Output "Parsed $file" } ``` Build/test/format subprocesses ran with `GH_TOKEN`, `GITHUB_TOKEN`, and `COPILOT_GITHUB_TOKEN` removed from their environments. A `--no-restore` test attempt after the explicit 27.1 restore probe encountered changed assets; normal restore and the full 39-test rerun above succeeded. **Not run:** native iOS 27.1/Duo compilation or simulator/device runtime validation, sample app build/runtime validation, Windows validation, or pipeline Pester tests. No XCTest or host UI automation was used. Source PR validation is not claimed as a result of this backport. ### 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. --> Backport of [#38915](#38915); no separate issue. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741e14bf-fe5c-4150-857c-40b354de3403
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Backports [#38915](#38915), "Add iPhone Duo support to Controls.Foldable", from squash commit `a561eaec4aacbe962416c64491aa5ffbc6bde9ae` to **`inflight/current`**, as explicitly requested. Preserves the source implementation: view/window-scoped reserved-region geometry, hinge monitoring and lifecycle cleanup, scene activation support, shared layout refresh, state triggers, sample updates, and Foldable unit tests. Original author and source coauthors are preserved. The only cherry-pick conflicts were in `.github/scripts/RunTests.ps1` and `.github/scripts/shared/Detect-TestsInDiff.ps1`. Resolution retains this branch's Compatibility test entries and adds the source Foldable mappings. Formatting is scoped to changed C# files; the formatter's unrelated Android null-conditional event rewrite was not retained. **SDK limitation:** the source's native Duo path is enabled only for iOS target platform version 27.1+ (or an explicit `IosDuoBindingsAvailable` override with compatible bindings). This target branch currently defaults to iOS 26.0, so its default build retains fallback behavior rather than enabling Duo APIs. This PR does not upgrade the branch-wide SDK/workload or remove capability/runtime guards. Publishing actual Duo-enabled artifacts requires a compatible iOS 27.1 SDK build configuration. **Validation run in this backport worktree** using .NET SDK `11.0.100-preview.6.26359.118`, targeting this branch's `net10.0` TFMs, and Xcode 26.6: | Command | Result | | --- | --- | | `dotnet test src/Controls/Foldable/test/Controls.Foldable.UnitTests.csproj --nologo --verbosity minimal` | Passed: 39, failed: 0, skipped: 0; rerun after formatting and normal restore. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios26.0 --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-maccatalyst26.0 --no-restore --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-android36.0 --no-restore --nologo --verbosity minimal` | Passed: 3 Gradle Java 8 obsolescence warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios27.1 -p:TargetFrameworks=net10.0-ios27.1 --nologo --verbosity minimal` | Blocked: NETSDK1140, local SDK supports iOS 26.0/26.5, not 27.1. | | `git diff --cached --check` | Passed. | | `git diff --check` | Passed. | Formatting command (passed; `changed_files` contains staged changed `.cs` paths): ```bash changed_files=() while IFS= read -r file; do changed_files+=("$file"); done < <(git diff --cached --name-only -- '*.cs') dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include "${changed_files[@]}" --verbosity quiet ``` PowerShell syntax check (passed for all three source script files): ```powershell $files=@(".github/scripts/RunTests.ps1", ".github/scripts/shared/Detect-TestsInDiff.ps1", ".github/scripts/shared/Detect-TestsInDiff.Tests.ps1") foreach ($file in $files) { $tokens=$null; $errors=$null [System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PWD $file), [ref]$tokens, [ref]$errors) > $null if ($errors.Count) { $errors | Write-Error; exit 1 } Write-Output "Parsed $file" } ``` Build/test/format subprocesses ran with `GH_TOKEN`, `GITHUB_TOKEN`, and `COPILOT_GITHUB_TOKEN` removed from their environments. A `--no-restore` test attempt after the explicit 27.1 restore probe encountered changed assets; normal restore and the full 39-test rerun above succeeded. **Not run:** native iOS 27.1/Duo compilation or simulator/device runtime validation, sample app build/runtime validation, Windows validation, or pipeline Pester tests. No XCTest or host UI automation was used. Source PR validation is not claimed as a result of this backport. ### 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. --> Backport of [#38915](#38915); no separate issue. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741e14bf-fe5c-4150-857c-40b354de3403
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Backports [#38915](#38915), "Add iPhone Duo support to Controls.Foldable", from squash commit `a561eaec4aacbe962416c64491aa5ffbc6bde9ae` to **`inflight/current`**, as explicitly requested. Preserves the source implementation: view/window-scoped reserved-region geometry, hinge monitoring and lifecycle cleanup, scene activation support, shared layout refresh, state triggers, sample updates, and Foldable unit tests. Original author and source coauthors are preserved. The only cherry-pick conflicts were in `.github/scripts/RunTests.ps1` and `.github/scripts/shared/Detect-TestsInDiff.ps1`. Resolution retains this branch's Compatibility test entries and adds the source Foldable mappings. Formatting is scoped to changed C# files; the formatter's unrelated Android null-conditional event rewrite was not retained. **SDK limitation:** the source's native Duo path is enabled only for iOS target platform version 27.1+ (or an explicit `IosDuoBindingsAvailable` override with compatible bindings). This target branch currently defaults to iOS 26.0, so its default build retains fallback behavior rather than enabling Duo APIs. This PR does not upgrade the branch-wide SDK/workload or remove capability/runtime guards. Publishing actual Duo-enabled artifacts requires a compatible iOS 27.1 SDK build configuration. **Validation run in this backport worktree** using .NET SDK `11.0.100-preview.6.26359.118`, targeting this branch's `net10.0` TFMs, and Xcode 26.6: | Command | Result | | --- | --- | | `dotnet test src/Controls/Foldable/test/Controls.Foldable.UnitTests.csproj --nologo --verbosity minimal` | Passed: 39, failed: 0, skipped: 0; rerun after formatting and normal restore. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios26.0 --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-maccatalyst26.0 --no-restore --nologo --verbosity minimal` | Passed: 0 warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-android36.0 --no-restore --nologo --verbosity minimal` | Passed: 3 Gradle Java 8 obsolescence warnings, 0 errors. | | `dotnet build src/Controls/Foldable/src/Controls.Foldable.csproj -f net10.0-ios27.1 -p:TargetFrameworks=net10.0-ios27.1 --nologo --verbosity minimal` | Blocked: NETSDK1140, local SDK supports iOS 26.0/26.5, not 27.1. | | `git diff --cached --check` | Passed. | | `git diff --check` | Passed. | Formatting command (passed; `changed_files` contains staged changed `.cs` paths): ```bash changed_files=() while IFS= read -r file; do changed_files+=("$file"); done < <(git diff --cached --name-only -- '*.cs') dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822 --include "${changed_files[@]}" --verbosity quiet ``` PowerShell syntax check (passed for all three source script files): ```powershell $files=@(".github/scripts/RunTests.ps1", ".github/scripts/shared/Detect-TestsInDiff.ps1", ".github/scripts/shared/Detect-TestsInDiff.Tests.ps1") foreach ($file in $files) { $tokens=$null; $errors=$null [System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PWD $file), [ref]$tokens, [ref]$errors) > $null if ($errors.Count) { $errors | Write-Error; exit 1 } Write-Output "Parsed $file" } ``` Build/test/format subprocesses ran with `GH_TOKEN`, `GITHUB_TOKEN`, and `COPILOT_GITHUB_TOKEN` removed from their environments. A `--no-restore` test attempt after the explicit 27.1 restore probe encountered changed assets; normal restore and the full 39-test rerun above succeeded. **Not run:** native iOS 27.1/Duo compilation or simulator/device runtime validation, sample app build/runtime validation, Windows validation, or pipeline Pester tests. No XCTest or host UI automation was used. Source PR validation is not claimed as a result of this backport. ### 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. --> Backport of [#38915](#38915); no separate issue. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741e14bf-fe5c-4150-857c-40b354de3403




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!
Description of Change
Adds first-class iPhone Duo support to
Microsoft.Maui.Controls.FoldablesoTwoPaneViewcan automatically split around an active iOS division reserved region. Queries and coordinate conversion are scoped to the observed native view and window, preserving correct behavior across windows and scenes instead of relying on global screen geometry.The implementation was originally staged behind a capability switch while the bindings from dotnet/macios#26705 were unreleased. Official Xcode 27.1 support is now available through workload set
10.0.402.1, includingMicrosoft.iOS.Sdk.net10.0_27.127.1.10018. The native path now enables automatically when the iOS target platform version is 27.1 or later;IosDuoBindingsAvailableremains available as an explicit build-graph override.Customer behavior
TwoPaneViewpane geometry.UIHingeInteractionsupplies hinge state and angle for interaction/effects only; angle is never used to guess layout geometry.Implementation
IFoldableServiceand tracks the relevant view/window/scene.UIView.GetReservedRegions(UIViewReservedRegionKind.CreateDivision())after the iOS 27.1 runtime guard.GetHingeAngleAsync()and refreshes state through the documented interaction enable cycle.DualScreenInfo.Currentto the last activated MAUI iOS scene/window, analogous to Android's resumed-activity behavior.WindowSpanModeStateTriggerfollow its attached visual element/window.TwoPaneView, element-scopedDualScreenInfo,DualScreenInfo.Current, and property-only state-trigger consumers remain synchronized.Compatibility
Validation
Official workload installation was isolated under session storage rather than changing the machine-global workload graph:
Build and test results:
Controls.Foldablenet10.0-ios27.1with the official bindings: succeeded, 0 errors. The newer SDK reports existing MAUI-wide nullability/obsoletion warnings outside this change.Controls.Foldablenet10.0-ios26.0: succeeded, 0 warnings, 0 errors.Controls.Foldablenet10.0-maccatalyst26.0: succeeded, 0 warnings, 0 errors.Controls.Foldablenet10.0-android36.0: succeeded, 0 warnings, 0 errors.net10.0-ios27.1/iossimulator-arm64: succeeded. The official SDK requires an invocation-only minimum deployment target override of iOS 15.0 on this branch.dotnet test src/Controls/Foldable/test/Controls.Foldable.UnitTests.csproj --no-restore --nologo --verbosity minimal: 32 passed, 0 failed.git diff --check: passed.Runtime validation used DevFlow from
dotnet/maui-labs, temporarily enabled only in the local Debug sample and removed before commit. The audit ran on an iOS 27.1 iPhone Duo simulator with the official stable workload:0°, responsive layout retained.128°,Mode: Wide, with two exact455.5-point panes separated by the40-point division region.180°, responsive layout restored.0/1,1/0, and0.25/0.75pane-length ratios.ModeChangedstatus, and both Reset buttons were exercised successfully.DualScreenInfodivision after Partially Open → Open. The shared delayed region refresh in this PR fixes the issue; the final build reportedDivision region: inactiveand180°live without restart.DualScreenInfo.Current, is coalesced, avoids unloaded elements, and leaves Android/Mac Catalyst behavior unchanged.Issues Fixed
N/A — implements iPhone Duo support enabled by dotnet/macios#26705.