Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Sep 18, 2025

WOOMOB-1363

Description

Hides POS tab for CIAB sites

  • Adds pointOfSale enum case to CIABAffectedFeatures
  • Injects CIABEligibilityChecker into POSTabEligibilityChecker and LegacyPOSTabEligibilityChecker
  • Reworks POSTabEligibilityChecker and LegacyPOSTabEligibilityChecker to work with injected site instead of siteID. CIAB checker requires site for assessment.
  • In MainTabBarController observes stores.site instead of stores.siteID because of the reason above. Also the defaultSite might be blank by the moment of POS eligibility checkers initialization - observing the site resolves the issue.
  • In ScreenshotsObjectGraph extracts defaultSite mock to Site+Mocks.swift extension for reusability in PreviewHelpers.swift
  • Updates existing tests and adds tests for POS eligibility checkers in CIAB site environment

Testing steps

  • Use iPad Simulator or device for testing
  • Login to a non-CIAB store with POS requirements met and thus POS tab available.
  • Make sure the POS tab is presented in main tabbar and works as usual
  • Log in to CIAB site (Create a site with Garden API Demo Tool)
  • Make sure the POS tab is not visible
  • Switch between these 2 sites in Menu -> My Store -> Site selector back and forth
  • Make sure the POS tab has correct visibility during the site switching - it should be only visible for non-CIAB site.

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

@RafaelKayumov RafaelKayumov added this to the 23.3 milestone Sep 18, 2025
@RafaelKayumov RafaelKayumov marked this pull request as ready for review September 18, 2025 12:57
@dangermattic
Copy link
Collaborator

dangermattic commented Sep 18, 2025

1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 18, 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 Numberpr16147-8b32ea3
Version23.2
Bundle IDcom.automattic.alpha.woocommerce
Commit8b32ea3
Installation URL1vu24fgjib7k8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@RafaelKayumov
Copy link
Contributor Author

I will resolve conflicts and update release notes according to milestone after a review

Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

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

Thanks for tagging, the POS code changes look good to me. LegacyPOSTabEligibilityChecker is meant to be deleted soon WOOMOB-869, apology for not removing it sooner to avoid some unnecessary work in this PR. I will work on the removal shortly after this PR.

@itsmeichigo itsmeichigo modified the milestones: 23.3, 23.4 Sep 19, 2025
@itsmeichigo itsmeichigo self-assigned this Sep 19, 2025
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Thanks for this update! The POS tab is hidden as expected for CIAB sites and shown for other sites from my testing ✅

The switch from observing site ID to site seems to cause a few issues:

  • It takes a bit longer to reload views when switching sites (since site info needs to be fetched again). I suppose this is negligible.
  • The Menu tab doesn't seem to load correctly. The store name, address, and sections like Payments, Blaze, Google Ads, Inbox are not displayed for all stores (screencast below). We might want to use site to activate hubMenuTabCoordinator to resolve this.
Simulator.Screen.Recording.-.iPad.mini.A17.Pro.-.2025-09-19.at.11.25.57.mov

Comment on lines 728 to 729
func observeSiteIDForViewControllers() {
cancellableSiteID = stores.siteID.sink { [weak self] siteID in
cancellableSiteID = stores.site.sink { [weak self] site in
Copy link
Contributor

Choose a reason for hiding this comment

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

Super nit: should the method and the property be renamed to ~site instead of ~siteID?

@itsmeichigo
Copy link
Contributor

Another issue with observing site: when I change the site name, all screens are reloaded before the rename modal is hidden:

Simulator.Screen.Recording.-.iPad.mini.A17.Pro.-.2025-09-19.at.12.20.05.mov

Should we observe site separately and use it to update POS and Bookings tabs only for simplicity?

@RafaelKayumov
Copy link
Contributor Author

@itsmeichigo Thx for spotting the issue. Site is now observed separately in 8b32ea3

Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Thanks for the update, all is good now 💯 :shipit:

@RafaelKayumov RafaelKayumov merged commit 7fa5258 into trunk Sep 22, 2025
13 checks passed
@RafaelKayumov RafaelKayumov deleted the WOOMOB-1363-hide-POS-tab-for-CIAB-sites branch September 22, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants