Skip to content

[MacCatalyst] Fix Retina display metrics and support ACES Tahoe UI tests - #39884

Closed
kubaflo wants to merge 4 commits into
mainfrom
kubaflo-catalyst-retina-display-metrics
Closed

kubaflo wants to merge 4 commits into
mainfrom
kubaflo-catalyst-retina-display-metrics

Conversation

@kubaflo

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

Draft: final-head runtime validation is pending. The ACES Tahoe migration is not green; upstream-owned and native/visual blockers remain strict failures.

This follow-up to #39876 keeps the necessary changes in separate normal commits:

Commit Change
7e2520d15d625c36c4891456dbccf13c02d1bf13 MacCatalyst DisplayInfo.Width/Height use physical CoreGraphics pixel dimensions, not logical display-mode size. Density, notifications/lifetime, rotation, orientation, fallback, iOS behavior and public API are unchanged.
f078c78439fe826a290e672e8d4f49cbcb7cf218 Semantic Stepper action identifiers, typed Mac2 target re-acquisition/native-coordinate recovery, bounded stale retry, and final alert-continuation readiness.
24dee490e5105e13987025d3568aaf55c619db75 Share repaired mouse recovery with query taps, use recorded native Shell back/search targets, preserve exact command assertions, and close flyout state even when its strict screenshot assertion fails.
bd36cf7f6fee9b2f9f05e9f83191466e433ef767 508 reviewed mac-26 native-design overrides, OS26-only per-file dispatch, and density-correct window-relative color sampling.

Every existing snapshots/mac image remains byte-for-byte unchanged. Missing Tahoe overrides fall back to the shared legacy image; a failed comparison never falls back. Comparator tolerances are unchanged. All41 rejected/held cases in the reviewed549-image batch deliberately lack overrides, including lost explicit colors, clipping, incorrect sizing/state and unexplained swipe counts. Further unreviewed differences also remain strict failures. No unsupported SDK27 compatibility plist switch is used.

The pixel-dimension defect was exposed by the pool-only build1663563, source d26ceeea2bdbd7bce1b44a95ceb2fc3356cc3b8d, on AcesShared103. Raw log709 reports window pixels (-384,60,1578,1184) outside the 2560x1600 screenshot. Returning logical width1280 with density2 made HostApp calculate width640 and X=-192. The existing crop code already handles Retina density for an on-screen window; no geometry mismatch is hidden with new baselines.

Validation evidence:

  • Native read-only CoreGraphics probe passed: logical1512x982 versus pixel3024x1964; both replacement symbols resolve.
  • Exact pixel-fix commit 7e2520...: build1663677 successfully compiled Essentials for net11.0-maccatalyst27.0 and net11.0-ios27.0, plus both Mac HostApp architectures (raw build log33). Actual Tahoe Accessibility run46328902 has17 passed,3 same-size native-design visual failures,1 skipped: every ActionSheet click, including destroy, passes and raw log714 has no crop fallback. The four original failing cases all passed in hosted baseline1662220/run46289978. The complete initial matrix is still being collected; it is not green.
  • dotnet build src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj -p:MauiPlatforms= -v quiet: passed on the final owned sources,0 warnings/errors. This compiles the test/helper graph without running host UI automation.
  • Actual modified helpers passed deterministic fake-Mac2 protocol scenarios for semantic Stepper selection, stale target recovery, native mouse coordinates, query taps, custom-image back targets and search-result input. Recorded-tree selectors and completed command/readiness states were checked against actual CI attachments. These are scoped helper checks, not a substitute for remote native execution.
  • The unchanged real Magick comparator matched all508 reviewed overrides against their actual attachment bytes and still rejected all41 held cases against legacy expectations. Git confirms no legacy Mac baseline changes. Scoped formatter and git diff --check passed.
  • Final owned head bd36cf7f6fee9b2f9f05e9f83191466e433ef767: full30-shard ACES MacCatalyst build1663911 is queued/running. Its resources pin that exact SHA. Actual test results and raw Azure logs will determine the final verdict; missing/canceled results are never passes. No local host macOS XCTest or physical Apple devices were used.

Known external boundaries: the10000-point horizontal CollectionView height is the exact expanded-frame/cross-axis defect already owned by #39778; its local duplicate candidate was removed. The separate #39882 controller-sizing fix is not duplicated. Actual native trees also show three missing custom-menu cases and two startup-navigation cases needing further native evidence. Those and rejected visual semantics remain blockers, not relaxed assertions or copied expectations. No merge is authorized.

Issues Fixed

Fixes the Retina display-dimension blocker exposed by #39876 and bounded, evidenced Tahoe/Mac2 test-helper incompatibilities. No separate issue is filed. Exact-mechanism searches found introducing #31786 and unrelated iOS-only #39879, but no duplicate pixel-API fix.

