Skip to content

[inflight/candidate][iOS] Fix ScrollView PageSheet detection without reverting the flicker fix - #39472

Merged
kubaflo merged 2 commits into
inflight/candidatefrom
kubaflo-ci-regression-fix
Oct 19, 2026
Merged

kubaflo merged 2 commits into
inflight/candidatefrom
kubaflo-ci-regression-fix

Conversation

@kubaflo

@kubaflo kubaflo commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Note

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

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 on main.

The previous detector treated any responder-chain controller with ModalPresentationStyle=PageSheet as 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 until MovedToWindow, although that state can change without a window move. Finally, putting the PageSheet exemption on the outer Automatic condition allowed exempt sheets to fall through to manual safe-area padding when their system-adjusted inset was zero.

The repair:

  • Checks the active modal root (ParentViewController == null, PresentingViewController != null) and its actual presentation style; unpresented and child-controller styles cannot masquerade as the modal presentation.
  • Does not retain a stale presentation-state cache. The responder chain is inspected only when an axis is near the safe-area threshold and would otherwise receive artificial content-size inflation, not on ordinary scroll frames.
  • Keeps Automatic handling in its own branch. Real PageSheets still skip artificial content-size inflation, without falling through into manual-padding logic.

The existing ScrollViewInitialOffsetInGridRow UI test is unchanged. Its Mac assertion already avoids Appium screen-coordinate comparisons and checks native inset-aware position and managed ScrollY. The reported state (offset=0, adjusted top 36, 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:

New native regression coverage and causal comparison:

Microsoft.Maui.DeviceTests.MauiScrollViewTests has 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 production MauiScrollView.LayoutSubviews content-size behavior, not source-text matching.

On iPhone 17e, iOS 26.5 CoreSimulator, with exactly the same test fixture:

Production source Repetitions Result per repetition
Original #39330 implementation 3 7 passed, 4 expected regression failures
Full revert 3 6 passed, 5 expected PageSheet failures
Targeted repair 3 11 passed, 0 failed

The trigger-removed control (same unpresented controller with FullScreen instead of PageSheet style) passed on every run. Original-code failures were stable: an ordinary PageSheet-style page incorrectly retained height 580 instead of receiving stabilization to 601; a presented sheet with zero system inset incorrectly received manual padding to 616 instead of remaining 580. The full revert incorrectly inflated actual PageSheet content to 601. 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.0 CLI target was used instead. The wrapper also expected an older testResults.xml filename, so the fresh xunit-test-*.xml files 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.

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
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 19, 2026 17:12 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 19, 2026 17:13 — with GitHub Actions Inactive
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 19, 2026 17:14 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 19, 2026 17:16 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 19, 2026 17:17 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 19, 2026 17:18 — with GitHub Actions Inactive
@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 19, 2026
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
@kubaflo kubaflo changed the title [inflight/candidate] Revert PageSheet ScrollView offset regression [inflight/candidate][iOS] Fix ScrollView PageSheet detection without reverting the flicker fix Oct 19, 2026
@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

1 similar comment
@azure-pipelines

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

/review gate was not started: another review or Gate is already running for this PR.

This command is not queued. Submit it again after the current run finishes.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

kubaflo commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

CI now confirms the targeted repair on head 924e4662da:

  • The formerly failing Mac AsyncContentUnderTheBar test passed, reporting ContentOffset.Y=-36, AdjustedContentInset.Top=36, and ScrollY=0. All five initial-offset cases passed; the full Mac ScrollView category finished with 169 passed, 1 skipped. UI build 1640854, log 5509.
  • All 11 new MauiScrollViewTests cases passed in actual result XML on iOS 18.1/macOS 15, MacCatalyst/macOS 15, and MacCatalyst/macOS 26, including native PageSheet and FullScreen presentations. iOS results, macOS 15 results, macOS 26 results.

The overall checks are not yet green. The first main build failed during dotnet workload install tvos with a null-reference error, before compiling the changed source; retry 1640976 is running. UI/device validation still has other work in progress, and Android UI failures are being kept separate from this iOS-only implementation change. Continuous completion watches remain active.

@kubaflo

kubaflo commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Device validation is now complete: maui-pr-devicetests 1640855 succeeded for head 924e4662da.

Verified the actual Helix results, not just wrapper status: all 11 new MauiScrollViewTests passed on iOS 18.1, iOS 26.0, MacCatalyst/macOS 15, and MacCatalyst/macOS 26. This includes real PageSheet and FullScreen presentation cases. The final iOS 26 result XML contains all 11 passing cases. Remaining Windows and Android Helix work items also finished with exit code 0.

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.

@github-actions

Copy link
Copy Markdown
Contributor

/review gate was not started: another review or Gate is already running for this PR.

This command is not queued. Submit it again after the current run finishes.

@kubaflo
kubaflo merged commit 8131e36 into inflight/candidate Oct 19, 2026
167 of 207 checks passed
@kubaflo
kubaflo deleted the kubaflo-ci-regression-fix branch October 19, 2026 19:55
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Oct 19, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-scrollview ScrollView platform/ios s/agent-review-in-progress AI review is currently running for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant