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

[Woo POS] Design iteration on Simple Products banner #13940

Merged

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Sep 12, 2024

Closes: #13939

Description

This PR updates the Simple Products banner following the design feedback on #13859 and TfaZ4LUkEwEGrxfnEFzvJj-fi-4650_22247

Before After
Simulator Screenshot - iPad Air 11 - iOS 17 5 M2 - 2024-09-12 at 16 29 23 Simulator Screenshot - iPad Air 11 - iOS 17 5 M2 - 2024-09-12 at 16 22 32

Changes

  • Removed spacing in banner's HStack. This caused the icon to show un-even spacing to the right.
Screenshot 2024-09-12 at 16 30 54
  • Adjusted text to fill out more available space, while aligned to the left
Screenshot 2024-09-12 at 16 34 17
  • Update Learn More to be interpolated within the rest of the text, rather than appearing on a separate line. Also adjusted the height between lines.
Screenshot 2024-09-12 at 16 35 05

Testing

  • Run a fresh app install, or add the following line to the ItemListViewModel init:
UserDefaults.standard.set(false, forKey: BannerState.isSimpleProductsOnlyBannerDismissedKey)
  • Run the POS and observe the Simple Products banner appears
  • Observe that the items above have been addressed:
    • Even spacing to both sides of the (i) icon
    • Text is occupying more available space
    • "Learn More" appears as follow-up to the rest of the text, rather than on a separate line

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: POS labels Sep 12, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 12, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr13940-416b8ba
Version20.3
Bundle IDcom.automattic.alpha.woocommerce
Commit416b8ba
App Center BuildWooCommerce - Prototype Builds #10854
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@iamgabrielma iamgabrielma marked this pull request as ready for review September 12, 2024 09:40
@iamgabrielma iamgabrielma added this to the 20.4 milestone Sep 12, 2024
@staskus staskus self-assigned this Sep 12, 2024
Copy link
Collaborator

@staskus staskus left a comment

Choose a reason for hiding this comment

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

✅ Excellent! Thanks for a helpful description with images.

I left one comment for the font of Learn more text.

private var bannerHintAndLearnMoreText: Text {
Text(Localization.headerBannerHint + " ") +
Text(Localization.headerBannerLearnMoreHint)
.font(.body)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the text and learn more button should be posDetailEmphasized

Suggested change
.font(.body)
.font(.posDetailEmphasized)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed! 7acf98a , interestingly we have to declare the type and cast to font() or the types don't match and the compiler is unhappy.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, interesting. I played around and something like this worked. Likely related to the fact that we're appending two Texts here.

    private var bannerHintAndLearnMoreText: some View {
        (Text(Localization.headerBannerHint + " ") +
        Text(Localization.headerBannerLearnMoreHint))
            .font(.posDetailEmphasized)
            .foregroundColor(Color(.accent))
    }

@@ -109,6 +108,13 @@ private extension ItemListView {
.padding(.horizontal, Constants.bannerCardPadding)
}

private var bannerHintAndLearnMoreText: Text {
Text(Localization.headerBannerHint + " ") +
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's crazy how easy it is just to append two Text objects on SwiftUI. Much harder to archieve the same effect on UIKit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't looking forward to attributed strings, definitely an improvement :D

@iamgabrielma iamgabrielma modified the milestones: 20.4, 20.5 Sep 13, 2024
@iamgabrielma iamgabrielma modified the milestones: 20.5, 20.4 Sep 13, 2024
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 20.4. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@iamgabrielma iamgabrielma merged commit ac14cb7 into trunk Sep 13, 2024
13 checks passed
@iamgabrielma iamgabrielma deleted the task/13939-pos-update-products-banner-design-feedback branch September 13, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: POS type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS] Design iteration on Simple Products banner
4 participants