Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Sep 19, 2025

Part of WOOMOB-1363

Description

This PR adds a new tab for Bookings for CIAB sites with existing bookable products. Due to potential changes in the base branch, there will be updates to where the eligibility check is called, but the rest of the code should be ready for testing.

Testing steps

  • Create a new CIAB site using the Garden API tool if you haven't got one already.
  • Add a bookable product to the site if it has none.
  • Log in to the site on the app. Confirm that Bookings tab is available. Please ignore the placeholder content for now.
  • Switch to a non-CIAB site. Confirm that Bookings tab is not available.

Testing information

Tested the app with simulator iPhone 17 and iPad Mini iOS 26.

Screenshots

Simulator Screenshot - iPhone 17 - 2025-09-19 at 15 25 47
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 23.4 milestone Sep 19, 2025
@itsmeichigo itsmeichigo added the type: task An internally driven task. label Sep 19, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 19, 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 Numberpr16153-7198db0
Version23.3
Bundle IDcom.automattic.alpha.woocommerce
Commit7198db0
Installation URL1k2uab0ph6v40
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review September 22, 2025 02:56
Base automatically changed from WOOMOB-1363-hide-POS-tab-for-CIAB-sites to trunk September 22, 2025 07:58
We need to wait for the full site model and update the tabs in observeConditionalTabsAvailabilityWith(_:Site)
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.

Thx for the fix

@RafaelKayumov RafaelKayumov self-requested a review September 23, 2025 07:54
@RafaelKayumov
Copy link
Contributor

Hey @itsmeichigo. Sry I accidentally put an approval here while looking at the over PR. I'll make a proper review for this one tonight. Don't yet merge.

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.

LGTM. Works as described. I can see bookings tab on a CIAB site with bookable products. It disappears after switching to a regular site.

We should include a testing step to add bookable product to the CIAB testing store to have the "Bookings" tab presented. I forgot about that requirement myself and couldn't get the tab displayed for a while 😅

Also I noticed that after adding a bookable product on site and refreshing a dashboard + refreshing products - the bookings tab didn't appear. I had to switch sites to get it visible or restart the app. I wonder if such scenario can also happen for users and cause confusion about the feature being broken. WDYT - should we address it or leave as good enough for the MVP?

@itsmeichigo
Copy link
Contributor Author

Hey @RafaelKayumov, thanks for the review!

We should include a testing step to add bookable product to the CIAB testing store to have the "Bookings" tab presented. I forgot about that requirement myself and couldn't get the tab displayed for a while

Sorry for missing this step 🤦 I updated the PR description in case someone else comes across this PR in the future.

Also I noticed that after adding a bookable product on site and refreshing a dashboard + refreshing products - the bookings tab didn't appear. I had to switch sites to get it visible or restart the app. I wonder if such scenario can also happen for users and cause confusion about the feature being broken. WDYT - should we address it or leave as good enough for the MVP?

I discussed with Jorge about this in this thread: p1758087429642489-slack-C03L1NF1EA3. Currently, the tab bar is loaded only once and requires a relaunch or switching stores to update the tab bar for simplicity. Let's discuss there and update the behavior later if needed.

I'll wait for @jaclync's review to confirm that the POS works fine with this update before merging.

@itsmeichigo itsmeichigo requested a review from jaclync September 24, 2025 03:03
private func hideDotOn(with input: NotificationsBadgeInput) {
let tag = dotTag(for: input.tab)
if let subviews = input.tabBar.orderedTabBarActionableViews[input.tabIndex].subviews.first?.subviews {
if let subviews = input.tabBar.orderedTabBarActionableViews[safe: input.tabIndex]?.subviews.first?.subviews {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While testing I encountered a crash due to index out of bound here, so I added this for safety.

isBookingsTabVisible: isBookingsTabVisible)

// Updates site ID for the POS coordinator to ensure correct data
posTabCoordinator?.didSwitchStore(id: siteID)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm hoping the siteID can remain constant in POSTabCoordinator. How about reinitializing the POSTabCoordinator here instead of updating the siteID? Would it cause any issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jaclync POSTabCoordinator requires the eligibility checker, which now requires a full site model to check if the site is CIAB. Upon changes of site ID, we don't yet have the full site model so it's not possible to reinitialize the coordinator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be great if the coordinator can be separated from the eligibility checker, but with the current design I don't have a better solution. Please feel free to suggest a solution if you have one in mind, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd consider separating the tab visibility logic in POSEntryPointEligibilityCheckerProtocol to a new protocol that stays in the app, so that POSEntryPointEligibilityCheckerProtocol just has checkEligibility and refreshEligibility that should not depend on the full Site (the CIAB check is performed on the tab visibility).

We're also in the middle of moving POS code into a separate module, and I'm refactoring the dependencies of PointOfSaleEntryPointView passed in POSTabCoordinator. Please go ahead with merging this PR and I'll look into the refactoring as part of the POS module refactoring work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!

@itsmeichigo itsmeichigo merged commit 94221d2 into trunk Sep 25, 2025
13 checks passed
@itsmeichigo itsmeichigo deleted the woomob-1231-ios-bookings-tab branch September 25, 2025 04:49
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.

5 participants