Repository navigation
[iOS] Fix Label truncation after item text updates in CollectionView - #39558
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39558Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39558" |
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.
|
1 similar comment
|
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.
Performance Review Summary
Performance ResultsVerdict: 🟡 Partial/inconclusive — device measurement required The pinned diff restores an unconditional Measure call when a MeasureFirstItem cached size is reused in TemplatedCell2. No managed suites were selected, and no run manifest or comparison results were supplied; neither managed performance nor native execution is established by this evidence. Device measurement required: the supplied evidence does not cover the changed native handler path, so the whole PR cannot receive a clean performance verdict. CoverageProduct files: 1; directly managed-measured: 0; device-required: 1; static-reviewed: 0. Sampled subsets: managed 0, device 0.
Findings & Follow-upStatic hot-path reviewAt src/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cs:143, removing the _cachedConstraints != constraints guard causes virtualView.Measure to run whenever this cached-size branch is reached, including unchanged constraints. This cell-fitting path participates in CollectionView layout and recycling on iOS and MacCatalyst, so repeated measurement is a concrete unmeasured work concern; its frequency, actual child-measure work, allocations, and latency are unknown. The diff also removes item-source tracking and its constraint reset, but any savings there do not establish that the repeated-measure cost is offset. No new repeated-work concern is attributed to the reproduction page setup or its button-driven sorting. Recommended next action
Human discussion is appropriate because the changed UIKit cell-fitting path requires iOS and MacCatalyst execution, while the selected native scenario is not automated by this workflow. There is no directly measured or sampled managed coverage to substitute for that missing evidence; static inspection alone cannot establish native timing, correctness, or accessibility. Retrying managed benchmarks would not close this native gap, and the supplied test source is not execution evidence.
|
This comment has been minimized.
This comment has been minimized.
Tests Failure Analysis
🧪 CI Analysis — click to expand📊 maui-pr
🧪 maui-pr-devicetestsNo failures found. 🧪 maui-pr-uitests
🧭 Follow-up — actions and refreshNext action: Restore Layout/target evidence; compare unresolved cases with identical setup.
|
There was a problem hiding this comment.
🟡 Changes recommended
The reversion restores repeated measurement during cell recycling, so the truncation fix must preserve the scrolling optimization.
1 open issue
What changed in this PR
This PR addresses CollectionView label truncation after bound item text changes on iOS and MacCatalyst by reverting earlier measurement guards in the Items2 handler.
Changes:
- Restores measurement when a cached first-item size is used and removes ItemsSource-change tracking.
- Adds a reproduction page that updates existing items without replacing the collection.
- Adds a screenshot test after repeated item-property swaps.
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue39534.cs | Adds repeated-swap screenshot validation. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue39534.cs | Adds the bound-date-label reproduction page. |
| src/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cs | Removes the cached-constraint measurement guard and ItemsSource tracking. |
Review effort: Balanced
| { | ||
| virtualView.Measure(constraints.Width, constraints.Height); | ||
| } | ||
| virtualView.Measure(constraints.Width, constraints.Height); |
…39558) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Issue #[35859](#35859) was related to MeasureFirstItem measuring all items in CV2, so a fix was added in PR #36159. However, the changes in PR #36159 caused a regression in Issue #[38275](#38275), which was addressed in PR #38338. The current issue was also regressed by the changes in PR #36159. ### Description of Change <!-- Enter description of the fix in this section --> Gerald's PR resolves Issues 35859, 38275, and current issue([39534](#39534)). Therefore, PR #36159 and PR #38338 are being reverted to avoid duplicate fixes and regressions. ### 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 #39534 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/a1d93984-d61c-41f2-b83c-bea4e960faee" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/0f1ddc1b-c479-44a4-9530-d5065da11747" width="300" height="600"> |
…39558) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details Issue #[35859](#35859) was related to MeasureFirstItem measuring all items in CV2, so a fix was added in PR #36159. However, the changes in PR #36159 caused a regression in Issue #[38275](#38275), which was addressed in PR #38338. The current issue was also regressed by the changes in PR #36159. ### Description of Change <!-- Enter description of the fix in this section --> Gerald's PR resolves Issues 35859, 38275, and current issue([39534](#39534)). Therefore, PR #36159 and PR #38338 are being reverted to avoid duplicate fixes and regressions. ### 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 #39534 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [ ] Android - [ ] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/a1d93984-d61c-41f2-b83c-bea4e960faee" width="300" height="600"> | **iOS**<br> <video src="https://github.com/user-attachments/assets/0f1ddc1b-c479-44a4-9530-d5065da11747" width="300" height="600"> |

Issue Details
Issue #35859 was related to MeasureFirstItem measuring all items in CV2, so a fix was added in PR #36159. However, the changes in PR #36159 caused a regression in Issue #38275, which was addressed in PR #38338. The current issue was also regressed by the changes in PR #36159.
Description of Change
Gerald's PR resolves Issues 35859, 38275, and current issue(39534). Therefore, PR #36159 and PR #38338 are being reverted to avoid duplicate fixes and regressions.
Issues Fixed
Fixes #39534
Tested the behavior in the following platforms.
Before-39534.mov
After-39534.mov