[CV2][iOS] Fix MeasureFirstItem measuring non-first cells - #36159
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36159Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36159" |
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Optimizes CollectionView2 (Items2 handler) on iOS/MacCatalyst for ItemSizingStrategy.MeasureFirstItem by avoiding unnecessary per-cell Measure() calls when a recycled cell is re-laid out under unchanged constraints. Adds an Issue/UITest pair to detect regressions by counting “cached-height non-first” measurements.
Changes:
- Skip
virtualView.Measure(...)in the cached-first-item path when_cachedConstraintsmatch the current constraints (reduces scroll-time measurement work). - Add a HostApp Issue35859 page that probes/records item-template measurement constraints and summarizes “cached-height non-first” counts.
- Add an accompanying UITest asserting the “cached-height non-first” count remains 0.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cs | Adds a constraints-based guard to avoid calling Measure() for cached-size recycled cells when constraints are unchanged. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue35859.cs | Adds a probe page + registry to record and summarize measurement behavior for MeasureFirstItem on CV2. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35859.cs | Adds a UI test validating non-first cells are not measured using the cached first-item height path. |
| @@ -0,0 +1,32 @@ | |||
| #if TEST_FAILS_ON_WINDOWS || TEST_FAILS_ON_ANDROID // This test is specific to iOS/macOS CollectionView handler behavior. | |||
| App.WaitForElement("35859ResetButton"); | ||
| App.Tap("35859ResetButton"); | ||
|
|
||
| App.WaitForElement("35859ScrollTo40Button"); | ||
| App.Tap("35859ScrollTo40Button"); | ||
|
|
||
| var summary = App.WaitForElement("35859Summary").GetText(); | ||
| Assert.That(summary, Does.Contain("Items2 CV2: 0 cached-height non-first")); | ||
|
|
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
| @@ -0,0 +1,32 @@ | |||
| #if TEST_FAILS_ON_WINDOWS || TEST_FAILS_ON_ANDROID // This test is specific to iOS/macOS CollectionView handler behavior. | |||
There was a problem hiding this comment.
[major] Regression Prevention / Platform Scoping — Platform guard uses || instead of &&. With #if TEST_FAILS_ON_WINDOWS || TEST_FAILS_ON_ANDROID, the condition is true (and the test compiles in) whenever either symbol is defined — that means the test runs on Android (TEST_FAILS_ON_ANDROID defined → true) and on Windows (TEST_FAILS_ON_WINDOWS defined → true), the opposite of the intent. The established pattern across the repo (Issue31377.cs, Issue21886.cs, Issue28416.cs) is &&: #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID // iOS/MacCatalyst-specific CV2 handler behavior
| App.WaitForElement("35859ScrollTo40Button"); | ||
| App.Tap("35859ScrollTo40Button"); | ||
|
|
||
| var summary = App.WaitForElement("35859Summary").GetText(); |
There was a problem hiding this comment.
[major] Regression Prevention — Flaky Assertion — App.WaitForElement("35859Summary").GetText() only waits for the element to exist (it already does from page load). After tapping 35859ScrollTo40Button, measurement recording fires asynchronously and then Dispatcher.Dispatch(UpdateSummary) updates the label text; reading .GetText() immediately can return the pre-scroll text, making the assertion pass spuriously or fail intermittently. Use App.WaitForTextToBePresentInElement("35859Summary", "Items2 CV2: 0 cached-height non-first") to block until the expected value appears:
App.WaitForTextToBePresentInElement("35859Summary", "Items2 CV2: 0 cached-height non-first");
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@devanathan-vaithiyanathan — new AI review results are available based on this last commit:
c282818. To request a fresh review after new comments or commits, comment/review rerun.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ✅ PASSED
Platform: IOS · Base: main · Merge base: 2a323a50
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue35859 Issue35859 |
✅ FAIL — 276s | ✅ PASS — 108s |
🔴 Without fix — 🖥️ Issue35859: FAIL ✅ · 276s
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 624 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 631 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 4.97 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 5.95 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 5.95 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 5.95 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 5.95 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 5.97 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 5.95 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 5.97 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/maps/src/Maps.csproj (in 5.97 sec).
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-ios26.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-ios26.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-ios26.0/Microsoft.Maui.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Maps.dll
Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Microsoft.AspNetCore.Components.WebView.Maui -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-ios26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Maps.dll
Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Foldable.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Xaml.dll
Detected signing identity:
Code Signing Key: "" (-)
Provisioning Profile: "" () - no entitlements
Bundle Id: com.microsoft.maui.uitests
App Id: com.microsoft.maui.uitests
Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-arm64/Controls.TestCases.HostApp.dll
Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
Optimizing assemblies for size. This process might take a while.
Build succeeded.
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
1 Warning(s)
0 Error(s)
Time Elapsed 00:02:28.42
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 747 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 747 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 747 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 747 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 752 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 754 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 811 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 428 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 1.32 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 1.85 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 2.43 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 3.28 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj (in 4.09 sec).
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Controls.CustomAttributes -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
VisualTestUtils -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
VisualTestUtils.MagickNet -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.NUnit -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
UITest.Appium -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
UITest.Analyzers -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.iOS.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (arm64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.06] Discovering: Controls.TestCases.iOS.Tests
[xUnit.net 00:00:00.17] Discovered: Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 6/27/2026 10:48:25 AM FixtureSetup for Issue35859(iOS)
>>>>> 6/27/2026 10:48:30 AM CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight Start
>>>>> 6/27/2026 10:48:32 AM CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight Stop
>>>>> 6/27/2026 10:48:32 AM Log types: syslog, crashlog, performance, safariConsole, safariNetwork, server
Failed CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight [3 s]
Error Message:
Assert.That(summary, Does.Contain("Items2 CV2: 0 cached-height non-first"))
Expected: String containing "Items2 CV2: 0 cached-height non-first"
But was: "Items2 CV2: 35 cached-height non-first"
Stack Trace:
at Microsoft.Maui.TestCases.Tests.Issues.Issue35859.CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35859.cs:line 28
1) at Microsoft.Maui.TestCases.Tests.Issues.Issue35859.CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35859.cs:line 28
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35859.trx
Test Run Failed.
Total tests: 1
Failed: 1
Total time: 1.3302 Minutes
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35859.trx
🟢 With fix — 🖥️ Issue35859: PASS ✅ · 108s
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 358 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 380 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 381 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 427 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 441 ms).
6 of 11 projects are up-to-date for restore.
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-ios26.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-ios26.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-ios26.0/Microsoft.Maui.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Maps.dll
Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Microsoft.AspNetCore.Components.WebView.Maui -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-ios26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Foldable.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Xaml.dll
Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Maps.dll
Detected signing identity:
Code Signing Key: "" (-)
Provisioning Profile: "" () - no entitlements
Bundle Id: com.microsoft.maui.uitests
App Id: com.microsoft.maui.uitests
Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-arm64/Controls.TestCases.HostApp.dll
Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
Optimizing assemblies for size. This process might take a while.
Build succeeded.
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
1 Warning(s)
0 Error(s)
Time Elapsed 00:00:54.06
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 441 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 441 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 441 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 445 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 459 ms).
8 of 13 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
Controls.CustomAttributes -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14508499
Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
VisualTestUtils -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
UITest.Appium -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
UITest.NUnit -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
VisualTestUtils.MagickNet -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.Analyzers -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.iOS.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (arm64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.05] Discovering: Controls.TestCases.iOS.Tests
[xUnit.net 00:00:00.18] Discovered: Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 6/27/2026 10:50:15 AM FixtureSetup for Issue35859(iOS)
>>>>> 6/27/2026 10:50:19 AM CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight Start
>>>>> 6/27/2026 10:50:21 AM CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight Stop
Passed CollectionView2ShouldNotMeasureNonFirstItemsWithCachedFirstItemHeight [2 s]
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35859.trx
Test Run Successful.
Total tests: 1
Passed: 1
Total time: 24.2083 Seconds
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue35859.trx
📁 Fix files reverted (1 files)
src/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cs
📱 UI Tests — CollectionView
Detected UI test categories: CollectionView
❌ Deep UI tests — 332 passed, 86 failed across 1 category on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
CollectionView |
332/421 (86 ❌) | 168 diff PNGs |
❌ CollectionView — 86 failed tests
HeaderFooterGridWorks
System.InvalidOperationException :
Snapshot different than baseline: HeaderFooterGridWorks.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: HeaderFooterGridWorks.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download
...
Issue17400Test
System.InvalidOperationException :
Snapshot different than baseline: Issue17400Test.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: Issue17400Test.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build arti
...
VerifyCollectionViewItemsAfterScrolling
System.InvalidOperationException :
Snapshot different than baseline: VerifyCollectionViewItemsAfterScrolling.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyCollectionViewItemsAfterScrolling.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline ima
...
CollectionviewFooterHideswhenDynamicallyAddorRemoveItems
System.InvalidOperationException :
Snapshot different than baseline: CollectionviewFooterHideswhenDynamicallyAddorRemoveItems.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: CollectionviewFooterHideswhenDynamicallyAddorRemoveItems.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a
...
FlowdirectionShouldWorkForHeaderFooter
System.InvalidOperationException :
Snapshot different than baseline: FlowdirectionShouldWorkForHeaderFooter.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: FlowdirectionShouldWorkForHeaderFooter.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image
...
EmptyViewShouldRemeasureWhenParentLayoutChanges
System.InvalidOperationException :
Snapshot different than baseline: EmptyViewShouldRemeasureWhenParentLayoutChanges.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: EmptyViewShouldRemeasureWhenParentLayoutChanges.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update
...
VerifyFlowDirectionRTLAndMeasureAllItemsWithGroupedList
System.InvalidOperationException :
Snapshot different than baseline: VerifyFlowDirectionRTLAndMeasureAllItemsWithGroupedList.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyFlowDirectionRTLAndMeasureAllItemsWithGroupedList.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bu
...
VerifyCollectionViewEmptyView
System.InvalidOperationException :
Snapshot different than baseline: VerifyCollectionViewEmptyView.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyCollectionViewEmptyView.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachm
...
Issue18751Test
System.InvalidOperationException :
Snapshot different than baseline: Issue18751Test.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: Issue18751Test.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build arti
...
VerifyScrollToByIndexWithEndPositionAndVerticalList_Carrot
System.InvalidOperationException :
Snapshot different than baseline: VerifyScrollToByIndexWithEndPositionAndVerticalList_Carrot.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyScrollToByIndexWithEndPositionAndVerticalList_Carrot.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't
...
GroupedCollectionViewItems
System.InvalidOperationException :
Snapshot different than baseline: GroupedCollectionViewItems.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: GroupedCollectionViewItems.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or
...
CollectionViewShouldChangeItemsLayout
System.InvalidOperationException :
Snapshot different than baseline: CollectionViewShouldChangeItemsLayout.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: CollectionViewShouldChangeItemsLayout.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
...
RefreshShouldNotChangeSize
System.InvalidOperationException :
Snapshot different than baseline: RefreshShouldNotChangeSize.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: RefreshShouldNotChangeSize.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or
...
SelectedItemVisualIsCleared
System.InvalidOperationException :
Snapshot different than baseline: SelectedItemVisualIsCleared.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: SelectedItemVisualIsCleared.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment
...
VerifyFlowDirectionLTRAndMeasureAllItemsWithGroupedList
System.InvalidOperationException :
Snapshot different than baseline: VerifyFlowDirectionLTRAndMeasureAllItemsWithGroupedList.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyFlowDirectionLTRAndMeasureAllItemsWithGroupedList.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bu
...
CellLayoutUpdatesCorrectlyAfterDeviceOrientationChanges
System.InvalidOperationException :
Snapshot different than baseline: Issue28657_Landscape.png (size differs - baseline is 2436x974 pixels, actual is 2622x1056 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: Issue28657_Landscape.png (size differs - baseline is 2436x974 pixels, actual is 2622x1056 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the
...
VerifyScrollToByIndexWithCenterPositionAndVerticalList_Carrot
System.InvalidOperationException :
Snapshot different than baseline: VerifyScrollToByIndexWithCenterPositionAndVerticalList_Carrot.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyScrollToByIndexWithCenterPositionAndVerticalList_Carrot.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this
...
BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount
System.InvalidOperationException :
Snapshot different than baseline: BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baselin
...
VerifySelectionModeMultipleWhenProgrammaticSelectionWorksWithVerticalList
System.InvalidOperationException : Unable to extract difference percentage from exception message.
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 296
at Microsoft.Maui.TestCases.Tests.CollectionView_SelectionFeatureTests.VerifySelectionModeMultipleWhenProgrammaticSelectionWorksWithVerticalList() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_SelectionFeatureTests.cs:line 533
at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
at System.Reflection.MethodBase
...
CollectionViewSelectionModeOnDarkTheme
System.InvalidOperationException :
Snapshot different than baseline: CollectionViewSelectionModeOnDarkTheme.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: CollectionViewSelectionModeOnDarkTheme.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image
...
CVHorizontalLinearItemsLayoutItemSpacing
System.InvalidOperationException :
Snapshot different than baseline: CVHorizontalLinearItemsLayoutItemSpacing.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: CVHorizontalLinearItemsLayoutItemSpacing.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline i
...
VerifyCustomEmptyViewDisplaysCorrectly_WithRightToLeftFlowDirection
System.InvalidOperationException :
Snapshot different than baseline: VerifyCustomEmptyViewDisplaysCorrectly_WithRightToLeftFlowDirection.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyCustomEmptyViewDisplaysCorrectly_WithRightToLeftFlowDirection.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has ch
...
CollectionViewHorizontalItemSpacing
System.InvalidOperationException :
Snapshot different than baseline: CollectionViewHorizontalItemSpacing.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: CollectionViewHorizontalItemSpacing.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See
...
CollectionViewSelectedItemBackgroundShouldPersistAfterModalNavigation
System.InvalidOperationException :
Snapshot different than baseline: CollectionViewSelectedItemBackgroundShouldPersistAfterModalNavigation.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: CollectionViewSelectedItemBackgroundShouldPersistAfterModalNavigation.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline ha
...
VerifyScrollToByItemWithEndPositionAndVerticalList_Carrot
System.InvalidOperationException :
Snapshot different than baseline: VerifyScrollToByItemWithEndPositionAndVerticalList_Carrot.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyScrollToByItemWithEndPositionAndVerticalList_Carrot.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a
...
RemoveEmptyViewAtRuntime
System.InvalidOperationException :
Snapshot different than baseline: RemoveEmptyViewAtRuntime.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: RemoveEmptyViewAtRuntime.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or dow
...
CollectionViewHeightIsCorrectAfterDelayedLoad
System.InvalidOperationException : Unable to extract difference percentage from exception message.
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 296
at Microsoft.Maui.TestCases.Tests.Issues.Issue34336.CollectionViewHeightIsCorrectAfterDelayedLoad() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34336.cs:line 29
at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflectio
...
RightToLeftFlowDirectionShouldWork
System.InvalidOperationException :
Snapshot different than baseline: RightToLeftFlowDirectionShouldWork.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: RightToLeftFlowDirectionShouldWork.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See te
...
CollectionViewHeaderBlankWhenLastItemRemoved
System.InvalidOperationException :
Snapshot different than baseline: CollectionViewHeaderBlankWhenLastItemRemoved.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: CollectionViewHeaderBlankWhenLastItemRemoved.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the ba
...
FooterShouldBeRemovedWhenSetToNull
System.InvalidOperationException :
Snapshot different than baseline: FooterShouldBeRemovedWhenSetToNull.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
iOS 26 visual tests require an iPhone 11 Pro simulator for correct screen resolution.
To create the simulator, run:
xcrun simctl create "iPhone 11 Pro" com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-0
Then run the tests targeting the new simulator.
----> VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: FooterShouldBeRemovedWhenSetToNull.png (size differs - baseline is 1124x2286 pixels, actual is 1206x2472 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See te
...
(+56 more — see TRX in artifact)
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)
📋 Pre-Flight — Context & Validation
Issue: #35859 - CollectionView2 on iOS measures non-first cells despite ItemSizingStrategy.MeasureFirstItem, causing extra scroll work
PR: #36159 - [CV2][iOS] Fix MeasureFirstItem measuring non-first cells
Platforms Affected: iOS, MacCatalyst
Files Changed: 1 implementation, 2 test
Key Findings
- The issue reproduces in CV2 iOS/MacCatalyst, not CV1: non-first cells under
ItemSizingStrategy.MeasureFirstItemstill invoke templateMeasureOverridewhile scrolling. - The PR changes
TemplatedCell2.PreferredLayoutAttributesFittingAttributesso cached first-item size is reused andvirtualView.Measure()is skipped when constraints have not changed. - Gate was already completed before this run: Issue35859 failed without the fix and passed with the PR fix on iOS.
- PR discussion has two inline review findings on the UITest: platform guard uses
||instead of&&, and assertion reads asynchronously updated summary text immediately. - Impacted UI test category:
CollectionView.
Code Review Summary
Verdict: NEEDS_CHANGES
Confidence: medium
Errors: 1 | Warnings: 1 | Suggestions: 1
Key code review findings:
- ✗
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35859.cs:1— iOS/MacCatalyst-specific test guard usesTEST_FAILS_ON_WINDOWS || TEST_FAILS_ON_ANDROID; this compiles/runs on unintended platforms. Existing platform-exclusion pattern should use&&. - ⚠
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35859.cs:27— test reads35859Summaryimmediately after a dispatcher-scheduled update; should wait for the expected text to avoid stale/flaky reads. - ℹ
src/Controls/src/Core/Handlers/Items2/CollectionViewHandler2.iOS.cs:38— handler first-item cache is reset by reload, but cache invalidation remains a key edge case for source/strategy/dimension changes.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #36159 | Reuse cached first-item size and call Measure() only when per-cell constraints changed. |
✅ PASSED (Gate) | TemplatedCell2.cs, Issue35859 test files |
Original PR; sound core fix, test issues remain. |
🔬 Code Review — Deep Analysis
Code Review — PR #36159
Independent Assessment
What this changes: TemplatedCell2.PreferredLayoutAttributesFittingAttributes now reuses the cached first-item size under MeasureFirstItem and skips virtualView.Measure() for recycled cells when constraints are unchanged. The PR also adds a HostApp probe page and an Appium UITest for issue #35859.
Inferred motivation: Avoid repeated item-template measurement during CV2 iOS/MacCatalyst scrolling when ItemSizingStrategy.MeasureFirstItem should reuse the first measured cell size.
Reconciliation with PR Narrative
Author claims: CV2 on iOS was still calling MeasureOverride on every non-first cell through the cached-height path, and the fix skips Measure() when constraints have not changed.
Agreement/disagreement: The implementation matches the claim and mirrors the CV1 idea that constrained/cached sizes do not require full virtual-view measurement in the steady-state scroll path. The PR description does not call out that constraint-change paths still call Measure(constraints.Width, constraints.Height) and discard the result.
Prior Review Reconciliation
| Prior ❌ Error Finding | Source | Status | Evidence |
|---|---|---|---|
| UITest guard uses ` | ` and therefore runs on unintended platforms | Copilot inline review | |
| UITest reads summary before async dispatcher update completes | Copilot inline review | ❌ Unresolved | Issue35859.cs:27 reads App.WaitForElement("35859Summary").GetText() immediately after tapping. |
Blast Radius Assessment
- Runs for all instances: No. The implementation path is limited to Items2 iOS/MacCatalyst item cells with a non-empty cached first-item size and
MeasureFirstItem. - Startup impact: No. Code runs during UICollectionView layout/self-sizing.
- Static/shared state: No new static state; handler cache is instance state.
CI Status
- Required-check result: GitHub CLI was unauthenticated in this environment; gate output from the prior step was used for local evidence.
- Classification: Gate passed for the relevant iOS Issue35859 regression.
- Action taken: Recorded CI/query limitation; confidence capped at medium due to platform handler hot-path changes.
Findings
❌ Error — UITest preprocessor guard includes unintended platforms
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35859.cs:1 uses #if TEST_FAILS_ON_WINDOWS || TEST_FAILS_ON_ANDROID. For an iOS/MacCatalyst-specific Items2 test, this should follow the existing exclusion pattern using &&; otherwise the test can compile/run where Items2 is not applicable.
⚠️ Warning — UITest can read stale summary text
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35859.cs:27 reads the summary label immediately after ScrollToItem40Button triggers a dispatcher-scheduled update. WaitForElement only waits for existence, not target text, so a fast read can observe stale content.
💡 Suggestion — Keep cache invalidation explicit
CollectionViewHandler2.iOS.cs maintains _firstItemMeasuredSize. Any alternative that strengthens cache reuse should make invalidation on reload/source/strategy/dimension changes explicit to avoid stale first-item sizes.
Failure-Mode Probing
- Recycled cell, same constraints, cache populated: PR skips
Measure()and arranges with cached size. Correct for the regression. - Fresh cell or constraint change: PR calls
Measure(constraints.Width, constraints.Height)for virtual-view bookkeeping, then keeps cached_measuredSize. Safer than always skipping measure. - Header/footer: Guarded by
isSupplementaryView; headers/footers measure independently and do not use first-item cache. MeasureAllItems: Handler returnsCGSize.Empty; code falls back to normal measurement.
Verdict: NEEDS_CHANGES
Confidence: medium
Summary: The core handler change is sound for the targeted CV2 iOS regression. The added UITest still has an unambiguous platform-guard bug and a timing risk in its assertion, both already flagged in inline review.
🛠️ Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix-1 | Always trust cached first-item size; remove all cached-branch Measure() calls. |
✅ PASS | 1 file | Rejected: worse than PR for constraint-change scenarios. |
| 2 | try-fix-2 | Dimension-key handler cache so same-dimension fresh/recycled cells skip Measure() and dimension changes remeasure once. |
✅ PASS | 2 files | Best alternative; potentially better than PR by avoiding fresh-cell discarded measures. |
| PR | PR #36159 | Per-cell constraint guard: cached cells skip Measure() only when _cachedConstraints == constraints. |
✅ PASSED (Gate) | 3 files | Original PR; safer than try-fix-1, simpler than try-fix-2. |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| maui-expert-reviewer | 1 | Yes | Dequeue-time cache pre-application / suppress measure at GetCell; rejected during analysis due to _cachedConstraints and stale-size risks. |
| maui-expert-reviewer | 2 | Yes | Dimension-keyed handler cache; implemented and passed iOS Issue35859. |
Exhausted: Yes
Selected Fix: Candidate #2 — It is the only alternative that passed the iOS regression and has a plausible correctness/performance advantage over the PR fix by moving cache validity to shared handler state. Adoption would still need cleanup for explicit invalidation and API shape before replacing the PR implementation.
📝 Recommended PR Title & Description
Assessment: ✏️ Recommend updating — the current metadata is mostly accurate, but the description does not name the touched implementation/test surfaces or include the final test-stabilization details from the winning pr-plus-reviewer candidate.
Recommended title
[iOS] CollectionView2: Skip cached MeasureFirstItem sizing for non-first cells
Recommended description
### Issue Details
MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS/MacCatalyst was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path.
### Description of changes
* Update `TemplatedCell2.PreferredLayoutAttributesFittingAttributes` so cached first-item measurements are reused for non-first item cells without remeasuring when constraints have not changed.
* When a cell is recycled for a new item at the same scroll width, `_cachedConstraints == constraints` and `Measure()` is skipped.
* When a cell is fresh or constraints change, such as rotation/resize, constraints differ and `Measure()` runs normally before arranging.
* Add Issue35859 coverage for iOS/MacCatalyst `CollectionView2` with `ItemSizingStrategy.MeasureFirstItem`, including the reviewer fixes for the platform guard and waiting for the async summary update.
### Issues Fixed
Fixes #35859
**Tested the behavior in the following platforms.**
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac
| Before | After |
|---------|--------|
| **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
🏁 Report — Final Recommendation
Comparative Report — PR #36159
Candidates compared
| Rank | Candidate | Regression result | Assessment |
|---|---|---|---|
| 1 | pr-plus-reviewer |
✅ Passed gate inherited from PR fix | Best overall. Keeps the PR's constraint-aware cached-size behavior and applies expert reviewer feedback to fix the UI test platform guard and async text wait. |
| 2 | pr |
✅ Gate passed — tests fail without fix and pass with fix | Core fix is sound and conservative, but the submitted test has two actionable issues: incorrect ` |
| 3 | try-fix-2 |
✅ Passed | Strongest independent alternative. Dimension-keyed handler cache could reduce more fresh-cell measurements than the PR, but it introduces broader handler cache API/invalidation risk and still needs cleanup for strategy/source/dimension changes and the CGSize.Empty sentinel. |
| 4 | try-fix-1 |
✅ Passed | Simplest alternative, but less safe than the PR because it skips Measure() even when constraints change, risking stale virtual-view measurement state after rotation or resize. |
Analysis
All candidates passed the targeted iOS regression, so ranking is based on correctness, blast radius, and readiness. try-fix-1 is lowest despite passing because it removes constraint-change bookkeeping entirely. try-fix-2 is technically promising and may eventually outperform the PR by validating the shared cache by constrained dimension, but it changes the handler cache contract and needs explicit invalidation design before it is merge-ready.
The raw PR fix is the safest implementation-level change: it remains localized to TemplatedCell2, preserves a remeasure path for fresh cells and constraint changes, and directly addresses the cached-height non-first measurement path. The only blockers are in the new UI test, not the production fix. Applying the expert review feedback yields pr-plus-reviewer, which preserves the working PR fix while making the regression coverage correctly scoped and less flaky.
Winner
Winner: pr-plus-reviewer
Rationale: it is the PR fix plus targeted review feedback, so it keeps the verified production behavior while addressing the only actionable review findings. It has lower implementation risk than try-fix-2 and better test quality than the raw pr candidate.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you!<!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path. ### Description of changes * Add one guard — skip Measure() when constraints haven't changed: * When a cell is recycled (new item, same scroll width), _cachedConstraints == constraints → Measure() skipped. * When a cell is fresh or rotated, constraints differ → Measure() runs normally. ### 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. --> Fixes #35859 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/36f56adf-5cc5-43e5-9544-60a29d532f8f" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/63ff2285-5f62-43cb-87b2-8fb895ca6b86" width="300" height="600"> |
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 whether this change resolves your issue. Thank you!
Issue Details
MeasureFirstItem is supposed to measure only the first cell and reuse that size for all others — saving scroll work. But CV2 on iOS was still calling MeasureOverride on every non-first cell during scrolling through the cached-height path.
Description of changes
Issues Fixed
Fixes #35859
Tested the behavior in the following platforms.
Before.mov
After.mov