Skip to content
New issue

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

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

Already on GitHub? # to your account

[Woo POS] Improve Checkout view adaptability to large font sizes #15153

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

staskus
Copy link
Contributor

@staskus staskus commented Feb 14, 2025

Closes: #15123

Before tackling #15152, I'm updating the view to better support larger accessibility sizes

Description

The idea was to play with layoutPriority. However, it only works up to the point, we need to give permission for views to shrink, either by making resizable images (.resizable) or resizable texts (.minimumScaleFactor). Also, TotalsView texts are large enough for non-scroll view, so I decided to limit the size with dynamicTypeSizerange.

Changes:

  • Updated POSFontStyleto support dynamicTypeSizerange, replaced existing UIContentSizeusage
  • Updated payment state views to either hide images or shrink images when accessibility increased
  • Updated priorities and limited text growth within `TotalsView``

Steps to reproduce

I suggest testing with:

  • Common size device - iPad Air / Pro
  • Small size device - iPad Mini

Test these checkout states with different accessibility sizes:

  • Waiting for reader
  • Waiting to tap/swipe card
  • Order preparation errors
  • Payment success

Testing information

Tested with iPad Air M2 and iPad Mini A17

Screenshots

iPad.mini.A17.Pro.Accessibility.mp4

  • 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.

@staskus staskus added type: bug A confirmed bug. category: accessibility Related to accessibility. feature: POS labels Feb 14, 2025
@staskus staskus added this to the 21.8 milestone Feb 14, 2025
@staskus staskus requested a review from iamgabrielma February 14, 2025 17:14
@staskus staskus changed the title Fix/15123 woo pos cash payment button accessibility [Woo POS] Improve Checkout view accessibility Feb 14, 2025
@staskus staskus changed the title [Woo POS] Improve Checkout view accessibility [Woo POS] Improve Checkout view adaptability to large font sizes Feb 14, 2025
@wpmobilebot
Copy link
Collaborator

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 Numberpr15153-800dfb6
Version21.7
Bundle IDcom.automattic.alpha.woocommerce
Commit800dfb6
App Center BuildWooCommerce - Prototype Builds #12974
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@iamgabrielma iamgabrielma self-assigned this Feb 17, 2025
Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

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

Looks great! Experience is much better now for larger accessibility sizes 🚢

Updated payment state views to either hide images or shrink images when accessibility increased

Yes, IMHO this is something we don't do often enough 👏

I've logged several accessibility-related issues I've found while testing, but unrelated to your changes:

#15161
#15162
#15163

Comment on lines +125 to +127
private var bannerHintAndLearnMoreText: some View {
Text("\(headerBannerHint) \(Localization.headerBannerLearnMoreHint)")
.font(.posBodySmallBold)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use something like String.localizedStringWithFormat( ... ) here rather than string concatenation? For localization in case of sites/app settings running RTL languages

Copy link
Contributor Author

@staskus staskus Feb 17, 2025

Choose a reason for hiding this comment

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

Good question. It also depends how we want to present this part. On Android, only "Learn more" is presented in primary color while on iOS we show these two sentences from a new line. Either way, "Learn more" looks to be designed to be shown in a new sentence.

@staskus staskus merged commit e4a3275 into trunk Feb 17, 2025
25 of 32 checks passed
@staskus staskus deleted the fix/15123-woo-pos-cash-payment-button-accessibility branch February 17, 2025 11:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
category: accessibility Related to accessibility. feature: POS type: bug A confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS] Cash Payment button doesn't fit for large accessibility sizes
3 participants