KEMBAR78
Revert "ToolbarItem behavior with ImageSource iOS - fix (#28833)" by PureWeen · Pull Request #31112 · dotnet/maui · GitHub
Skip to content

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Aug 11, 2025

Description of Change

This reverts commit 5860fe6 on PR #28833

This pull request addresses issues with the rendering and color of ToolbarItem icons and text on iOS, specifically when changing the navigation bar text color (BarTextColor). It introduces a new test case and updates the icon rendering logic to ensure consistent behavior. Additionally, it disables a failing test on iOS and Catalyst platforms.

Improvements to ToolbarItem rendering and color handling:

  • Updated UpdateIconAndStyle in ToolbarItemExtensions.cs to simplify and standardize image assignment for toolbar icons, ensuring icons are always rendered as provided and not altered based on their source type.

New test coverage for ToolbarItem color changes:

  • Added a new sample issue page (Issue30818.cs) demonstrating and testing toolbar item icon and bar text color changes via UI buttons, with comments about a known issue and links to follow-up work.
  • Introduced a new UI test (Issue30818.cs) for iOS that verifies toolbar item color changes when BarTextColor is set to red, green, or reset, including screenshot verification for each state.

Test stability improvements:

  • Disabled the failing toolbar item rendering test (Issue28822.cs) on iOS and Catalyst platforms by wrapping its code in preprocessor directives, referencing the related GitHub issue. [1] [2]

Issues Fixed

Fixes #30818

@Copilot Copilot AI review requested due to automatic review settings August 11, 2025 17:56
@PureWeen PureWeen requested a review from a team as a code owner August 11, 2025 17:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request reverts a previous commit (#28833) that attempted to fix ToolbarItem behavior with ImageSource on iOS. The revert is accompanied by new test coverage to validate ToolbarItem color behavior when BarTextColor is changed, and disables a failing test on iOS/Catalyst platforms.

  • Reverts changes to ToolbarItem icon rendering logic in ToolbarItemExtensions.cs
  • Adds comprehensive test coverage for ToolbarItem color changes with custom BarTextColor
  • Disables failing test on iOS/Catalyst to improve test stability

Reviewed Changes

Copilot reviewed 4 out of 9 changed files in this pull request and generated 4 comments.

File Description
src/Controls/src/Core/Compatibility/iOS/Extensions/ToolbarItemExtensions.cs Reverts icon rendering logic to remove AlwaysOriginal rendering mode handling
src/Controls/tests/TestCases.HostApp/Issues/Issue30818.cs Adds UI test page demonstrating ToolbarItem color changes with BarTextColor
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30818.cs Implements automated UI test for ToolbarItem color verification
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28822.cs Disables failing test on iOS/Catalyst platforms with preprocessor directives

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the blue that is now lost and is a breaking change on SR9 which is why we are reverting this

…818.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@PureWeen
Copy link
Member Author

/backport to release/9.0.1xx-sr9

@github-actions
Copy link
Contributor

Started backporting to release/9.0.1xx-sr9: https://github.com/dotnet/maui/actions/runs/16888115034

@@ -0,0 +1,39 @@
#if IOS
Copy link
Member Author

@PureWeen PureWeen Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this is just iOS right now, but, I want to get this merged for SR10/SR9.1 and we don't currently need to generate the screen shots for the other platforms in order to merge this.

I'll do a followup PR to get the rest of the platforms baselined.

mattleibow
mattleibow previously approved these changes Aug 11, 2025
@PureWeen
Copy link
Member Author

/backport to release/9.0.1xx-sr9

@github-actions
Copy link
Contributor

Started backporting to release/9.0.1xx-sr9: https://github.com/dotnet/maui/actions/runs/16890586009

@PureWeen
Copy link
Member Author

  • failing tests unrelated

@PureWeen PureWeen merged commit c3661fd into main Aug 11, 2025
124 of 129 checks passed
@PureWeen PureWeen deleted the fix-30818-revert branch August 11, 2025 22:16
SuthiYuvaraj pushed a commit to SuthiYuvaraj/maui that referenced this pull request Aug 12, 2025
…" (dotnet#31112)

* Revert "ToolbarItem behavior with ImageSource iOS - fix (dotnet#28833)"

This reverts commit 5860fe6.

* Update src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30818.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* - fix define on testing

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jfversluis pushed a commit to Tamilarasan-Paranthaman/maui that referenced this pull request Aug 12, 2025
…" (dotnet#31112)

* Revert "ToolbarItem behavior with ImageSource iOS - fix (dotnet#28833)"

This reverts commit 5860fe6.

* Update src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30818.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* - fix define on testing

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
rmarinho pushed a commit that referenced this pull request Aug 13, 2025
…1112)

* Revert "ToolbarItem behavior with ImageSource iOS - fix (#28833)"

This reverts commit 5860fe6.

* Update src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30818.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* - fix define on testing

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] 9.0.90 breaks ToolbarItem template color for IconImageSources

2 participants