Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the onboarding OTP entry behavior (aiming to address a number-pad submission/dismissal issue) and adjusts in-app support contact details in Profile and Legal/Compliance screens.
Changes:
- Adds
onSubmithandling and a.donesubmit label to the hidden OTP text field, and dismisses focus once the OTP reaches the expected length. - Makes “Connect with Us” in Profile open a
mailto:link to support. - Updates the displayed contact email (and accessibility label) in the Global Rights screen.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
MomCare+/MomCare+/Views/ProfileScreens/ProfileView.swift |
Adds openURL usage and a tap action to open a support mailto link from the footer. |
MomCare+/MomCare+/Views/ProfileScreens/Legal&Compliance/GlobalRightsView.swift |
Replaces the contact email string and updates its accessibility label. |
MomCare+/MomCare+/Views/OnboardingScreens/OTPScreenView.swift |
Adds submit handling and focus dismissal logic for the OTP input field. |
| } | ||
| } | ||
| } | ||
| .submitLabel(.done) |
There was a problem hiding this comment.
onSubmit/.submitLabel(.done) won’t be triggered/shown for a .keyboardType(.numberPad) field (number pad has no return/submit key). If the goal is to let users dismiss/submit from the keypad, add a keyboard toolbar “Done/Verify” button (or change the keyboard type to one that supports submit) and invoke the same submit path from there.
| .submitLabel(.done) | |
| .submitLabel(.done) | |
| .toolbar { | |
| ToolbarItemGroup(placement: .keyboard) { | |
| Spacer() | |
| Button("Verify") { | |
| isFieldFocused = false | |
| Task { | |
| do { | |
| try await handleSubmit() | |
| } catch { | |
| controlState.error = error | |
| } | |
| } | |
| } | |
| } | |
| } |
| .onSubmit { | ||
| Task { | ||
| do { | ||
| try await handleSubmit() | ||
| } catch { | ||
| controlState.error = error | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
The OTP submit flow is now duplicated in both verifyButton and the new onSubmit handler (creating separate Task { do/try/await ... } blocks). Consider extracting this into a single private submitOTP() helper to keep behavior consistent and avoid future drift.
| .multilineTextAlignment(.center) | ||
|
|
||
| Text("privacy@momcare.com") | ||
| Text("support.momcare@vision-labs.site") |
There was a problem hiding this comment.
The copy says requests go to a “dedicated privacy team”, but the contact address shown is now a general support email. Either update the wording to match the support contact, or use a privacy-specific email address so the UI text remains accurate.
| Text("support.momcare@vision-labs.site") | ||
| .font(.headline) | ||
| .fontWeight(.semibold) | ||
| .foregroundColor(accentColor) | ||
| .padding(.vertical, 12) | ||
| .padding(.horizontal, 24) | ||
| .background(Color.gray.opacity(0.1)) | ||
| .clipShape(Capsule()) | ||
| .accessibilityLabel("Contact email: privacy@momcare.com") | ||
| .accessibilityLabel("Contact email: support.momcare@vision-labs.site") |
There was a problem hiding this comment.
PR title indicates a “numpad issue” fix, but this PR also changes the public contact email address and adds a mailto action in Profile. If these are intentional, consider updating the PR title/description or splitting into a separate PR so review and release notes match the actual scope.
| Text("Connect with Us") | ||
| .foregroundStyle(Color("primaryAppColor")) | ||
| .fontWeight(.medium) | ||
| .onTapGesture { | ||
| let url = "mailto:support.momcare@vision-labs.site" | ||
| if let mailURL = URL(string: url) { | ||
| openURL(mailURL) | ||
| } | ||
| } |
There was a problem hiding this comment.
Text("Connect with Us") is made tappable via onTapGesture, which doesn’t expose proper button/link semantics to accessibility (VoiceOver won’t announce it as a link/button, and it won’t be discoverable via Switch Control/keyboard navigation). Prefer using a Button or Link styled as plain text, and add appropriate accessibility label/traits.
| Text("Connect with Us") | |
| .foregroundStyle(Color("primaryAppColor")) | |
| .fontWeight(.medium) | |
| .onTapGesture { | |
| let url = "mailto:support.momcare@vision-labs.site" | |
| if let mailURL = URL(string: url) { | |
| openURL(mailURL) | |
| } | |
| } | |
| Button { | |
| let urlString = "mailto:support.momcare@vision-labs.site" | |
| if let mailURL = URL(string: urlString) { | |
| openURL(mailURL) | |
| } | |
| } label: { | |
| Text("Connect with Us") | |
| .foregroundStyle(Color("primaryAppColor")) | |
| .fontWeight(.medium) | |
| } | |
| .buttonStyle(.plain) | |
| .accessibilityLabel("Connect with MomCare support") | |
| .accessibilityHint("Opens your email app to contact support.") |
| .onTapGesture { | ||
| let url = "mailto:support.momcare@vision-labs.site" | ||
| if let mailURL = URL(string: url) { | ||
| openURL(mailURL) |
There was a problem hiding this comment.
The support email address is hardcoded here as a mailto: string, and the same email is also embedded in GlobalRightsView. To avoid the two screens drifting out of sync later, consider centralizing the address (e.g., a shared constant) and building the mailto: URL from that constant.
No description provided.