-
Notifications
You must be signed in to change notification settings - Fork 111
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
[Mobile Payments] Fix trying out Tap to Pay is no-op from the About TTP screen #14340
[Mobile Payments] Fix trying out Tap to Pay is no-op from the About TTP screen #14340
Conversation
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but I think there might be a better place to make the change. Or, perhaps we have a too-confusing view set up for this flow and should simplify it to make this the right place for the change, I'm not sure.
We present this from two places, the payments menu, and the About TTP screen.
There's a slight difference between the two at the moment; the TapToPaySettingsFlowPresentingView
presented from the menu is wrapped in a NavigationStack
, while the PaymentSettingsFlowPresentingView
presented from the about TTP screen is wrapped in a NavigationView
.
I think we could instead use TapToPaySettingsFlowPresentingView
from both (it's a convenience wrapper for PaymentSettingsFlowPresentingView
) and use NavigationStack
either in the sheets when they're presented, or in the TapToPaySettingsFlowPresentingView
.
Alternatively we might keep it where it is in this PR, but take away some of the extra nav stacks higher up?
All these need a little care to make sure we don't double up the nav bars (which are hidden in some cases), but I think we may have more than we need at the moment...
Up to you but just wanted to point this out so you could check the best way before merging...
N.B. Try a Payment works fine from About when I change the NavigationView
in AboutTapToPayView
's sheet to a NavigationStack
on trunk
, without this PR's changes. However, the onboarding screens it can show before setting up get a nav bar they shouldn't have, but only when shown for the first time on a given store... which is strange. This doesn't happen with the extra stack approach from your PR. So that might be enough reason to just merge as is without digging further in to it!
* trunk: (70 commits) Update WooSavedPackagesSelectionView.swift Update WooSavedPackagesSelectionView.swift Remove workaround now that we have the right fix for the issue Update WooShippingAddCustomPackageViewModelTests.swift Update WooSavedPackagesSelectionView.swift Update WooSavedPackagesSelectionView.swift Update WooSavedPackagesSelectionView.swift Update carriers list Renaming and remove WooCarrierPackageData Update WooCarrierPackagesSelectionView.swift Refactor WooPackageDataRepresentable to have specific values Add Release note Update Zendesk sdk to 9.0.0 to solve bitcode issue with Xcode 16 Add workaround to strip bitcode from Zendesk frameworks Freeze strings for localization Update metadata strings Show simplified inventory row when the global unique identifier is not empty Add test for the edition of the global unique identifier 14304 Order editing currency limitation to 21.2 Update release notes for 21.1 ...
…avigationDestination`s." This reverts commit 7295710.
…iew` with `SetUpTapToPayViewModelsOrderedList`.
…bar hidden by default.
…-from-about-ttp * issue/14078-rebase: (60 commits) Use `TapToPaySettingsFlowPresentingView` for both use cases with toolbar hidden by default. Ensure `NavigationStack` is on top of `PaymentSettingsFlowPresentingView` with `SetUpTapToPayViewModelsOrderedList`. Revert "Wrap TTP prompt view inside a `NavigationStack` to support `navigationDestination`s." Move release notes entry to 21.2. Update WooSavedPackagesSelectionView.swift Update WooSavedPackagesSelectionView.swift Remove workaround now that we have the right fix for the issue Update WooShippingAddCustomPackageViewModelTests.swift Update WooSavedPackagesSelectionView.swift Update WooSavedPackagesSelectionView.swift Update WooSavedPackagesSelectionView.swift Update carriers list Renaming and remove WooCarrierPackageData Update WooCarrierPackagesSelectionView.swift Refactor WooPackageDataRepresentable to have specific values Add Release note Update Zendesk sdk to 9.0.0 to solve bitcode issue with Xcode 16 Add workaround to strip bitcode from Zendesk frameworks Freeze strings for localization Update metadata strings ...
* trunk: Move release notes entry to 21.2. Update test cases that are based on the feature flag being enabled. Disable `subscriptionsInOrderCreationCustomers` feature. 14350 Show ghost cell when pulling to refresh 14350 fix visual glitch when reloading from errors 14350 Add warning to prevent people using items 14350 Fix animation glitch on pull-to-refresh 14350 don’t hide simple products banner in refresh 14350 Rename next page loading state 14350 Use ItemListState to populate item list Add unit tests for WooShippingStore 14350 loading ItemListState with existing items 14350 improve second page ItemList tests 14350 Extract ItemListState to new file Add WooShippingAction and WooShippingStore Update release notes. Update `cardPresentPluginHasPendingTasksURL` from Payments Overview to Payments Connect based on web team recommendation.
@joshheald great point on checking the two entry points, and the documentation of Lines 83 to 87 in 9a9b909
As you mentioned, there's some unexpected navigation bar behavior because the views are presented differently in the two entry points. The use of UIHostingController and wrapping of The PR is ready for another look and let me know if you find any issues / have any other suggestions! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works really well, thanks for the improvements here :)
Closes: #14078
Why
In Payments > About Tap To Pay > Set Up Tap To Pay on iPhone > Try a Payment: in production, nothing happens after the spinner stops as in the "before" screencast below. This is confusing and a broken flow as the merchant cannot test out the payment with Tap To Pay.
How
From debugging, the issue was because
navigationDestination
does not work when the SwiftUI view is not within aNavigationStack
/NavigationView
. In this PR, the top-level view is now wrapped in aNavigationStack
and the navigation works as expected.Steps to reproduce
Testing information
Screenshots
before:
RPReplay_Final1730962609.MP4
after:
RPReplay_Final1730962775.MP4
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: