Skip to content

Conversation

@adborbas
Copy link
Contributor

@adborbas adborbas commented Oct 16, 2025

Closes WOOMOB-1319

Description

Open booking product types in the admin web instead of native navigation.

Changes:

  • Introduced ProductDetailNavigator as the sole entry point for opening product details. Encapsulates the logic to either open in native or web.
  • Added ProductDetailCoordinatorFactory, which is responsible for creating either a web or a native ProductDetailCoordinator.
  • ProductDetailNativeCoordinator: Returns a UIViewController for opening the product details in native.
  • ProductDetailWebCoordinator: Returns a UIViewController for opening the product details in webview.
  • ProductAdminURLProvider: Responsible for generating the amin edit url for a Product.
  • Replaced all the ProductDetailsFactory.productDetails usage with ProductDetailNavigator.shared.makeDestination
  • Once we have native support for CIAB booking products, we can simply update ProductDetailNavigator to always return a native viewcontroller.

Steps to reproduce

You'll need to execute two test cases, as currently no test site is both CIAB-enabled and has the new web admin.

  1. Validate the redirection logic.

    1. Log in to a CIAB store that has boot booking and non-booking products.
    2. Navigate to "Products"
    3. Tap on a booking type product.
    4. Note that the web view should open.
    5. Navigate to "Products"
    6. Tap on a NON booking type product.
    7. Note that the native editor is open.
  2. Validate the admin url.

    1. Checkout the branch locally and mock shouldOpenInWeb in ProductDetailNavigator to always return true.
    2. Log in to this site.
    3. Navigate to "Products"
    4. Tap on a booking type product.
    5. Note that the web view should open.
    6. You'll need to wait for a while, but eventually the admin edit should open.

Simulator Screen Recording - iPhone 17 Pro - 2025-10-21 at 14 03 49

Testing information

Tested on iPhone 17 Pro simulator and device.


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

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 16, 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 Numberpr16250-5002b37
Version23.5
Bundle IDcom.automattic.alpha.woocommerce
Commit5002b37
Installation URL619eqtsc7305o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@adborbas adborbas force-pushed the adborbas/woomob-1319 branch 5 times, most recently from 6e0b6e6 to 5e6f2a2 Compare October 21, 2025 11:59
@adborbas adborbas changed the title Adborbas/woomob 1319 Open CIAB booking products in web Oct 21, 2025
@adborbas adborbas marked this pull request as ready for review October 21, 2025 12:06
@adborbas adborbas added this to the 23.6 milestone Oct 21, 2025
@adborbas adborbas added the type: task An internally driven task. label Oct 21, 2025
@RafaelKayumov RafaelKayumov self-assigned this Oct 21, 2025
Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

Pre-approving.
In my testing both native and web product form is presented for non-booking and booking products correspondingly. Left a couple of comments.

func viewController(product: Product,
presentationStyle: ProductDetailNavigator.Presentation,
isReadOnly: Bool,
onDelete: (() -> Void)? = nil) -> UIViewController {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't see the onDelete being assigned upon init.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well observed, yeah, this is a bit of a stretch, but we only need this to implement the protocol. And since the native version uses the onDelete I had to expose it here as well.

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've decided to split the native and web viewController creation even more to not have these unused parameters hanging around.

}

@objc
private func dismissWebView() {
Copy link
Contributor

Choose a reason for hiding this comment

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

dismissWebView() doesn't seem to get called anywhere. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No you are not, I have removed the callback somewhere along the way. I'll need to readd it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for point this out @RafaelKayumov, this actually showed that I'm was not using the dismiss anywhere on the caller side. I've added a callback to ProductsViewController so that the list of products refreshes when the webview is closed or navigated back.

@adborbas adborbas force-pushed the adborbas/woomob-1319 branch from d6c4eed to 257d8eb Compare October 22, 2025 10:41
@adborbas adborbas merged commit 1fac92b into trunk Oct 22, 2025
13 checks passed
@adborbas adborbas deleted the adborbas/woomob-1319 branch October 22, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants