Skip to content

[Order details] Capitalize addresses and surname by word #15611

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

Merged
merged 8 commits into from
May 14, 2025

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented May 9, 2025

Closes: WOOMOB-136

Description

This PR adds a new property to TitleAndTextFieldRow which allows us to capitalize words on a text field case by case if needed, in this case, we want to capitalize addresses and surnames by word. The original issue mentions only addresses, but surnames make sense as well. Happy to add more capitalization rules but I think that's good by default.

Testing information

  • In Orders > Select an order > edit its Shipping Address and/or Billing Information
  • Play around with the textfields, observe that addresses and surnames will capitalize words, while the rest of fields will do it per sentence-basis

Simulator Screen Recording - iPhone 16 - US store - 2025-05-09 at 12 56 52

Changes are only on 586a651 , the rest of commits are to clean up some string duplications I found within the same path.


  • 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 feature: order details Related to order details. Enhancement labels May 9, 2025
@iamgabrielma iamgabrielma added this to the 22.4 milestone May 9, 2025
@iamgabrielma iamgabrielma marked this pull request as ready for review May 9, 2025 06:19
@iamgabrielma iamgabrielma requested a review from itsmeichigo May 9, 2025 06:19
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 9, 2025

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

App NameWooCommerce iOS Prototype
Build Number29845
VersionPR #15611
Bundle IDcom.automattic.alpha.woocommerce
Commit84865bd
Installation URL6rp1j05mt3d3g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@iamgabrielma iamgabrielma requested review from joshheald and removed request for itsmeichigo May 9, 2025 09:56
Copy link
Contributor

@joshheald joshheald left a comment

Choose a reason for hiding this comment

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

Tests OK; small suggestion in-line.

All good, but I'd argue we should go further here:

  • First name: words
  • Company: words
  • City: words
  • Postcode: characters
  • State: words
  • Billing email: never

This is just a setting for the default shift key behaviour; those seem like safe options even though some users will need to override, it probably minimises it for most users.

@@ -31,6 +32,7 @@ struct TitleAndTextFieldRow: View {
editable: Bool = true,
fieldAlignment: TextAlignment = .trailing,
keyboardType: UIKeyboardType = .default,
textInputAutocapitalization: TextInputAutocapitalization = .sentences,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: you could probably make this a little neater by just calling it autocapitalization. I'm not sure that "text input" provides additional clarity.

It does match the SwiftUI view modifier, but I think that can be applied to a fairly wide array of controls and so might need the extra clarity.

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 22.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 enabled auto-merge May 14, 2025 11:10
@iamgabrielma iamgabrielma merged commit c774a73 into trunk May 14, 2025
13 checks passed
@iamgabrielma iamgabrielma deleted the task/woomob-136-capitalize-addresses-by-word branch May 14, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement feature: order details Related to order details.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants