Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UIColor primary #23621

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Fix UIColor primary #23621

merged 3 commits into from
Sep 26, 2024

Conversation

kean
Copy link
Contributor

@kean kean commented Sep 24, 2024

RCA

In the previous version, UIColor.primary (custom property) meant the same as UIColor.brand (blue/green).

In the new version, UIAppColor.primary maps to UIColor.label, which is incorrect. In most places where UIColor.primary was replaced with UIAppColor.primary, the app now shows incorrect colors. For example, here are three areas I found during testing:

Screenshot 2024-09-24 at 4 43 02 PM Screenshot 2024-09-24 at 5 54 20 PM Screenshot 2024-09-24 at 5 54 27 PM

The fix isn't as straightforward because in some places – the ones I found so far – UIAppColor.primary replaced other colors like UIColor.appBarText. We don't want nav bar titles to be green or blue, so it had to be address it with more code changes.

To test:

Screenshot 2024-09-24 at 5 47 29 PM

I've reviewed a bunch of scenarios that used UIAppColor.primary, but didn't have to time to check everything. I hope if there are any other issues, they will eventually bubble up. To the very least, this PR should reduce the number of issues.

Future Changes

There is still a little bit of work left to review how the brand/tint/primary colors are used and how the colors are applied in the UI.

For Jetpack, the rule of thumb should be to use green color (UIAppColor.brand) only in places where it would otherwise be hard or impossible to tell that the control is a control. The main tint color for the Jetpack app (UIAppColor.tint) is black (UIColor.label).

I would also recommend removing UIAppColor.primary as it can be confused with Color.primary from SwiftUI.

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@dangermattic
Copy link
Collaborator

dangermattic commented Sep 24, 2024

1 Warning
⚠️ This PR is assigned to the milestone 25.4. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@kean kean requested a review from jkmassel September 24, 2024 22:05
@kean kean added this to the 25.4 milestone Sep 24, 2024
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 24, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23621-cd8a5a4
Version25.3
Bundle IDorg.wordpress.alpha
Commitcd8a5a4
App Center BuildWPiOS - One-Offs #10735
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 24, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23621-cd8a5a4
Version25.3
Bundle IDcom.jetpack.alpha
Commitcd8a5a4
App Center Buildjetpack-installable-builds #9779
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

Approved, and I snuck in a small fix for widgets

static let secondaryLineColor: UIColor = UIColor(light: .quaternaryLabel, dark: .tertiaryLabel)
static let primaryLineColorViews: UIColor = UIAppColor.blue(.shade50)
static let primaryLineColorVisitors: UIColor = UIAppColor.purple(.shade50)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The charts like "Insights" and "Subscribers" are designed to use these colors in both wpios and jpios to match wp.com. It is a current production behavior based on the customer feedback. The green color is not great for charts because it implies "growth" and can be confusing.

There seem to be an issue with the empty charts:

Screenshot 2024-09-25 at 6 49 42 AM

Let's make sure the changes match the current production behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be resolved now, merging.

@jkmassel jkmassel added this pull request to the merge queue Sep 26, 2024
Merged via the queue into trunk with commit f3e3627 Sep 26, 2024
23 of 24 checks passed
@jkmassel jkmassel deleted the task/fix-some-more-colors branch September 26, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants