fix-27998 - [Windows] ScrollView is not scrolling to the bottom if in grid with *,auto Width#28258
fix-27998 - [Windows] ScrollView is not scrolling to the bottom if in grid with *,auto Width#28258BrayanKhosravian wants to merge 7 commits into
Conversation
|
This is only my attempt of solveing it. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| [Category(UITestCategories.Cells)] | ||
| [Category(UITestCategories.ScrollView)] | ||
| [Category(UITestCategories.Border)] | ||
| public void GridAutosStarsScollToEndDisplaysLastItem() |
There was a problem hiding this comment.
The test is failing on Android, iOS and Mac.
Assert.That(lastItem.IsDisplayed().Equals(false), Is.True)
Expected: True
But was: False
Could you take a look?
There was a problem hiding this comment.
Sure, I will take a look.
I will also take a look for the other failing tests. (https://dev.azure.com/xamarin/public/_build/results?buildId=137350&view=ms.vss-test-web.build-test-results-tab&runId=3876168&paneView=debug&resultId=100020)
Thank you for the CI/CD test run.
I only run the uitest on windows and I think I should have run it for other platforms as well.
The initial issue mentioned that only windows is affected, but I think that this should work on other platforms as well or other platforms should not be affected by my changes when it worked properly.
For mac and ios it could take approximately a few days as I have to set up an environment for it.
There was a problem hiding this comment.
Sorry for not responding for a long while.
I have been drowning in uni activities.
But was also stuck as the compilation failed for ios when paired with a macincloud device.
I will open a discussion regarding the issue I faced.
Independently of getting a hint, I will come back to this at a later time.
But my testcase succeds now for android.
Open tasks for myself:
- check if testcase succeeds on ios and mac
- investigate the other failing tests
|
What an awesome review and tooling. |
fb3eb02 to
dfb6fe0
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 28258Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 28258" |
|
Implemented the recommendations and tested it in Controls.TestCases.HostApp. |
|
/review -b feature/refactor-copilot-yml -p windows |
This comment has been minimized.
This comment has been minimized.
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check the ai's suggestions?
Yes I will have a look at it in the next few days. |
|
I am still working on it and getting somewhere. |
|
/review -b feature/enhanced-reviewer -p windows |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
|
|
||
| private void TestWindows() | ||
| { | ||
| #if WINDOWS |
There was a problem hiding this comment.
[moderate] UI Tests - This test puts platform-specific branching directly in the test logic. The UI test guidelines require platform-specific behavior to be hidden behind helper/extension methods so the test body remains readable and all-platform coverage stays intentional. Move the Windows vs non-Windows scroll/assert differences into a shared helper instead of compiling separate branches inside this issue test.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@BrayanKhosravian — new AI review results are available based on this last commit:
f588fe8.
fix-27998: review 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: WINDOWS · Base: main · Merge base: e904e900
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue27998 Issue27998 |
✅ FAIL — 548s | ✅ PASS — 469s |
🧪 GridLayoutManagerTests GridLayoutManagerTests |
✅ FAIL — 25s | ✅ PASS — 22s |
🔴 Without fix — 🖥️ Issue27998: FAIL ✅ · 548s
Determining projects to restore...
Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 18.71 sec).
Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 18.95 sec).
Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 7.26 sec).
Restored D:\a\1\s\src\Core\src\Core.csproj (in 14.27 sec).
Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 13.41 sec).
Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 42 ms).
Restored D:\a\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj (in 6.31 sec).
Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 27 ms).
Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 23 ms).
Restored D:\a\1\s\src\Controls\Foldable\src\Controls.Foldable.csproj (in 23 ms).
Restored D:\a\1\s\src\BlazorWebView\src\Maui\Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 32 ms).
3 of 14 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:05:53.40
Determining projects to restore...
Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils\VisualTestUtils.csproj (in 748 ms).
Restored D:\a\1\s\src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj (in 1.24 sec).
Restored D:\a\1\s\src\TestUtils\src\UITest.Core\UITest.Core.csproj (in 7 ms).
Restored D:\a\1\s\src\TestUtils\src\UITest.Appium\UITest.Appium.csproj (in 1.82 sec).
Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils.MagickNet\VisualTestUtils.MagickNet.csproj (in 4.83 sec).
Restored D:\a\1\s\src\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj (in 5.99 sec).
Restored D:\a\1\s\src\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj (in 5 ms).
Restored D:\a\1\s\src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj (in 7.33 sec).
7 of 15 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 6/6/2026 8:31:07 PM FixtureSetup for Issue27998(Windows)
>>>>> 6/6/2026 8:31:17 PM GridAutosStarsScollToEndDisplaysLastItem Start
>>>>> 6/6/2026 8:31:21 PM GridAutosStarsScollToEndDisplaysLastItem Stop
>>>>> 6/6/2026 8:31:21 PM Log types:
Failed GridAutosStarsScollToEndDisplaysLastItem [5 s]
Error Message:
Assert.That(lastItem.IsDisplayed().Equals(true), Is.True)
Expected: True
But was: False
Stack Trace:
at Microsoft.Maui.TestCases.Tests.Issues.Issue27998.TestWindows() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27998.cs:line 38
at Microsoft.Maui.TestCases.Tests.Issues.Issue27998.GridAutosStarsScollToEndDisplaysLastItem() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27998.cs:line 24
1) at Microsoft.Maui.TestCases.Tests.Issues.Issue27998.TestWindows() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27998.cs:line 38
at Microsoft.Maui.TestCases.Tests.Issues.Issue27998.GridAutosStarsScollToEndDisplaysLastItem() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27998.cs:line 24
NUnit Adapter 4.5.0.0: Test execution complete
[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.11] Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.32] Discovered: Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27998.trx
Total tests: 1
Failed: 1
Test Run Failed.
Total time: 34.3490 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27998.trx
🟢 With fix — 🖥️ Issue27998: PASS ✅ · 469s
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:05:39.58
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304360
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 6/6/2026 8:39:22 PM FixtureSetup for Issue27998(Windows)
>>>>> 6/6/2026 8:39:33 PM GridAutosStarsScollToEndDisplaysLastItem Start
>>>>> 6/6/2026 8:39:36 PM GridAutosStarsScollToEndDisplaysLastItem Stop
Passed GridAutosStarsScollToEndDisplaysLastItem [3 s]
NUnit Adapter 4.5.0.0: Test execution complete
[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.13] Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.38] Discovered: Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27998.trx
Test Run Successful.
Total tests: 1
Passed: 1
Total time: 28.6321 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27998.trx
🔴 Without fix — 🧪 GridLayoutManagerTests: FAIL ✅ · 25s
(truncated to last 15,000 chars)
StarRowsHandleGreedyMeasures(rowDefinitions: "Auto, *, Auto") [< 1 ms]
Passed StarRowsHandleGreedyMeasures(rowDefinitions: "100, *, Auto") [< 1 ms]
Passed MeasureAccountsForPadding(left: 0, top: 0, right: 0, bottom: 0) [< 1 ms]
Passed MeasureAccountsForPadding(left: 10, top: 10, right: 10, bottom: 10) [< 1 ms]
Passed MeasureAccountsForPadding(left: 0, top: 10, right: 0, bottom: 10) [< 1 ms]
Passed MeasureAccountsForPadding(left: 23, top: 5, right: 3, bottom: 15) [< 1 ms]
Passed MeasureAccountsForPadding(left: 10, top: 0, right: 10, bottom: 0) [< 1 ms]
Passed Single star column consumes all horizontal space [< 1 ms]
Passed Column spacing shouldn't affect a single-column grid [< 1 ms]
Passed TwoAbsoluteRowsOneAutoColumn [< 1 ms]
Passed TwoAbsoluteColumnsOneAutoRow [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100, 100", rowSpan: 2, spacing: 0, expectedHeight: 200) [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100, 100, 50", rowSpan: 3, spacing: 20, expectedHeight: 290) [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100, 100", rowSpan: 2, spacing: 10, expectedHeight: 210) [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100", rowSpan: 1, spacing: 10, expectedHeight: 100) [< 1 ms]
Passed StarColumnsHaveChildWidthsWhenGridCentered [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: -10) [1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: -60) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 1) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 0.10000000000000001) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 10) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 60) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 1000) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: -0.10000000000000001) [< 1 ms]
Passed Totally empty star columns measured at infinite width have zero width [< 1 ms]
Passed AutoColumnIsDominatedByWidestView(unconstrainedWidth: 10, constrainedWidth: 30) [1 ms]
Passed AutoColumnIsDominatedByWidestView(unconstrainedWidth: 50, constrainedWidth: 30) [< 1 ms]
Passed Row spanning with row spacing [< 1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: True, constraint: 100) [< 1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: False, constraint: 100) [< 1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: True, constraint: 15) [< 1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: False, constraint: 15) [< 1 ms]
Passed ArrangeAccountsForFill [< 1 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 40, view0ExpectedWidth: 21, view1ExpectedX: 24) [< 1 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 37, view0ExpectedWidth: 18, view1ExpectedX: 21) [16 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 38, view0ExpectedWidth: 19, view1ExpectedX: 22) [< 1 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 39, view0ExpectedWidth: 20, view1ExpectedX: 23) [< 1 ms]
Passed Simple row spanning with multiple views [< 1 ms]
Passed We can specify fractional star sizes for rows [1 ms]
Passed AutoColumnIntersectionWithUnconstrainedMeasure [< 1 ms]
Passed Star columns don't appropriate column spacing during measurement [< 1 ms]
Passed AutoStarColumnSpansDoNotAffectAutoColumnSize [< 1 ms]
Passed MinWidthDominatesMaxWidth [< 1 ms]
Passed Two columns should include the column spacing once [< 1 ms]
Passed We can specify fractional star sizes for columns [1 ms]
Passed StarsAdjustWhenArrangeAndMeasureWidthDiffer(widthConstraint: 926, arrangedWidth: 845) [1 ms]
Passed StarsAdjustWhenArrangeAndMeasureWidthDiffer(widthConstraint: 926, arrangedWidth: 1026) [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureWidthDiffer(widthConstraint: 926, arrangedWidth: 926) [< 1 ms]
Passed Star Column Width is correct when the first child is Collapsed [1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 39, view0ExpectedWidth: 20, view1ExpectedX: 23) [1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 38, view0ExpectedWidth: 19, view1ExpectedX: 22) [< 1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 40, view0ExpectedWidth: 21, view1ExpectedX: 24) [< 1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 37, view0ExpectedWidth: 18, view1ExpectedX: 21) [< 1 ms]
Passed Row spacing shouldn't affect a single-row grid [< 1 ms]
Passed MaxWidthDominatesWidth [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureHeightDiffer(heightConstraint: 926, arrangedHeight: 1026) [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureHeightDiffer(heightConstraint: 926, arrangedHeight: 845) [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureHeightDiffer(heightConstraint: 926, arrangedHeight: 926) [< 1 ms]
Passed IgnoresCollapsedViews [< 1 ms]
Passed CanSpanAbsoluteColumns [< 1 ms]
Passed Auto rows with collapsed views should still count for row spacing [< 1 ms]
Passed StarColumnExpansionWorksWithDifferingScalars [1 ms]
Passed Row span including absolute row should not modify absolute size [< 1 ms]
Passed Empty columns still count for column spacing [< 1 ms]
Passed Row-spanning views smaller than the views confined to the row should not affect row size [< 1 ms]
Passed StarRowHeightLimitedToGridHeight [< 1 ms]
Passed Measure should include column spacing [< 1 ms]
Passed Children of Auto columns should be measured using an infinite width [< 1 ms]
Passed GridMeasureShouldUseExplicitHeight [< 1 ms]
Passed Star Row Height is correct when the first child is Collapsed [< 1 ms]
Passed UnconstrainedStarColumnsRetainTheirWidthsWhenArrangedAtMeasuredSize [1 ms]
Passed AutoRowIsDominatedByTallestView(unconstrainedHeight: 40, constrainedHeight: 30) [1 ms]
Passed AutoRowIsDominatedByTallestView(unconstrainedHeight: 10, constrainedHeight: 30) [< 1 ms]
Passed Auto columns with collapsed views should still count for column spacing [< 1 ms]
Passed DoesNotIgnoreHiddenViews [< 1 ms]
[xUnit.net 00:00:00.96] AutoStarRowSpanMeasureDoesNotExceedConstraint(determinantViewHeight: 200, heightConstraint: 100) [FAIL]
[xUnit.net 00:00:00.96] NSubstitute.Exceptions.ReceivedCallsException : Expected to receive a call matching:
Measure(any Double, 100)
[xUnit.net 00:00:00.96] Actually received no matching calls.
[xUnit.net 00:00:00.96] Received 1 non-matching call (non-matching arguments indicated with '*' characters):
[xUnit.net 00:00:00.96] Measure(∞, *200*)
[xUnit.net 00:00:00.96] Stack Trace:
[xUnit.net 00:00:00.96] at NSubstitute.Core.ReceivedCallsExceptionThrower.Throw(ICallSpecification callSpecification, IEnumerable`1 matchingCalls, IEnumerable`1 nonMatchingCalls, Quantity requiredQuantity)
[xUnit.net 00:00:00.96] at NSubstitute.Routing.Handlers.CheckReceivedCallsHandler.Handle(ICall call)
[xUnit.net 00:00:00.96] at NSubstitute.Routing.Route.Handle(ICall call)
[xUnit.net 00:00:00.96] at NSubstitute.Core.CallRouter.Route(ICall call)
[xUnit.net 00:00:00.96] at NSubstitute.Proxies.CastleDynamicProxy.CastleForwardingInterceptor.Intercept(IInvocation invocation)
[xUnit.net 00:00:00.96] at Castle.DynamicProxy.AbstractInvocation.Proceed()
[xUnit.net 00:00:00.96] at NSubstitute.Proxies.CastleDynamicProxy.ProxyIdInterceptor.Intercept(IInvocation invocation)
[xUnit.net 00:00:00.96] at Castle.DynamicProxy.AbstractInvocation.Proceed()
[xUnit.net 00:00:00.96] at Castle.Proxies.ObjectProxy_4.Measure(Double widthConstraint, Double heightConstraint)
[xUnit.net 00:00:00.96] /_/src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs(2761,0): at Microsoft.Maui.UnitTests.Layouts.GridLayoutManagerTests.AutoStarRowSpanMeasureDoesNotExceedConstraint(Double determinantViewHeight, Double heightConstraint)
[xUnit.net 00:00:00.96] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[xUnit.net 00:00:00.96] at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
[xUnit.net 00:00:00.97] AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(widthConstraint: 500, heightConstraint: 400) [FAIL]
[xUnit.net 00:00:00.97] Assert.Equal() Failure: Values differ
[xUnit.net 00:00:00.97] Expected: 500
[xUnit.net 00:00:00.97] Actual: 750
[xUnit.net 00:00:00.97] Stack Trace:
[xUnit.net 00:00:00.97] /_/src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs(2786,0): at Microsoft.Maui.UnitTests.Layouts.GridLayoutManagerTests.AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(Double widthConstraint, Double heightConstraint)
[xUnit.net 00:00:00.97] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[xUnit.net 00:00:00.97] at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
[xUnit.net 00:00:00.97] AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(widthConstraint: 1000, heightConstraint: 500) [FAIL]
[xUnit.net 00:00:00.97] Assert.Equal() Failure: Values differ
[xUnit.net 00:00:00.97] Expected: 1000
[xUnit.net 00:00:00.97] Actual: 1250
[xUnit.net 00:00:00.97] Stack Trace:
[xUnit.net 00:00:00.97] /_/src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs(2786,0): at Microsoft.Maui.UnitTests.Layouts.GridLayoutManagerTests.AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(Double widthConstraint, Double heightConstraint)
[xUnit.net 00:00:00.97] at InvokeStub_GridLayoutManagerTests.AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(Object, Span`1)
[xUnit.net 00:00:00.97] at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Passed Single star column with a view measured at infinite width gets width of the view [< 1 ms]
Passed UnconstrainedStarRowsRetainTheirHeightsWhenArrangedAtMeasuredSize [1 ms]
Passed ArrangeRespectsBounds [< 1 ms]
Failed AutoStarRowSpanMeasureDoesNotExceedConstraint(determinantViewHeight: 200, heightConstraint: 100) [1 ms]
Error Message:
NSubstitute.Exceptions.ReceivedCallsException : Expected to receive a call matching:
Measure(any Double, 100)
Actually received no matching calls.
Received 1 non-matching call (non-matching arguments indicated with '*' characters):
Measure(∞, *200*)
Stack Trace:
at NSubstitute.Core.ReceivedCallsExceptionThrower.Throw(ICallSpecification callSpecification, IEnumerable`1 matchingCalls, IEnumerable`1 nonMatchingCalls, Quantity requiredQuantity)
at NSubstitute.Routing.Handlers.CheckReceivedCallsHandler.Handle(ICall call)
at NSubstitute.Routing.Route.Handle(ICall call)
at NSubstitute.Core.CallRouter.Route(ICall call)
at NSubstitute.Proxies.CastleDynamicProxy.CastleForwardingInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at NSubstitute.Proxies.CastleDynamicProxy.ProxyIdInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.ObjectProxy_4.Measure(Double widthConstraint, Double heightConstraint)
at Microsoft.Maui.UnitTests.Layouts.GridLayoutManagerTests.AutoStarRowSpanMeasureDoesNotExceedConstraint(Double determinantViewHeight, Double heightConstraint) in /_/src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs:line 2761
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
Failed AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(widthConstraint: 500, heightConstraint: 400) [2 ms]
Error Message:
Assert.Equal() Failure: Values differ
Expected: 500
Actual: 750
Stack Trace:
at Microsoft.Maui.UnitTests.Layouts.GridLayoutManagerTests.AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(Double widthConstraint, Double heightConstraint) in /_/src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs:line 2786
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
Failed AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(widthConstraint: 1000, heightConstraint: 500) [1 ms]
Error Message:
Assert.Equal() Failure: Values differ
Expected: 1000
Actual: 1250
Stack Trace:
at Microsoft.Maui.UnitTests.Layouts.GridLayoutManagerTests.AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(Double widthConstraint, Double heightConstraint) in /_/src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs:line 2786
at InvokeStub_GridLayoutManagerTests.AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Passed Children of Auto rows should be measured using an infinite height [< 1 ms]
Passed ArrangeChildren should arrange within measured size [< 1 ms]
Passed Weighted star column gets proportional space [< 1 ms]
Passed Empty absolute rows/columns still affect Grid size [< 1 ms]
Passed StarsExpandToFixedSizes [< 1 ms]
Passed Multiple star columns consume equal space [1 ms]
Passed TwoAbsoluteRowsAndColumns [1 ms]
Passed OneAutoRowOneAutoColumn [< 1 ms]
Passed Column span including absolute column should not modify absolute size [< 1 ms]
Passed MeasureStarAndExplicitColumnSpan [1 ms]
Passed StarRowExpansionWorksWithDifferingScalars [13 ms]
Passed AutoStarRowSpansDoNotAffectAutoRowSize [1 ms]
[xUnit.net 00:00:01.01] Finished: Microsoft.Maui.UnitTests
Passed Simple column spanning with multiple views [1 ms]
Passed MeasureAutoAndExplicitColumnSpan [< 1 ms]
Passed AutoStarColumnsRespectUnconstrainedHeight [< 1 ms]
Test Run Failed.
Total tests: 282
Passed: 278
Failed: 4
Total time: 1.8458 Seconds
🟢 With fix — 🧪 GridLayoutManagerTests: PASS ✅ · 22s
(truncated to last 15,000 chars)
nning with column spacing [1 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: -0.10000000000000001) [6 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: 0.10000000000000001) [1 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: -60) [< 1 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: 10) [< 1 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: 1000) [< 1 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: 1) [< 1 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: 60) [< 1 ms]
Passed MultipleArrangeCallsProduceConsistentResults(delta: -10) [< 1 ms]
Passed MeasureRespectsMinWidth(minWidth: 100, viewWidth: 100, expectedWidth: 100) [< 1 ms]
Passed MeasureRespectsMinWidth(minWidth: 50, viewWidth: 10, expectedWidth: 50) [< 1 ms]
Passed MeasureRespectsMinWidth(minWidth: -1, viewWidth: 50, expectedWidth: 50) [< 1 ms]
Passed MeasureRespectsMinWidth(minWidth: 10, viewWidth: 50, expectedWidth: 50) [< 1 ms]
Passed SpannedColumnMeasureIncludesSpacing(columnDefinitions: "100", columnSpan: 1, spacing: 10, expectedWidth: 100) [1 ms]
Passed SpannedColumnMeasureIncludesSpacing(columnDefinitions: "100, 100, 50", columnSpan: 3, spacing: 20, expectedWidth: 290) [< 1 ms]
Passed SpannedColumnMeasureIncludesSpacing(columnDefinitions: "100, 100", columnSpan: 2, spacing: 10, expectedWidth: 210) [< 1 ms]
Passed SpannedColumnMeasureIncludesSpacing(columnDefinitions: "100, 100", columnSpan: 2, spacing: 0, expectedWidth: 200) [< 1 ms]
Passed MixStarsAndExplicitSizes [1 ms]
Passed StarColumnsHandleGreedyMeasures(columnDefinitions: "100, *, 100") [1 ms]
Passed StarColumnsHandleGreedyMeasures(columnDefinitions: "Auto, *, 100") [< 1 ms]
Passed StarColumnsHandleGreedyMeasures(columnDefinitions: "Auto, *, Auto") [< 1 ms]
Passed StarColumnsHandleGreedyMeasures(columnDefinitions: "100, *, Auto") [< 1 ms]
Passed AutoStarColumnSpanMeasureDoesNotExceedConstraint(determinantViewWidth: 200, widthConstraint: 100) [1 ms]
Passed AbsoluteRowsConstrainMeasureHeight [1 ms]
Passed AutoStarRowsRespectUnconstrainedWidth [1 ms]
Passed StarRowsShouldFitExplicitDimensions(verticalAlignment: Fill) [< 1 ms]
Passed StarRowsShouldFitExplicitDimensions(verticalAlignment: End) [< 1 ms]
Passed StarRowsShouldFitExplicitDimensions(verticalAlignment: Start) [< 1 ms]
Passed StarRowsShouldFitExplicitDimensions(verticalAlignment: Center) [< 1 ms]
Passed TwoAbsoluteColumnsOneAbsoluteRow [< 1 ms]
Passed AutoStarRowSpanMeasureIsSumOfAutoAndStar(determinantViewHeight: 20, heightConstraint: 100) [< 1 ms]
Passed SingleWeightedStarColumn [< 1 ms]
Passed StarRowsAccountForPadding(top: 16, bottom: 0) [< 1 ms]
Passed StarRowsAccountForPadding(top: -16, bottom: 16) [< 1 ms]
Passed StarRowsAccountForPadding(top: 0, bottom: 16) [< 1 ms]
Passed StarRowsAccountForPadding(top: -16, bottom: -16) [< 1 ms]
Passed StarRowsAccountForPadding(top: 16, bottom: 16) [< 1 ms]
Passed StarRowsAccountForPadding(top: 0, bottom: 0) [< 1 ms]
Passed StarRowsAccountForPadding(top: 16, bottom: -16) [< 1 ms]
Passed AutoStarColumnSpanMeasureIsSumOfAutoAndStar(determinantViewWidth: 20, widthConstraint: 100) [< 1 ms]
Passed Single star row with a view measured at infinite height gets height of the view [3 ms]
Passed Single star row consumes all vertical space [< 1 ms]
Passed Measure should include row spacing [< 1 ms]
Passed MeasureRespectsMinHeight(minHeight: 100, viewHeight: 100, expectedHeight: 100) [< 1 ms]
Passed MeasureRespectsMinHeight(minHeight: 10, viewHeight: 50, expectedHeight: 50) [< 1 ms]
Passed MeasureRespectsMinHeight(minHeight: 50, viewHeight: 10, expectedHeight: 50) [< 1 ms]
Passed MeasureRespectsMinHeight(minHeight: -1, viewHeight: 50, expectedHeight: 50) [< 1 ms]
Passed ChildInStarColumnWithInfiniteSpaceIsMeasuredWithInfinity [< 1 ms]
Passed MinHeightDominatesMaxHeight [< 1 ms]
Passed StarColumnWidthLimitedToGridWidth [< 1 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: -0.10000000000000001) [2 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: 1) [1 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: 60) [< 1 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: 1000) [< 1 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: -60) [< 1 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: 0.10000000000000001) [< 1 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: -10) [< 1 ms]
Passed ViewsInUnconstrainedStarRowsDoNotOverlapWhenArrangeHeightChanges(heightDelta: 10) [< 1 ms]
Passed Star rows don't appropriate row spacing during measurement [1 ms]
Passed MaxHeightDominatesHeight [< 1 ms]
Passed SpannedCellMeasurementIncludesRowSpacingIssue26633 [1 ms]
Passed FillGridArrangesStarRowToHeightConstraint(implied: False, constraint: 15) [< 1 ms]
Passed FillGridArrangesStarRowToHeightConstraint(implied: True, constraint: 100) [< 1 ms]
Passed FillGridArrangesStarRowToHeightConstraint(implied: False, constraint: 100) [< 1 ms]
Passed FillGridArrangesStarRowToHeightConstraint(implied: True, constraint: 15) [< 1 ms]
Passed Auto columns without content have width zero [1 ms]
Passed AbsoluteColumnsConstrainMeasureWidth [1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: Fill, impliedColumn: True) [< 1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: Start, impliedColumn: True) [< 1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: End, impliedColumn: True) [< 1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: Start, impliedColumn: False) [< 1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: Center, impliedColumn: False) [< 1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: End, impliedColumn: False) [< 1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: Fill, impliedColumn: False) [< 1 ms]
Passed GridMeasuresStarColumnToChildWidth(alignment: Center, impliedColumn: True) [< 1 ms]
Passed ChildInStarRowWithInfiniteSpaceIsMeasuredWithInfinity [< 1 ms]
Passed GridMeasureShouldUseExplicitWidth [< 1 ms]
Passed AutoRowIntersectionWithUnconstrainedMeasure [< 1 ms]
Passed Weighted star row gets proportional space [< 1 ms]
Passed StarRowsHandleGreedyMeasures(rowDefinitions: "100, *, 100") [< 1 ms]
Passed StarRowsHandleGreedyMeasures(rowDefinitions: "Auto, *, 100") [< 1 ms]
Passed StarRowsHandleGreedyMeasures(rowDefinitions: "Auto, *, Auto") [< 1 ms]
Passed StarRowsHandleGreedyMeasures(rowDefinitions: "100, *, Auto") [< 1 ms]
Passed MeasureAccountsForPadding(left: 0, top: 0, right: 0, bottom: 0) [< 1 ms]
Passed MeasureAccountsForPadding(left: 10, top: 10, right: 10, bottom: 10) [< 1 ms]
Passed MeasureAccountsForPadding(left: 0, top: 10, right: 0, bottom: 10) [< 1 ms]
Passed MeasureAccountsForPadding(left: 23, top: 5, right: 3, bottom: 15) [< 1 ms]
Passed MeasureAccountsForPadding(left: 10, top: 0, right: 10, bottom: 0) [< 1 ms]
Passed Single star column consumes all horizontal space [< 1 ms]
Passed Column spacing shouldn't affect a single-column grid [< 1 ms]
Passed TwoAbsoluteRowsOneAutoColumn [< 1 ms]
Passed TwoAbsoluteColumnsOneAutoRow [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100, 100", rowSpan: 2, spacing: 0, expectedHeight: 200) [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100, 100, 50", rowSpan: 3, spacing: 20, expectedHeight: 290) [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100, 100", rowSpan: 2, spacing: 10, expectedHeight: 210) [< 1 ms]
Passed SpannedRowMeasureIncludesSpacing(rowDefinitions: "100", rowSpan: 1, spacing: 10, expectedHeight: 100) [< 1 ms]
Passed StarColumnsHaveChildWidthsWhenGridCentered [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: -10) [1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: -60) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 1) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 0.10000000000000001) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 10) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 60) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: 1000) [< 1 ms]
Passed ViewsInUnconstrainedStarColumnsDoNotOverlapWhenArrangeWidthChanges(widthDelta: -0.10000000000000001) [< 1 ms]
Passed Totally empty star columns measured at infinite width have zero width [< 1 ms]
Passed AutoColumnIsDominatedByWidestView(unconstrainedWidth: 10, constrainedWidth: 30) [1 ms]
Passed AutoColumnIsDominatedByWidestView(unconstrainedWidth: 50, constrainedWidth: 30) [< 1 ms]
Passed Row spanning with row spacing [1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: True, constraint: 100) [1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: False, constraint: 100) [< 1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: True, constraint: 15) [< 1 ms]
Passed FillGridArrangesStarColumnToWidthConstraint(implied: False, constraint: 15) [< 1 ms]
Passed ArrangeAccountsForFill [< 1 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 40, view0ExpectedWidth: 21, view1ExpectedX: 24) [< 1 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 37, view0ExpectedWidth: 18, view1ExpectedX: 21) [< 1 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 38, view0ExpectedWidth: 19, view1ExpectedX: 22) [< 1 ms]
Passed StarRowsCalculateCorrectlyWhenGridWidthNearsMinWidth(widthConstraint: 39, view0ExpectedWidth: 20, view1ExpectedX: 23) [< 1 ms]
Passed Simple row spanning with multiple views [< 1 ms]
Passed We can specify fractional star sizes for rows [1 ms]
Passed AutoColumnIntersectionWithUnconstrainedMeasure [< 1 ms]
Passed Star columns don't appropriate column spacing during measurement [< 1 ms]
Passed AutoStarColumnSpansDoNotAffectAutoColumnSize [< 1 ms]
Passed MinWidthDominatesMaxWidth [1 ms]
Passed Two columns should include the column spacing once [< 1 ms]
Passed We can specify fractional star sizes for columns [1 ms]
Passed StarsAdjustWhenArrangeAndMeasureWidthDiffer(widthConstraint: 926, arrangedWidth: 845) [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureWidthDiffer(widthConstraint: 926, arrangedWidth: 1026) [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureWidthDiffer(widthConstraint: 926, arrangedWidth: 926) [< 1 ms]
Passed Star Column Width is correct when the first child is Collapsed [1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 39, view0ExpectedWidth: 20, view1ExpectedX: 23) [< 1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 38, view0ExpectedWidth: 19, view1ExpectedX: 22) [< 1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 40, view0ExpectedWidth: 21, view1ExpectedX: 24) [< 1 ms]
Passed StarColsCalculateCorrectlyWhenGridHeightNearsMinHeight(widthConstraint: 37, view0ExpectedWidth: 18, view1ExpectedX: 21) [< 1 ms]
Passed Row spacing shouldn't affect a single-row grid [< 1 ms]
Passed MaxWidthDominatesWidth [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureHeightDiffer(heightConstraint: 926, arrangedHeight: 1026) [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureHeightDiffer(heightConstraint: 926, arrangedHeight: 845) [< 1 ms]
Passed StarsAdjustWhenArrangeAndMeasureHeightDiffer(heightConstraint: 926, arrangedHeight: 926) [< 1 ms]
Passed IgnoresCollapsedViews [1 ms]
Passed CanSpanAbsoluteColumns [< 1 ms]
Passed Auto rows with collapsed views should still count for row spacing [1 ms]
Passed StarColumnExpansionWorksWithDifferingScalars [2 ms]
Passed Row span including absolute row should not modify absolute size [< 1 ms]
Passed Empty columns still count for column spacing [< 1 ms]
Passed Row-spanning views smaller than the views confined to the row should not affect row size [< 1 ms]
Passed StarRowHeightLimitedToGridHeight [< 1 ms]
Passed Measure should include column spacing [1 ms]
Passed Children of Auto columns should be measured using an infinite width [< 1 ms]
Passed GridMeasureShouldUseExplicitHeight [< 1 ms]
Passed Star Row Height is correct when the first child is Collapsed [< 1 ms]
Passed UnconstrainedStarColumnsRetainTheirWidthsWhenArrangedAtMeasuredSize [1 ms]
Passed AutoRowIsDominatedByTallestView(unconstrainedHeight: 40, constrainedHeight: 30) [1 ms]
Passed AutoRowIsDominatedByTallestView(unconstrainedHeight: 10, constrainedHeight: 30) [< 1 ms]
Passed Auto columns with collapsed views should still count for column spacing [1 ms]
Passed DoesNotIgnoreHiddenViews [< 1 ms]
Passed Single star column with a view measured at infinite width gets width of the view [1 ms]
Passed UnconstrainedStarRowsRetainTheirHeightsWhenArrangedAtMeasuredSize [1 ms]
Passed ArrangeRespectsBounds [< 1 ms]
Passed AutoStarRowSpanMeasureDoesNotExceedConstraint(determinantViewHeight: 200, heightConstraint: 100) [< 1 ms]
Passed AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(widthConstraint: 500, heightConstraint: 400) [1 ms]
Passed AutoStarCellsMeasureOverflowingAutoCellIsAdjusted(widthConstraint: 1000, heightConstraint: 500) [1 ms]
Passed Children of Auto rows should be measured using an infinite height [< 1 ms]
Passed ArrangeChildren should arrange within measured size [< 1 ms]
Passed Weighted star column gets proportional space [< 1 ms]
Passed Empty absolute rows/columns still affect Grid size [< 1 ms]
Passed StarsExpandToFixedSizes [1 ms]
Passed Multiple star columns consume equal space [1 ms]
Passed TwoAbsoluteRowsAndColumns [1 ms]
Passed OneAutoRowOneAutoColumn [< 1 ms]
Passed Column span including absolute column should not modify absolute size [< 1 ms]
Passed MeasureStarAndExplicitColumnSpan [< 1 ms]
Passed StarRowExpansionWorksWithDifferingScalars [1 ms]
Passed AutoStarRowSpansDoNotAffectAutoRowSize [15 ms]
[xUnit.net 00:00:01.07] Finished: Microsoft.Maui.UnitTests
Passed Simple column spanning with multiple views [2 ms]
Passed MeasureAutoAndExplicitColumnSpan [1 ms]
Passed AutoStarColumnsRespectUnconstrainedHeight [< 1 ms]
Test Run Successful.
Total tests: 282
Passed: 282
Total time: 1.9700 Seconds
📁 Fix files reverted (2 files)
eng/pipelines/ci-copilot.ymlsrc/Core/src/Layouts/GridLayoutManager.cs
UI Tests — ScrollView
Detected UI test categories: ScrollView
❌ Deep UI tests — 171 passed, 4 failed across 1 category on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
ScrollView |
171/176 (4 ❌) | 4 diff PNGs |
❌ ScrollView — 4 failed tests
VerifyScrollViewWithScrollToPositionCenterAndGridContentWhenOrientationHorizontal
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyScrollViewWithScrollToPositionCenterAndGridContentWhenOrientationHorizontal.png (8.21% difference)
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
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, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 296
at Microsoft.Maui.TestCases.Tests.ScrollViewFeatureTests.VerifyScrollViewWithScrollToPositionCenterAndGridContentWhenOrientationHorizontal() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs:line 598
at System.RuntimeMethodHandle.InvokeMethod(O
...
VerifyScrollViewWithScrollToPositionEndAndGridContentWhenOrientationHorizontal
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyScrollViewWithScrollToPositionEndAndGridContentWhenOrientationHorizontal.png (8.25% difference)
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
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, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 296
at Microsoft.Maui.TestCases.Tests.ScrollViewFeatureTests.VerifyScrollViewWithScrollToPositionEndAndGridContentWhenOrientationHorizontal() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs:line 562
at System.RuntimeMethodHandle.InvokeMethod(ObjectH
...
VerifyScrollViewWithScrollToPositionStartAndGridContentWhenOrientationHorizontal
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyScrollViewWithScrollToPositionStartAndGridContentWhenOrientationHorizontal.png (8.21% difference)
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
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, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 296
at Microsoft.Maui.TestCases.Tests.ScrollViewFeatureTests.VerifyScrollViewWithScrollToPositionStartAndGridContentWhenOrientationHorizontal() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs:line 580
at System.RuntimeMethodHandle.InvokeMethod(Obj
...
VerifyScrollViewWithScrollToPositionMakeVisibleAndGridContentWhenOrientationHorizontal
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyScrollViewWithScrollToPositionMakeVisibleAndGridContentWhenOrientationHorizontal.png (8.21% difference)
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
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, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 296
at Microsoft.Maui.TestCases.Tests.ScrollViewFeatureTests.VerifyScrollViewWithScrollToPositionMakeVisibleAndGridContentWhenOrientationHorizontal() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs:line 616
at System.RuntimeMethodHandle.Invo
...
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)
Pre-Flight — Context & Validation
Issue: #27998 - [Windows] ScrollView is not scrolling to the bottom if in grid with *,auto Width
PR: #28258 - fix-27998 - [Windows] ScrollView is not scrolling to the bottom if in grid with *,auto Width
Platforms Affected: Windows primary; Android/iOS/MacCatalyst regression risk noted in PR discussion
Files Changed: 1 implementation, 4 test
Key Findings
- Issue #27998 reproduces with a Grid using
RowDefinitions="Auto,*"andColumnDefinitions="*,Auto": a ScrollView in the star column/row cannot scroll to bottom on Windows when an adjacent Auto column contains a fixed-width Border. - PR fix changes
src/Core/src/Layouts/GridLayoutManager.csto pre-seed Auto definitions from explicit child dimensions, measure deferred Auto cells, and proportionally shrink Auto definitions to fit finite constraints. - PR discussion recorded prior failures on Android, iOS, and Mac for an earlier UI-test shape; latest author comment says Windows and Android work, iOS unknown.
- GitHub CLI authentication was unavailable, so PR context was collected from local branch state and public GitHub API. Inline review comments and issue/PR comments available publicly were included.
Code Review Summary
Verdict: NEEDS_CHANGES
Confidence: high
Errors: 1 | Warnings: 3 | Suggestions: 2
Key code review findings:
src/Core/src/Layouts/GridLayoutManager.cs: accidental unusedusing System.Data.Common;in a layout hot-path file.src/Core/src/Layouts/GridLayoutManager.cs: unusedusing System.Linq;; layout hot-path guidance forbids LINQ and the file does not need the namespace.src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27998.cs: inline#if WINDOWS/#if !WINDOWSin UI test logic conflicts with UI test guidelines.src/Core/src/Layouts/GridLayoutManager.cs:MeasureDeferredAutoCellscan double-measure cells later measured bySecondMeasurePass; likely acceptable but a performance tradeoff in a hot path.src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs: typoexpectedeView1Width.- Removed overflow data points are replaced by new tests but lack explanatory comments.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #28258 | Pre-seed Auto row/column definitions from explicit child dimensions, add deferred Auto measurement, then proportionally shrink Auto definitions to fit constraints after measure passes. | PASSED (Gate) | src/Core/src/Layouts/GridLayoutManager.cs, tests |
Original PR; gate result supplied by caller. |
Code Review — Deep Analysis
Code Review PR #28258
Independent Assessment
What this changes: GridLayoutManager.GridStructure gains three new behaviors: (1) pre-seeding Auto row/column definitions from explicitly-set child Width/Height values before any measurement, (2) a new MeasureDeferredAutoCells phase that measures deferred Auto cells using the grid constraint as fallback, and (3) FitAutoDefinitionsToConstraints, which proportionally shrinks Auto definitions when their total exceeds the grid constraint. New unit tests cover the corrected behavior, and two [InlineData(200, 100)] cases are removed from existing tests whose expected behavior changed.
Inferred motivation: When an Auto column contains a view with an explicit WidthRequest, the column's size was zero when ResolveStarColumns ran (because the cell was deferred to the second pass). This gave the * column the full constraint width, leaving no room for the Auto column. The ScrollView in the * column was then arranged too tall, losing its scrollable region.
Reconciliation with PR Narrative
Author claims: Two root causes (1) explicit absolute widths on children aren't considered when initializing column/row definitions, (2) after measurement passes, definitions aren't adjusted for overflows. Solutions pre-seed from absolute values and add a post-measurement trim step.
Agreement: Assessment matches. The pre-seeding and FitAutoDefinitionsToConstraint together ensure ResolveStarColumns sees the correct available space. The fix is logically sound.
Findings
Error Accidental using System.Data.Common; in a layout hot-path file
src/Core/src/Layouts/GridLayoutManager.cs, line 5
+using System.Data.Common;System.Data.Common is an ADO.NET namespace with zero connection to grid layout. It was clearly added by accident alongside the real changes. No symbol from it is used anywhere in the file (confirmed: grep finds no usage). This will produce a CS8019 (unnecessary using directive) warning; depending on whether the project compiles with <TreatWarningsAsErrors>true</TreatWarningsAsErrors>, it may block CI. Even if it doesn't fail the build, it is confusing noise in a file read frequently by maintainers. Remove it.
Warning using System.Linq; added but unused
src/Core/src/Layouts/GridLayoutManager.cs, line 7
+using System.Linq;No LINQ extension methods (.Where, .Select, .FirstOrDefault, .ToList, .Any) are called anywhere in the file confirmed by search. System.Linq was not present in this file before the PR (the diff adds it). This likely was added speculatively during development.
Per performance-hotpaths.instructions.md: "No LINQ methods use indexed for loops." The new code correctly uses for loops; the import is just dead code. Remove it. (The existing foreach loops over arrays and Dictionary.Values don't require System.Linq.)
Warning Inline #if WINDOWS / #if !WINDOWS in test logic
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27998.cs, lines 2851
private void TestWindows()
{
#if WINDOWS
...
#endif
}
private void TestOtherPlatforms()
{
#if !WINDOWS
...
#endif
}The UI test guidelines require platform-specific logic to be hidden behind extension methods, not inline #if directives. Even though the #if blocks are in private helpers (not directly in the [Test] method), this pattern still introduces platform ifdefs into test logic, which the guidelines call out for readability reasons. A cleaner pattern would be platform-specific extension methods (e.g., App.ScrollDownAndAssertLastItemVisible(...)) that internally handle the Windows/non-Windows difference.
Warning MeasureDeferredAutoCells double-measures cells that are also processed by SecondMeasurePass
src/Core/src/Layouts/GridLayoutManager.cs, lines 535574 and 464532
A cell in an Auto column AND a * row (like view2 in the issue's scenario) has NeedsSecondPass = true because its MeasureHeight is NaN. MeasureDeferredAutoCells measures it first (using the grid height constraint as fallback), then SecondMeasurePass measures it again (using the resolved star row size). That's two child.Measure() calls for a single layout pass.
MeasureCell is on a layout hot path. For grids with many such cells (Auto columns inside star rows), this doubles the measurement cost of those cells. The second call is authoritative and necessary; the first call is needed only to seed the Auto column for ResolveStarColumns. Consider documenting this trade-off with a comment, or if a view has Dimension.IsExplicitSet(view.Width) skipping the MeasureDeferredAutoCells call for that cell since the pre-seeding loop already handled it.
Suggestion Typo in test variable name
src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs, line ~2783
var expectedeView1Width = widthConstraint - view2Width;
// ^ extra 'e'expectedeView1Width has an extra e. Minor, but inconsistent with expectedView1Height / expectedView2Height on the lines below. Rename to expectedView1Width.
Suggestion Removed [InlineData(200, 100)] cases lack an explanatory comment
src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs
Two [InlineData(200, 100)] data points are removed from AutoStarColumnSpanMeasureIsSumOfAutoAndStar and AutoStarRowSpanMeasureIsSumOfAutoAndStar. These were testing the scenario where a view wider than the constraint was in the Auto column, and the old expected behavior was Math.Max(view, constraint). The new behavior clamps the Auto column, so the old assertion breaks.
The removed cases are replaced by the new AutoStarColumnSpanMeasureDoesNotExceedConstraint tests which is correct but a comment in the original tests (or on the [InlineData] removal) would help future reviewers understand why these data points no longer apply.
Devil's Advocate
On FitAutoDefinitionsToConstraint: Could shrinking Auto definitions cause content to be clipped? Yes if an Auto column contains a view wider than the remaining space after star columns resolve, that view will be clipped. But this was already happening (the star column was too large, clipping the ScrollView). The fix trades one type of overflow for another, and the new behavior Auto yielding to the constraint is more consistent with how WPF/WinUI handle this. I'm satisfied this is correct.
On the removed test cases: The old tests asserted expectedMeasureWidth = Math.Max(determinantViewWidth, widthConstraint) = 200 when determinantViewWidth=200, widthConstraint=100. This means the grid was allowed to report a measured width (200) larger than its constraint (100), which was wrong. The fix changes this to min(200, 100) = 100. The behavioral change is intentional and justified.
On double-measurement: For the specific case that triggered the bug (one Auto column, one star column, a few views), the extra measurement is one call per deferred Auto cell per layout pass. Not alarming in practice, but worth documenting.
Verdict: NEEDS_CHANGES
Confidence: high
Summary: The fix is architecturally correct and the new unit tests verify the intended behavior. However, two accidental using directives (System.Data.Common and System.Linq) were added and are unused System.Data.Common in particular is a red flag that will generate warnings/errors in CI. These must be removed. The inline #if WINDOWS pattern in the test violates project guidelines and should be refactored to extension methods. The typo in the test variable name is a minor cleanup item.
Fix — Analysis & Comparison
Try-Fix Aggregate Results — PR #28258
Attempt 1: Star-Allocation with Pre-Seeded Explicit Auto Sizes
Result: FAIL (282 / 284 unit tests pass; AutoStarCellsMeasureOverflowingAutoCellIsAdjusted failed for both InlineData rows)
Approach: Pre-seed Auto definitions from explicit child Width/Height before star resolution. Add a constraint cap in SecondMeasurePass. Reset and re-resolve stars after SecondMeasurePass. Deliberately avoid any deferred Auto measurement pass and any proportional Auto shrink.
Why it failed: Pure-star cells need their height computed as constraint − measured Auto row height. Pre-seeding from explicit sizes alone cannot supply the Auto row height when it is produced by measuring an Auto-row cell (the header in the failing test). Without a step that learns the measured Auto row size before measuring the dependent star cells, the star-row constraint stays at the full grid height and the star cells overflow.
Findings count: 0
Attempt 2: Dependency-ordered measurement with per-cell dependent-axis budget and per-definition Auto cap
Result: ✅ PASS
dotnet test … FullyQualifiedName~GridLayoutManagerTests— 284 / 284dotnet test … FullyQualifiedName~Layouts— 518 / 518BuildAndRunHostApp.ps1 -Platform windows -TestFilter Issue27998— 1 / 1
Approach: Between FirstMeasurePass and star resolution, a single explicit dependency phase (MeasureBlockingAutoContributors) measures only those deferred single-span Auto-contributing cells that block star resolution. The cell's Auto axis is measured at ∞ (the cell's natural Auto size); the dependent star axis uses AvailableForSpan(...), a per-cell budget derived from definitions already known on that axis (gridConstraint − padding − Σ defs outside the span − spacing). Constraint enforcement happens in ClampAutoDefinitionsToAvailable, a per-definition cumulative cap that walks each axis in declaration order and never lets an Auto definition take more than the room actually left for it — not a proportional shrink. The unused using System.Data.Common / using System.Linq imports are removed.
Differences from PR #28258:
- The PR's
MeasureDeferredAutoCellsuses a flatgridConstraint − paddingfallback on the dependent axis; this candidate uses a per-cell budget that accounts for definitions already resolved byFirstMeasurePass. Same shape, more refined input. - The PR's
FitAutoDefinitionsToConstraintsproportionally shrinks every Auto definition when the total overflows; this candidate uses a per-definition cumulative cap that is order-deterministic and avoids proportional math. - Scheduling, not a "general fallback pass":
MeasureBlockingAutoContributorsruns as an explicit dependency phase rather than as a separate broad rescue measurement pass.
Differences from Attempt 1: Attempt 1 only pre-seeded Auto from explicit Width/Height and skipped any measurement-based Auto discovery before star resolution; Attempt 2 measures the Auto contributors regardless of whether they have an explicit size, which fixes the AutoStarCellsMeasureOverflowingAutoCellIsAdjusted case.
Self-review: 0 findings — see attempt-2/reviewer-findings.json.
Summary
Two candidates explored. Attempt 1 demonstrated that pre-seeding alone cannot solve the measured-Auto-row case. Attempt 2 found an ordering-first alternative that passes the full unit-test suite (284 grid + 518 layout) and the Issue27998 Windows UI test, with no LINQ/closures/allocations added on the hot path and no public-API surface impact.
Report — Final Recommendation
Comparative Report PR #28258
Candidate ranking
| Rank | Candidate | Regression result | Review result | Assessment |
|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Passed. Gate already proved fail-without/pass-with-fix on Windows; targeted Grid and Issue27998 checks also passed after reviewer feedback. | Expert inline finding addressed; saved review cleanups applied. | Winner. Keeps the PR's passing implementation while removing the actionable review concern and directly related cleanup issues. This is the lowest-risk path because it preserves the submitted fix shape and only changes review-feedback items. |
| 2 | try-fix-2 |
Passed broader evidence: 284/284 Grid tests, 518/518 layout tests, and Windows Issue27998 UI test. |
Self-review reported 0 findings. | Strong alternate implementation. It improves the PR algorithm by using dependency-ordered Auto contributor measurement, per-cell budgets, and per-definition Auto caps instead of flat fallback/proportional shrink. Ranked below pr-plus-reviewer because it replaces more of the submitted layout algorithm and is therefore a larger integration change despite good test evidence. |
| 3 | pr |
Passed gate. | Expert reviewer found an actionable UI-test convention issue; saved pre-flight review also found accidental unused imports and a test typo. | Functionally valid but superseded by pr-plus-reviewer, which keeps the same implementation and addresses review feedback. |
| 4 | try-fix-1 |
Failed: 282/284 Grid unit tests; AutoStarCellsMeasureOverflowingAutoCellIsAdjusted failed for both data rows. |
Self-review found no findings, but regression failure is decisive. | Ranked last because candidates that failed regression tests must rank below passing candidates. Pre-seeding explicit Auto sizes without measuring Auto contributors before star resolution cannot handle measured Auto-row height. |
Decision
pr-plus-reviewer wins. The raw PR fix already satisfies the gate, and the reviewer-enhanced candidate addresses the actionable expert finding while avoiding the churn of replacing the PR's layout algorithm with try-fix-2. try-fix-2 remains a credible alternate if maintainers prefer the per-cell budget/per-definition cap design, but it is not necessary to resolve the reviewed PR safely.
Future Action — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
|
I have been hesitating a bit because I reinvestigated the issue deeper and I am unsure if the code I want to merge actually only treats a symptom rather then fixing the root cause. The last commit broke the "ScrollView Mixed Feature Tests" which had Grid in horizontal options. But I think this is actually not required and handles a completely different issue, where the scrollbar is not visible for windows. // some _childrenToLayout could have set Height/Width abosultely set, while our columns/rows are on auto or *
// in this case we set set the column/row size to the child's size
foreach (var cell in _cells)
{
var view = _childrenToLayOut[cell.ViewIndex];
if (view.Height > 0)
{
var row = _rows[cell.Row];
if (row.IsAuto)
{
row.Size = view.Height;
}
}
if (view.Width > 0)
{
var column = _columns[cell.Column];
if (column.IsAuto)
{
column.Size = view.Width;
}
}
}As I looked into the ScrollView Mixed Feature Tests, I noticed other scrolling issues as well. Therefore I added debug logs before and after measure passes, insinde arragne semantics, but also in the code behind of the Controls and logged their SizeChanged and their Handler values. The AI review mentioned hot path and performance. But because of this I came to the point and asked why do this values have to be corrected? Currently I have few pararell branches open regarding the same issue. Regarding the overflow detection I do something like this: void SecondMeasurePass()
{
foreach (var cell in _cells)
{
if (!cell.NeedsSecondPass)
{
continue;
}
double width = 0;
double height = 0;
if (double.IsInfinity(cell.MeasureHeight))
{
height = double.PositiveInfinity;
}
else
{
for (int n = cell.Row; n < cell.Row + cell.RowSpan; n++)
{
height += _rows.GetSize(n);
}
height += _rowSpacing * (cell.RowSpan > 0 ? cell.RowSpan - 1 : 0);
}
if (double.IsInfinity(cell.MeasureWidth))
{
width = double.PositiveInfinity;
}
else
{
for (int n = cell.Column; n < cell.Column + cell.ColumnSpan; n++)
{
width += _columns.GetSize(n);
}
width += _columnSpacing * (cell.ColumnSpan > 0 ? cell.ColumnSpan - 1 : 0);
}
if (width == 0 || height == 0)
{
continue;
}
var measure = MeasureCell(cell, width, height);
if (cell.IsColumnSpanStar && cell.ColumnSpan > 1)
{
TrackSpan(new Span(cell.Column, cell.ColumnSpan, true, measure.Width));
}
else if (cell.ColumnSpan == 1)
{
if (TreatCellWidthAsAuto(cell))
{
_columns.Update(cell.Column, measure.Width);
}
else
{
}
}
if (cell.IsRowSpanStar && cell.RowSpan > 1)
{
TrackSpan(new Span(cell.Row, cell.RowSpan, false, measure.Height));
}
else if (cell.RowSpan == 1)
{
if (TreatCellHeightAsAuto(cell))
{
_rows.Update(cell.Row, measure.Height);
}
else
{
}
}
TryCorrectOverflow();
}
}
void TryCorrectOverflow()
{
if (!_rows.DetectOverflow(_gridHeightConstraint))
return;
if (!_rows.TryCorrectOverflow(_gridHeightConstraint, out int affectedRowIndex, out double? correctedSize))
return;
if (correctedSize is null)
return;
for (int i = 0; i < _cells.Length; i++)
{
var cell = _cells[i];
if (cell.Row != affectedRowIndex)
continue;
cell.MeasureHeight = correctedSize.Value;
}
}But to make this work I created a new class DefinitionStructure which is used for rows and columns. sealed class DefinitionStructure
{
//...
private double _changedSize;
//...
public void Update(int index, double size)
{
var definition = _definitions[index];
ChangeSize(definition, size);
}
public void ChangeSize(int index, double size) =>
ChangeSize(_definitions[index], size);
void ChangeSize(Definition def, double size)
{
_changedSize += def.SetSize(size);
}
public bool DetectOverflow(double constraint) =>
_changedSize > constraint;
public bool TryCorrectOverflow(double constraint, out int affectedIndex, out double? correctedSize)
{
affectedIndex = -1;
correctedSize = null;
var overflow = _changedSize - constraint;
if (overflow <= 0)
return false;
Definition? biggestDefinition = null;
for (var i = 0; i < _definitions.Length; i++)
{
Definition? definition = _definitions[i];
if (!definition.IsAuto && !definition.IsStar)
continue;
if (biggestDefinition is null || definition.Size > biggestDefinition.Size)
{
biggestDefinition = definition;
affectedIndex = i;
}
}
if (biggestDefinition is null)
return false;
correctedSize = Math.Max(0, biggestDefinition.Size - overflow);
ChangeSize(biggestDefinition, correctedSize.Value);
return true;
}
//...I wanted to share my thoughts and analysis. Windows Debug WriteLines For Android: |
|
Replying to #28258 (comment): Thanks for digging into this more deeply. I agree with your hesitation here: I would not merge the current head as-is. The issue is real and the repro/tests are useful, but the current implementation is changing core Grid sizing semantics too broadly. The part that looks directionally correct is making the The blocker is There are also secondary issues:
My recommendation: keep/cherry-pick the valuable regression coverage, but rework the fix to preserve Auto sizing semantics. Concretely, drop the global Auto-clipping path, restore the removed overflow cases, and investigate a narrower fix that re-resolves Star sizes after Auto sizes become known. If that still does not fully cover the scenario, the next area to look at is how deferred Auto cells and spans feed star allocation, not clipping Auto definitions globally. CI is currently green for |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
kubaflo
left a comment
There was a problem hiding this comment.
It doesn't looks like a fix, but rather a workaround - could you please check the ai's suggestions? Maybe it is actually worth to close this PR?
|
Thank you for the detailed reply. |
fixes: #27998
Problems:
|---cell0---|
|cell1|cell2|
Problem1:
All row and column defs are either set to auto or *.
Cell2 has an absolute width set to 250.
After initialization of the cells this absolute value can be considered for the row and column defs.
Solution1:
We consider the abolsute values set for the children which have to be layouted in the column and row defs.
Problem2:
Whenever we measured we have to reconsider that the row and column defs should be adjusted.
Solution2:
Whenver we measured (which is currently after
FirstMeasurePass()andSecoondMeasurePass()) we adjust the row and column defs and consider possible overflows.