Fix inconsistent Grouped CollectionView (GridItemsLayout) rendering on Windows and iOS/macOS - #36561
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey there @@Shalini-Ashokan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run maui-pr-uitests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
5b954e4 to
98d3e75
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36561Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36561" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Fixes a grouped CollectionView + GridItemsLayout rendering inconsistency by aligning layout spacing/measurement behavior across Windows and iOS/macOS handlers.
Changes:
- Windows: Ensure
GridViewItemcontent stretches vertically so the first item in a grouped grid row doesn’t collapse to content size. - iOS/macOS: Apply header/footer boundary spacing logic to the grid compositional layout path (and set
InterSectionSpacing) so grouped headers get the expected gap before the first row.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs | Extracts and reuses header/footer boundary spacing logic; adds inter-section spacing for grouped grid layouts. |
| src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Windows.cs | Adds vertical content stretching to the grid item container style to keep item sizing consistent in grouped grids. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
…dout) The per-category idle-watcher (Invoke-BuildScriptBounded) only measured growth of the child's redirected stdout/stderr. VSTest's `dotnet test` console output is block-buffered by the OS when stdout is a redirected file, so an actively- running category could go >25 min without the watched file growing and get tree-killed as a 'hang' with ZERO results — even though tests were running the whole time. Confirmed on Windows/WinAppDriver #36561 and #33007: the Appium log recorded findElements requests up to ~1 s before the kill, and screenshots/diffs were produced, yet build-output.log had not grown since the `dotnet test` line. Also count growth of the live UI-test artifacts (Appium log + screenshots in CustomAgentLogsTmp/UITests, and the TRX results dir) as progress. Appium appends to its log on every WinAppDriver request, so it grows continuously while tests actually run — immune to stdout buffering. A genuine hang (no stdout AND no artifact activity) is still idle-killed; validated with a two-scenario harness. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
…kout The 'Post review-incomplete notice' fallback dot-sourced Remove-StaleMauiBotComments.ps1 from the relative .github path, which on a merge-CONFLICTED PR is the PR HEAD checkout. When that PR branch predates commit 0d1190f (added -IncludeReviewIncomplete), the collapse call failed at runtime with 'A parameter cannot be found that matches parameter name IncludeReviewIncomplete', so prior review-incomplete notices never got collapsed and stacked on repeated conflicted-PR reviews. Source instead from the tamper-proof pipeline-ref copy at $(Build.ArtifactStagingDirectory)/trusted-github/scripts/shared/... (captured in Setup before branch switching, same convention as every -TrustedScriptsDir phase), so the current-branch function with the param is always loaded. Observed on build 14698246 (conflicted #36561). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…xit code The snapshot-diff image embed (best-effort) runs native commands (gh/git). When the maui-bot PAT lacks the 'gist' scope, `gh api gists` fails and leaves $LASTEXITCODE non-zero. On a gate-FAILED PR the Post job takes the deferred / no-PRAgent branch, which runs no later native command to reset it, so the whole "Post AI summary review" task inherited exit code 1 and failed (deep results never posted). Reset $LASTEXITCODE to 0 after the best-effort embed so it can never affect the task result. Observed on build 14701124 (PR #36561, catalyst); build 14701123 (PR #36541, gate passed) posted a review afterward and was unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15d2af20-e4ab-4e88-9011-cfbd83513bc0
This comment has been minimized.
This comment has been minimized.
|
|
|
Warning 🔍 Automated review could not completeA stage of the reviewer pipeline could not finish, so no review summary was produced for this run — most often the review stage itself hanging, or the run being canceled by its overall timeout. This is almost always a transient infrastructure issue on the CI agent, not a problem with your PR. (Note: a test-verification gate timeout no longer lands here — it now posts a normal AI Summary whose Gate section explains the timeout.) Please re-comment 🔍 Automated message from the .NET MAUI Copilot reviewer pipeline · build log |
ac202a7 to
d870aa2
Compare
I have resolved the conflights |
…n Windows and iOS/macOS (#36561) <!-- Please let the below note in for people that 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 if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Grouped CollectionView with GridItemsLayout (Span > 1, VerticalItemSpacing set) renders inconsistently across platforms. On Windows, the first item in the first group renders smaller than others. On iOS/macOS, no spacing appears between the group header and the first row of items. ### Root Cause **Windows**: The generated item container style didn't stretch content vertically, so the first grid cell (whose row height differs due to the header) collapsed to its content size instead of filling the row. **iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent) never set InterSectionSpacing / ContentInsets for the header-to-item gap — that logic only existed in the list layout path, not the grid layout path. ### Description of Change **Windows**: Added VerticalContentAlignmentProperty = VerticalAlignment.Stretch to the item container style in StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch uniformly to fill their row instead of the first item sizing to content. **iOS/macOS**: Extracted the header/footer boundary-spacing logic into a shared ApplyHeaderFooterBoundarySpacing helper in LayoutFactory2.cs , and invoked it from the grid layout as well (previously only the list layout applied it). Also set layoutConfiguration.InterSectionSpacing using the main-axis spacing so consistent gaps appear between the header and first row across grouped sections. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #36545 ### Output ScreenShot Windows |Before|After| |--|--| |<img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8" /> | <img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81" /> | iOS |Before|After| |--|--| |<img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b" /> | <img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92" /> |
…n Windows and iOS/macOS (#36561) <!-- Please let the below note in for people that 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 if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Grouped CollectionView with GridItemsLayout (Span > 1, VerticalItemSpacing set) renders inconsistently across platforms. On Windows, the first item in the first group renders smaller than others. On iOS/macOS, no spacing appears between the group header and the first row of items. ### Root Cause **Windows**: The generated item container style didn't stretch content vertically, so the first grid cell (whose row height differs due to the header) collapsed to its content size instead of filling the row. **iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent) never set InterSectionSpacing / ContentInsets for the header-to-item gap — that logic only existed in the list layout path, not the grid layout path. ### Description of Change **Windows**: Added VerticalContentAlignmentProperty = VerticalAlignment.Stretch to the item container style in StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch uniformly to fill their row instead of the first item sizing to content. **iOS/macOS**: Extracted the header/footer boundary-spacing logic into a shared ApplyHeaderFooterBoundarySpacing helper in LayoutFactory2.cs , and invoked it from the grid layout as well (previously only the list layout applied it). Also set layoutConfiguration.InterSectionSpacing using the main-axis spacing so consistent gaps appear between the header and first row across grouped sections. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #36545 ### Output ScreenShot Windows |Before|After| |--|--| |<img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8" /> | <img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81" /> | iOS |Before|After| |--|--| |<img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b" /> | <img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92" /> |
…n Windows and iOS/macOS (#36561) <!-- Please let the below note in for people that 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 if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Grouped CollectionView with GridItemsLayout (Span > 1, VerticalItemSpacing set) renders inconsistently across platforms. On Windows, the first item in the first group renders smaller than others. On iOS/macOS, no spacing appears between the group header and the first row of items. ### Root Cause **Windows**: The generated item container style didn't stretch content vertically, so the first grid cell (whose row height differs due to the header) collapsed to its content size instead of filling the row. **iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent) never set InterSectionSpacing / ContentInsets for the header-to-item gap — that logic only existed in the list layout path, not the grid layout path. ### Description of Change **Windows**: Added VerticalContentAlignmentProperty = VerticalAlignment.Stretch to the item container style in StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch uniformly to fill their row instead of the first item sizing to content. **iOS/macOS**: Extracted the header/footer boundary-spacing logic into a shared ApplyHeaderFooterBoundarySpacing helper in LayoutFactory2.cs , and invoked it from the grid layout as well (previously only the list layout applied it). Also set layoutConfiguration.InterSectionSpacing using the main-axis spacing so consistent gaps appear between the header and first row across grouped sections. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #36545 ### Output ScreenShot Windows |Before|After| |--|--| |<img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8" /> | <img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81" /> | iOS |Before|After| |--|--| |<img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b" /> | <img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92" /> |
…n Windows and iOS/macOS (#36561) <!-- Please let the below note in for people that 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 if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Grouped CollectionView with GridItemsLayout (Span > 1, VerticalItemSpacing set) renders inconsistently across platforms. On Windows, the first item in the first group renders smaller than others. On iOS/macOS, no spacing appears between the group header and the first row of items. ### Root Cause **Windows**: The generated item container style didn't stretch content vertically, so the first grid cell (whose row height differs due to the header) collapsed to its content size instead of filling the row. **iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent) never set InterSectionSpacing / ContentInsets for the header-to-item gap — that logic only existed in the list layout path, not the grid layout path. ### Description of Change **Windows**: Added VerticalContentAlignmentProperty = VerticalAlignment.Stretch to the item container style in StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch uniformly to fill their row instead of the first item sizing to content. **iOS/macOS**: Extracted the header/footer boundary-spacing logic into a shared ApplyHeaderFooterBoundarySpacing helper in LayoutFactory2.cs , and invoked it from the grid layout as well (previously only the list layout applied it). Also set layoutConfiguration.InterSectionSpacing using the main-axis spacing so consistent gaps appear between the header and first row across grouped sections. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #36545 ### Output ScreenShot Windows |Before|After| |--|--| |<img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8" /> | <img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81" /> | iOS |Before|After| |--|--| |<img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b" /> | <img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92" /> |
…n Windows and iOS/macOS (#36561) <!-- Please let the below note in for people that 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 if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Grouped CollectionView with GridItemsLayout (Span > 1, VerticalItemSpacing set) renders inconsistently across platforms. On Windows, the first item in the first group renders smaller than others. On iOS/macOS, no spacing appears between the group header and the first row of items. ### Root Cause **Windows**: The generated item container style didn't stretch content vertically, so the first grid cell (whose row height differs due to the header) collapsed to its content size instead of filling the row. **iOS/macOS**: The grid layout path ( CreateGridLayout -equivalent) never set InterSectionSpacing / ContentInsets for the header-to-item gap — that logic only existed in the list layout path, not the grid layout path. ### Description of Change **Windows**: Added VerticalContentAlignmentProperty = VerticalAlignment.Stretch to the item container style in StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch uniformly to fill their row instead of the first item sizing to content. **iOS/macOS**: Extracted the header/footer boundary-spacing logic into a shared ApplyHeaderFooterBoundarySpacing helper in LayoutFactory2.cs , and invoked it from the grid layout as well (previously only the list layout applied it). Also set layoutConfiguration.InterSectionSpacing using the main-axis spacing so consistent gaps appear between the header and first row across grouped sections. Validated the behavior in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #36545 ### Output ScreenShot Windows |Before|After| |--|--| |<img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/87bac7a7-e845-4dbd-a5f4-826cab099df8" /> | <img width="1010" height="729" alt="image" src="https://github.com/user-attachments/assets/8efa5cd5-d4c2-4eb5-992b-532486304c81" /> | iOS |Before|After| |--|--| |<img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/56f3f126-e830-47f7-9fe8-e29379de542b" /> | <img width="752" height="1492" alt="image" src="https://github.com/user-attachments/assets/9f5dcb2e-1b38-41fe-9a56-670eb6541f92" /> |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details
Grouped CollectionView with GridItemsLayout (Span > 1, VerticalItemSpacing set) renders inconsistently across platforms. On Windows, the first item in the first group renders smaller than others. On iOS/macOS, no spacing appears between the group header and the first row of items.
Root Cause
Windows: The generated item container style didn't stretch content vertically, so the first grid cell (whose row height differs due to the header) collapsed to its content size instead of filling the row.
iOS/macOS: The grid layout path ( CreateGridLayout -equivalent) never set InterSectionSpacing / ContentInsets for the header-to-item gap — that logic only existed in the list layout path, not the grid layout path.
Description of Change
Windows: Added VerticalContentAlignmentProperty = VerticalAlignment.Stretch to the item container style in StructuredItemsViewHandler.Windows.cs , ensuring all grid cells stretch uniformly to fill their row instead of the first item sizing to content.
iOS/macOS: Extracted the header/footer boundary-spacing logic into a shared ApplyHeaderFooterBoundarySpacing helper in LayoutFactory2.cs , and invoked it from the grid layout as well (previously only the list layout applied it). Also set layoutConfiguration.InterSectionSpacing using the main-axis spacing so consistent gaps appear between the header and first row across grouped sections.
Validated the behavior in the following platforms
Issues Fixed
Fixes #36545
Output ScreenShot
Windows
iOS