The user-closed release backport #39885 is not being reopened or replaced.

Use Core Graphics pixel dimensions instead of logical display-mode dimensions so DisplayInfo.Width and Height remain consistent with Density on Retina displays. Preserve the existing Catalyst display notifications and all other metrics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bfecc805-583f-4f98-9d19-cfaa5a8b4013
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 4, 2026 11:01 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39884

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39884"

@azure-pipelines

This comment has been minimized.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 4, 2026 11:02 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 4, 2026 11:03 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 4, 2026 11:04 — with GitHub Actions Inactive
kubaflo added a commit that referenced this pull request Nov 4, 2026
…ina screens

Backport the tightly coupled blocker correction from unmerged follow-up #39884, commit 7e2520d. This separate correction is not part of merged pool-migration PR #39876. Keep the release PR draft pending exact-head runtime validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9bd14d38-bcb0-40ba-a931-521a861ebd4b
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 4, 2026 11:06 — with GitHub Actions Inactive
@github-actions github-actions Bot added area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/ios platform/macos macOS / Mac Catalyst labels Nov 4, 2026
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 4, 2026 11:06 — with GitHub Actions Inactive
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Use semantic Stepper action identifiers instead of assuming accessibility child order. Recover Mac click targets through their identifiers and unwrap driver elements correctly; use native Mac element-center coordinates instead of the Windows-only ClickablePoint attribute, with a bounded stale-target retry. Wait for the final alert continuation before asserting its status.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bfecc805-583f-4f98-9d19-cfaa5a8b4013
@kubaflo kubaflo changed the title [MacCatalyst] Report physical display pixels on Retina screens [MacCatalyst] Fix Retina display metrics and support ACES Tahoe UI tests Nov 4, 2026
kubaflo and others added 2 commits November 4, 2026 14:31
Route Catalyst query taps through the validated mouse recovery path, select native image-back and search-result targets from recorded accessibility evidence, wait for completed search command state, and close flyout state even when its strict screenshot assertion fails. Keep native menu and startup-navigation blockers visible.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bfecc805-583f-4f98-9d19-cfaa5a8b4013
Add 508 individually reviewed macOS26-only native-design expectations. Preserve all legacy Mac snapshot bytes, retain 41 rejected or uncertain cases as strict legacy comparisons, and do not change comparator tolerances. Fall back only when a per-file Tahoe override is absent, never when comparison fails. Reuse density-normalized window capture for the Retina color oracle and preserve iOS coordinate conversion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bfecc805-583f-4f98-9d19-cfaa5a8b4013
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

kubaflo commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

#39912

@kubaflo kubaflo closed this Nov 6, 2026
kubaflo added a commit that referenced this pull request Nov 6, 2026
…-DPI) displays (#39912)

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

Improves Mac Catalyst UI test reliability on macOS Tahoe and updates
visual baselines for its native appearance.

Retina display metrics: Report physical pixel dimensions through Core
Graphics, keeping display width and height consistent with density.
Stepper interaction: Prefer increment/decrement accessibility
identifiers instead of relying on native child order.
Mouse and tap recovery: Reacquire failed Mac click targets by
accessibility identifier, unwrap driver elements correctly, and use
element-center coordinates for mouse fallback. Add a bounded
stale-element retry for Catalyst string taps.
Catalyst query taps: Route element/query taps through mouse recovery
while preserving right-click behavior.
Shell navigation: Improve targeting of image-overridden back buttons,
intermediate-page back buttons, and search results on Tahoe.

#### Test synchronization: 
Wait for completed search commands and the final alert continuation
before asserting.
Flyout cleanup: Close the flyout even when screenshot verification
fails.
Screenshot baselines: Replace 508 images in the existing Mac snapshot
folder. No separate macOS-version snapshot routing or
comparison-tolerance changes are introduced.
Rendered-color verification: Reuse the density-normalized, app-window
screenshot for #37427 and translate desktop coordinates into
window-relative coordinates. Make the screenshot helper protected for
reuse.
### Validation

dotnet build src/Essentials/src/Essentials.csproj -f
net11.0-maccatalyst27.0 --no-restore -v minimal — passed.
dotnet build src/TestUtils/src/UITest.Appium/UITest.Appium.csproj
--no-restore -v minimal — passed.
All 508 replacement PNGs verified byte-for-byte against the source
commit.
Imported patches and whitespace checks passed.
UI tests were not run; the final screenshot-test changes have not been
build-validated.


Follow up to this #39876

## pending

Need to add image screenshot of Mac from CI for Layout category 

Duplicate #39884

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: NafeelaNazhir <nafeela.nazhirhussain@syncfusion.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/ios platform/macos macOS / Mac Catalyst

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant