Repository navigation
[inflight/candidate][iOS] Fix ScrollView PageSheet detection without reverting the flicker fix - #39472
Conversation
Revert #39330 (f0e88b4), which disabled automatic inset stabilization and regressed AsyncContentUnderTheBar on MacCatalyst. Restore the implementation proven by the passing revert experiment #39401, retaining only normalized documentation indentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b60cc75-5f0e-4d39-a325-ef73b2fada65
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Replace the rollback with a targeted repair: ignore unpresented and child-controller styles, evaluate modal presentation state without a stale window-lifetime cache, and keep Automatic out of the manual-inset fallback. Only inspect the responder chain when safe-area stabilization would otherwise inflate the content. Add native xUnit coverage for ordinary pages, modal and child controller styles, presentation transitions, manual-padding fallthrough, and actual UIKit PageSheet/FullScreen presentations. Original code fails 4 cases on each of 3 runs; the full revert fails 5 cases on each of 3 runs; the repair passes all 11 cases on each of 3 runs on iPhone 17e/iOS 26.5. Existing UI assertions are unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b60cc75-5f0e-4d39-a325-ef73b2fada65
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.
1 similar comment
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.
|
CI now confirms the targeted repair on head
The overall checks are not yet green. The first main build failed during |
|
Device validation is now complete: maui-pr-devicetests 1640855 succeeded for head Verified the actual Helix results, not just wrapper status: all 11 new No device-CI fix is needed. Main-build retry and overall UI pipeline remain under observation; this is not a claim that all PR checks are green. |
|
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
This PR now contains a targeted repair, not a revert. The initial rollback remains in commit history, followed by a regular commit restoring the PageSheet flicker protection with corrected detection. Review the aggregate diff against
inflight/candidate.Intentionally targets
inflight/candidate, the source branch of the reported failure. #39330, the backport of #39219, is not onmain.The previous detector treated any responder-chain controller with
ModalPresentationStyle=PageSheetas an active sheet, even when it was not presented or was only a child controller. That could disable automatic safe-area stabilization on ordinary pages. It also cached presentation state untilMovedToWindow, although that state can change without a window move. Finally, putting the PageSheet exemption on the outerAutomaticcondition allowed exempt sheets to fall through to manual safe-area padding when their system-adjusted inset was zero.The repair:
ParentViewController == null,PresentingViewController != null) and its actual presentation style; unpresented and child-controller styles cannot masquerade as the modal presentation.Automatichandling in its own branch. Real PageSheets still skip artificial content-size inflation, without falling through into manual-padding logic.The existing
ScrollViewInitialOffsetInGridRowUI test is unchanged. Its Mac assertion already avoids Appium screen-coordinate comparisons and checks native inset-aware position and managedScrollY. The reported state (offset=0, adjusted top36,ScrollY=36) is an unwanted initial scroll, not a desktop-coordinate mismatch. This PR preserves the PageSheet behavior intended for #38272 rather than accepting the tradeoff of a complete revert.Original CI evidence:
AsyncContentUnderTheBartwice withoffset=-36, adjusted top36,ScrollY=0.New native regression coverage and causal comparison:
Microsoft.Maui.DeviceTests.MauiScrollViewTestshas 11 cases covering unpresented PageSheet-style controllers, real presented sheets, zero/nonzero adjusted inset, full-screen/automatic styles, child-controller styles, presentation transitions without a window move, and actual UIKit PageSheet and FullScreen presentations. Assertions exercise the productionMauiScrollView.LayoutSubviewscontent-size behavior, not source-text matching.On iPhone 17e, iOS 26.5 CoreSimulator, with exactly the same test fixture:
The trigger-removed control (same unpresented controller with
FullScreeninstead ofPageSheetstyle) passed on every run. Original-code failures were stable: an ordinary PageSheet-style page incorrectly retained height580instead of receiving stabilization to601; a presented sheet with zero system inset incorrectly received manual padding to616instead of remaining580. The full revert incorrectly inflated actual PageSheet content to601. The repair satisfies both requirements.Commands and results:
dotnet build Microsoft.Maui.BuildTasks.slnf -p:TreatWarningsAsErrors=false -v:quiet— passed; 3 existing Gradle Java 8 deprecation warnings.dotnet build src/Core/tests/DeviceTests/Core.DeviceTests.csproj -c Debug -f net10.0-ios -r iossimulator-arm64 -p:TreatWarningsAsErrors=false -p:CodesignRequireProvisioningProfile=false -v:quiet— passed on final source, 0 warnings and 0 errors.dotnet <nuget-cache>/microsoft.dotnet.xharness.cli/11.0.0-prerelease.26506.1/tools/net10.0/any/Microsoft.DotNet.XHarness.CLI.dll apple test --app artifacts/bin/Core.DeviceTests/Debug/net10.0-ios/iossimulator-arm64/Microsoft.Maui.Core.DeviceTests.app --target ios-simulator-64_26.5 --device EC2DD435-0C77-4AFF-9D99-65D757FB87C7 -o <unique-output-directory> --timeout 00:05:00 --set-env=NUNIT_SKIPPED_CLASSES=Microsoft.Maui.DeviceTests.MauiScrollViewTests— final repair passed 11/11 on each of 3 runs; control-source results are listed above. Each fresh xUnit XML was checked for the exact fixture, all 11 expected cases, outcomes, and absence of unrelated executed tests.dotnet format Microsoft.Maui.sln --no-restore --include src/Core/src/Platform/iOS/MauiScrollView.cs src/Core/tests/DeviceTests/Platform/iOS/MauiScrollViewTests.iOS.cs --exclude Templates/src --exclude-diagnostics CA1822 --verify-no-changes --verbosity quiet— passed.git diff --cached --check— passed before commit.The repository wrapper initially could not run because its pinned XHarness selected an unavailable .NET 11 RC runtime; the same pinned package's supported
net10.0CLI target was used instead. The wrapper also expected an oldertestResults.xmlfilename, so the freshxunit-test-*.xmlfiles were read directly; no failed wrapper invocation is reported as a passing test run.No XCTest, Appium, or host MacCatalyst UI automation was run locally. The new native tests verify the stabilization mechanism and real modal presentation boundaries; they do not claim a replay of the original drag/flicker gesture. Fresh macOS 14/15 CI must still confirm the original Mac UI failure is resolved by this final repair.
Issues Fixed
Fixes the regression introduced by #39330 demonstrated in build 1639699, while retaining the PageSheet protection for #38272.
Supersedes the rollback approach explored in the closed testing-only PR #39401.