Repository navigation
[iOS] Collapse CollectionView group headers when their content is hidden - #39533
Conversation
<!-- 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. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Remove the unused SDK insertion templates instead of migrating their retired `VSEngSS-MicroBuild2022-1ES` pool: - `eng/pipelines/common/insertion.yml` - `eng/pipelines/common/sdk-insertion.yml` The stage template has no callers, and the job template is referenced only by that stage. The former `maui-release.yml` caller was removed in dotnet#31130. The current official build uses Arcade publishing; its configured YAML entry point and matching `main` revision were checked in Azure DevOps. The legacy DevDiv MAUI pipeline definitions are disabled. No active pipeline, publishing stage, or pool is changed. **Validation:** `git diff --check` passed. PyYAML parsed all 39 remaining pipeline YAML files, and all 113 static local template references resolved. A tracked-file search found no remaining references to the retired pool, either deleted template, or the old `sdk_insertion` stage. No new pipeline tests were added, and no device/UI tests were run for this configuration-only deletion. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#39518 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2f892844-9872-4d2f-8799-c45663efc2a3
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39533Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39533" |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey there @@carloshenriquecarniatto! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Hey there @carloshenriquecarniatto! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
@dotnet-policy-service agree |
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.
184d770 to
768b174
Compare
|
Thanks for the analysis — that failure comes from the legacy I pushed an update with the equivalent fix for the legacy
Validated locally on both handlers with the repro from the issue (iOS 26.2 simulator): the hidden header collapses with CV1 and with CV2. The UI test now asserts only the collapse direction, so it runs in both configurations. Restoring the height when the header is shown again still works on CV2, but not on CV1: a zero-height supplementary view is no longer re-measured there, which is pre-existing and tracked as a follow-up rather than part of this fix. |
|
The update is pushed ( |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
2 similar comments
|
|
This comment has been minimized.
This comment has been minimized.
Tests Failure Analysis
🧪 CI Analysis — click to expand📊 maui-prNo failures found. 🧪 maui-pr-devicetests
🧪 maui-pr-uitests
🧭 Follow-up — actions and refreshNext action: Fix CV1 restoration expectation; inspect Android crash/WebView initialization; reproduce InputTransparent failures against target.
|
kubaflo
left a comment
There was a problem hiding this comment.
Could you remove changes from cv1 - we no longer support it
Group headers and footers are supplementary views, so their size comes from the layout instead of the visible item cells. InvalidateLayoutIfItemsMeasureChanged only looked at supplementary views when ItemsView.Header/Footer were set, which meant a measure invalidation coming from a GroupHeaderTemplate or GroupFooterTemplate never invalidated the layout. On top of that, measuring a collapsed header still reports the content size, so the layout kept the old height. Check every visible supplementary view for an invalidated measure, and collapse the growing dimension (height for vertical lists, width for horizontal) of a header or footer whose virtual view is Collapsed. The whole layout is still invalidated instead of single supplementary elements, to avoid the cell collapse from dotnet#25362. Contributes to dotnet#30924 (iOS/Mac Catalyst; Android and Windows use a different measurement path).
768b174 to
3c7561d
Compare
|
@kubaflo Done — the cv1 changes are gone. The fix now lives only in the One detail worth flagging: The PR is down to 4 files. I amended the commit, so the branch was force-pushed (768b174 → 3c7561d). |
|
1 similar comment
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…den (#39533) ### Description of Change Group headers and footers are supplementary views: their size comes from the layout, not from the visible item cells. When the content of a group header was collapsed (`IsVisible = false`) or its `HeightRequest` changed after the header had been rendered, `StructuredItemsViewController2.InvalidateLayoutIfItemsMeasureChanged` only checked supplementary views when `ItemsView.Header`/`HeaderTemplate` (or the footer equivalents) were set. A measure invalidation coming from `GroupHeaderTemplate`/`GroupFooterTemplate` was therefore ignored and the old header height stayed on screen. On top of that, measuring a collapsed header still reports the content size — visibility is not part of a measure pass — so even an invalidated layout would keep the previous height. This change, scoped to the `Items2` handler (CV2): - checks every visible supplementary header/footer for an invalidated measure, instead of only the `ItemsView.Header`/`Footer` ones; - collapses the growing dimension (height for vertical lists, width for horizontal) of a header/footer whose virtual view is `Collapsed`. The whole layout is still invalidated instead of single supplementary elements, to avoid the cell collapsing issue described in #25362. The legacy `Items` handler (CV1) is intentionally not touched. | Before | After | | --- | --- | | header content hidden, space remains | header content hidden, space collapses | The header gets its original height back when its content is made visible again. ### Issues Fixed Contributes to #30924 (iOS/Mac Catalyst only). ### Testing - Reproduced with the public repro from the issue (`Axemasta/MauiRepros`, `GroupHeaderResizingRepro`) on an iOS simulator: hiding the header now collapses its space, and showing it again restores the original height. - Added `Issue30924` HostApp page and UI test. The page instantiates `CollectionView2` so the test always runs against the supported handler, independently of the UI test configuration, and asserts that hiding the header collapses its space. - `Controls.TestCases.HostApp` builds for `net10.0-ios` with this change. - Android was checked with the same repro and is unchanged: the header still keeps its space when hidden, because RecyclerView uses a different measurement path. Windows was not available on this machine. Both need a follow-up; the issue should stay open for them. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…den (#39533) ### Description of Change Group headers and footers are supplementary views: their size comes from the layout, not from the visible item cells. When the content of a group header was collapsed (`IsVisible = false`) or its `HeightRequest` changed after the header had been rendered, `StructuredItemsViewController2.InvalidateLayoutIfItemsMeasureChanged` only checked supplementary views when `ItemsView.Header`/`HeaderTemplate` (or the footer equivalents) were set. A measure invalidation coming from `GroupHeaderTemplate`/`GroupFooterTemplate` was therefore ignored and the old header height stayed on screen. On top of that, measuring a collapsed header still reports the content size — visibility is not part of a measure pass — so even an invalidated layout would keep the previous height. This change, scoped to the `Items2` handler (CV2): - checks every visible supplementary header/footer for an invalidated measure, instead of only the `ItemsView.Header`/`Footer` ones; - collapses the growing dimension (height for vertical lists, width for horizontal) of a header/footer whose virtual view is `Collapsed`. The whole layout is still invalidated instead of single supplementary elements, to avoid the cell collapsing issue described in #25362. The legacy `Items` handler (CV1) is intentionally not touched. | Before | After | | --- | --- | | header content hidden, space remains | header content hidden, space collapses | The header gets its original height back when its content is made visible again. ### Issues Fixed Contributes to #30924 (iOS/Mac Catalyst only). ### Testing - Reproduced with the public repro from the issue (`Axemasta/MauiRepros`, `GroupHeaderResizingRepro`) on an iOS simulator: hiding the header now collapses its space, and showing it again restores the original height. - Added `Issue30924` HostApp page and UI test. The page instantiates `CollectionView2` so the test always runs against the supported handler, independently of the UI test configuration, and asserts that hiding the header collapses its space. - `Controls.TestCases.HostApp` builds for `net10.0-ios` with this change. - Android was checked with the same repro and is unchanged: the header still keeps its space when hidden, because RecyclerView uses a different measurement path. Windows was not available on this machine. Both need a follow-up; the issue should stay open for them. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…den (#39533) ### Description of Change Group headers and footers are supplementary views: their size comes from the layout, not from the visible item cells. When the content of a group header was collapsed (`IsVisible = false`) or its `HeightRequest` changed after the header had been rendered, `StructuredItemsViewController2.InvalidateLayoutIfItemsMeasureChanged` only checked supplementary views when `ItemsView.Header`/`HeaderTemplate` (or the footer equivalents) were set. A measure invalidation coming from `GroupHeaderTemplate`/`GroupFooterTemplate` was therefore ignored and the old header height stayed on screen. On top of that, measuring a collapsed header still reports the content size — visibility is not part of a measure pass — so even an invalidated layout would keep the previous height. This change, scoped to the `Items2` handler (CV2): - checks every visible supplementary header/footer for an invalidated measure, instead of only the `ItemsView.Header`/`Footer` ones; - collapses the growing dimension (height for vertical lists, width for horizontal) of a header/footer whose virtual view is `Collapsed`. The whole layout is still invalidated instead of single supplementary elements, to avoid the cell collapsing issue described in #25362. The legacy `Items` handler (CV1) is intentionally not touched. | Before | After | | --- | --- | | header content hidden, space remains | header content hidden, space collapses | The header gets its original height back when its content is made visible again. ### Issues Fixed Contributes to #30924 (iOS/Mac Catalyst only). ### Testing - Reproduced with the public repro from the issue (`Axemasta/MauiRepros`, `GroupHeaderResizingRepro`) on an iOS simulator: hiding the header now collapses its space, and showing it again restores the original height. - Added `Issue30924` HostApp page and UI test. The page instantiates `CollectionView2` so the test always runs against the supported handler, independently of the UI test configuration, and asserts that hiding the header collapses its space. - `Controls.TestCases.HostApp` builds for `net10.0-ios` with this change. - Android was checked with the same repro and is unchanged: the header still keeps its space when hidden, because RecyclerView uses a different measurement path. Windows was not available on this machine. Both need a follow-up; the issue should stay open for them. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Description of Change
Group headers and footers are supplementary views: their size comes from the layout, not from the visible item cells. When the content of a group header was collapsed (
IsVisible = false) or itsHeightRequestchanged after the header had been rendered,StructuredItemsViewController2.InvalidateLayoutIfItemsMeasureChangedonly checked supplementary views whenItemsView.Header/HeaderTemplate(or the footer equivalents) were set. A measure invalidation coming fromGroupHeaderTemplate/GroupFooterTemplatewas therefore ignored and the old header height stayed on screen.On top of that, measuring a collapsed header still reports the content size — visibility is not part of a measure pass — so even an invalidated layout would keep the previous height.
This change, scoped to the
Items2handler (CV2):ItemsView.Header/Footerones;Collapsed.The whole layout is still invalidated instead of single supplementary elements, to avoid the cell collapsing issue described in #25362.
The legacy
Itemshandler (CV1) is intentionally not touched.The header gets its original height back when its content is made visible again.
Issues Fixed
Contributes to #30924 (iOS/Mac Catalyst only).
Testing
Axemasta/MauiRepros,GroupHeaderResizingRepro) on an iOS simulator: hiding the header now collapses its space, and showing it again restores the original height.Issue30924HostApp page and UI test. The page instantiatesCollectionView2so the test always runs against the supported handler, independently of the UI test configuration, and asserts that hiding the header collapses its space.Controls.TestCases.HostAppbuilds fornet10.0-ioswith this change.