[Net11] Revert Improve label mapping performance and ensure complete coverage including ToPlatform and subsequent property changes - #37087
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37087Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37087" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR aims to revert the behavioral and test changes introduced by PR #35892 on release/11.0.1xx-preview7, primarily around iOS text formatting/mapper behavior (Label/Entry/Editor/SearchBar/Button) and FeatureMatrix UI tests that validate screenshot baselines.
Changes:
- Reverts/adjusts iOS handler/platform text formatting flows (including when formatting is re-applied after text changes).
- Updates Controls FeatureMatrix HostApp pages and Shared UI tests to align with the reverted behavior and reduce flakiness.
- Removes prior “recreate page to verify initial mappers” tap handlers and related UI toggles used by the tests.
Reviewed changes
Copilot reviewed 40 out of 136 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/src/Platform/iOS/TextFieldExtensions.cs | Updates Entry placeholder formatting logic (includes character-spacing application). |
| src/Core/src/Platform/iOS/SearchBarExtensions.cs | Updates SearchBar placeholder formatting logic (includes character-spacing application). |
| src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs | Adjusts iOS SearchBar text/formatting mapping behavior. |
| src/Core/src/Handlers/SearchBar/SearchBarHandler.cs | Reorders SearchBar mapper entries. |
| src/Core/src/Handlers/Label/LabelHandler.iOS.cs | Adjusts iOS Label text mapping to re-apply formatting on text updates. |
| src/Core/src/Handlers/Label/LabelHandler.cs | Restructures Label mapper ordering/contents. |
| src/Core/src/Handlers/Entry/EntryHandler.iOS.cs | Adjusts iOS Entry text mapping to re-apply formatting on text updates. |
| src/Core/src/Handlers/Entry/EntryHandler.cs | Restructures Entry mapper ordering/priority mapper usage. |
| src/Core/src/Handlers/Editor/EditorHandler.iOS.cs | Adjusts iOS Editor text mapping to re-apply formatting on text updates. |
| src/Core/src/Handlers/Editor/EditorHandler.cs | Reorders Editor mapper entries. |
| src/Core/src/Handlers/Button/ButtonHandler.iOS.cs | Adjusts iOS Button text mapping to re-apply formatting on text updates. |
| src/Core/src/Handlers/Button/ButtonHandler.cs | Reorders Button text mapper entries. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/Material3LabelFeatureTests.cs | Updates Material3 Label FeatureMatrix UI test steps (options navigation/taps/screenshots). |
| src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/LabelFeatureTests.cs | Updates Label FeatureMatrix UI test steps (removes extra tap/screenshot sequences). |
| src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/EntryFeatureTests.cs | Updates Entry FeatureMatrix UI test steps and removes focus-clearing helper usage. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ButtonFeatureTests.cs | Updates Button FeatureMatrix UI test steps (removes extra tap/screenshot sequences). |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/Label/LabelViewModel.cs | Changes default Label FeatureMatrix VM state (FormattedText + LineHeight defaults). |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/Label/LabelOptionsPage.xaml.cs | Removes “SimpleFormattedText” checkbox handler. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/Label/LabelOptionsPage.xaml | Removes “SimpleFormattedText” checkbox UI. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/Label/LabelControlPage.xaml.cs | Removes “tap to recreate page” handler. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/Label/LabelControlPage.xaml | Removes tap gesture recognizer and re-indents markup. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/EntryControl/EntryOptionsPage.xaml | Removes a FontSize override on an alignment option button. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/EntryControl/EntryControlPage.xaml.cs | Removes “tap to recreate page” handler and internals usage. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/EntryControl/EntryControlPage.xaml | Removes MainLabel automation/tap gesture used for page recreation. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/Button/ButtonControlPage.xaml.cs | Removes “tap to recreate page” handler and internals usage. |
| src/Controls/tests/TestCases.HostApp/FeatureMatrix/Button/ButtonControlPage.xaml | Removes MainLabel automation/tap gesture used for page recreation. |
| src/Controls/src/Core/SearchBar/SearchBar.Mapper.cs | Changes TextTransform mapping to reuse MapText and removes dedicated MapTextTransform. |
| src/Controls/src/Core/SearchBar/SearchBar.iOS.cs | Ensures MapText always triggers formatting refresh on iOS. |
| src/Controls/src/Core/SearchBar/SearchBar.Android.cs | Removes Material3-specific MapTextTransform overload. |
| src/Controls/src/Core/Platform/iOS/Extensions/FormattedStringExtensions.cs | Adjusts overloads/parameter ordering for ToNSAttributedString and line-break handling. |
| src/Controls/src/Core/Label/Label.Mapper.cs | Adjusts formatted-text/text-color mapping behavior during handler connection. |
| src/Controls/src/Core/Label/Label.iOS.cs | Ensures MapText always triggers formatting refresh on iOS. |
| src/Controls/src/Core/Entry/Entry.Mapper.cs | Changes TextTransform mapping to reuse MapText and removes dedicated MapTextTransform. |
| src/Controls/src/Core/Entry/Entry.iOS.cs | Ensures MapText always triggers formatting refresh on iOS. |
| src/Controls/src/Core/Entry/Entry.Android.cs | Removes Material3-specific MapTextTransform overload. |
| src/Controls/src/Core/Editor/Editor.Mapper.cs | Changes TextTransform mapping to reuse MapText and removes dedicated MapTextTransform. |
| src/Controls/src/Core/Editor/Editor.iOS.cs | Always re-applies CharacterSpacing after text updates on iOS. |
| src/Controls/src/Core/Editor/Editor.Android.cs | Removes Material3-specific MapTextTransform overload. |
| src/Controls/src/Core/Button/Button.Mapper.cs | Changes TextTransform mapping to reuse MapText and removes dedicated MapTextTransform. |
| src/Controls/src/Core/Button/Button.iOS.cs | Removes formatting refresh call during iOS Button MapText. |
Suppressed comments (1)
src/Controls/tests/TestCases.HostApp/FeatureMatrix/Label/LabelViewModel.cs:66
LineHeightfor Label defaults to -1 (unset). Initializing the view model field to 0 will cause the sample Label to always apply a 0 line-height multiplier via binding, which can collapse text/layout and skew feature-matrix screenshots.
| textField.AttributedPlaceholder = foregroundColor == null | ||
| ? new NSAttributedString(placeholder) | ||
| : new NSAttributedString(str: placeholder, foregroundColor: foregroundColor.ToPlatform()); | ||
|
|
||
| textField.AttributedPlaceholder = attrPlaceholder.WithCharacterSpacing(entry.CharacterSpacing) ?? attrPlaceholder; | ||
| textField.AttributedPlaceholder.WithCharacterSpacing(entry.CharacterSpacing); |
| var placeholder = searchBar.Placeholder ?? string.Empty; | ||
| var placeholderColor = searchBar.PlaceholderColor is Color color ? color.ToPlatform() : ColorExtensions.PlaceholderColor; | ||
| var attributed = new NSAttributedString(str: placeholder, foregroundColor: placeholderColor); | ||
| textField.AttributedPlaceholder = attributed.WithCharacterSpacing(searchBar.CharacterSpacing) ?? attributed; | ||
| textField.AttributedPlaceholder = new NSAttributedString(str: placeholder, foregroundColor: placeholderColor); | ||
| textField.AttributedPlaceholder.WithCharacterSpacing(searchBar.CharacterSpacing); | ||
| } |
There was a problem hiding this comment.
Code review verdict: READY TO MERGE
Compatibility baseline: whether this PR breaks behavior that worked in .NET 11 Preview 6.
After comparing PR head 7d29cfaa4ae492f47ada286a47eb249c702a2ee8 directly with Preview 6 commit/tag e7264838d83d55430b219a23cc0e5da6e8b04e9a, there are no actionable code/test correctness findings under that baseline:
- The placeholder
CharacterSpacingimplementation is identical to Preview 6. - The direct
MapFormattingplatform calls are identical to Preview 6. - The single-pass Button/Entry/Label feature tests are identical to Preview 6.
- The iOS FormattedString/LineBreakMode implementation is identical to Preview 6.
The earlier candidates are real behavior differences versus Preview 7 after #35892 landed on August 1, but they are improvements/coverage introduced by #35892—not behavior that worked in Preview 6. This PR restores the Preview 6 behavior as intended.
What looks right: the rollback is tightly scoped as the 136-file inverse of #35892 while preserving intervening public API modifier changes.
Prior review status: the earlier Copilot placeholder-spacing comments describe the loss relative to post-#35892 Preview 7, but do not represent Preview 6 compatibility regressions.
Methodology: 3 independent reviewers with adversarial consensus + repo domain specialist, reconciled against the explicit Preview 6 compatibility baseline.
8a58e7c
into
dotnet:release/11.0.1xx-preview7
Issue Details
After merging PR #35892 into the .NET 11 Preview 7 branch, several UITests and device tests started failing in CI. The failures were observed across multiple test runs and were not consistently reproducible during manual verification. Based on the CI results, the failures appear to be introduced by the changes included in PR #35892.
Description of Changes
Reverted the changes introduced by PR #35892 from the .NET 11 Preview 7 branch.