-
Notifications
You must be signed in to change notification settings - Fork 121
[POS as a tab i1] Show POS tab for eligible stores behind a feature flag #15726
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
Conversation
…se case in `BetaFeaturesConfigurationViewModel`.
… POS eligibility only receives notifications for the ServiceLocator instance.
…om site initialization when feature flag is enabled.
Generated by 🚫 Danger |
|
|
…/github.com/woocommerce/woocommerce-ios into feat/WOOMOB-567-pos-tab # Conflicts: # WooCommerce/Classes/Tools/Shared Site Settings/SelectedSiteSettings.swift
…ker` for eligibility check instead.
… feature is disabled.
…nt leftover main thread work from previous test cases from singletons.
…eToOrderDetails_for_the_same_store_switches_to_orders_tab_and_opens_order`.
joshheald
left a comment
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 as described. I tested on an iPad running iOS 17.7.2, and an iPhone running 18.5, and an iPad simulator running iOS 16.
I tested with various combinations of currency, country, device type, and OS – the tab shows when it should and doesn't when it shouldn't.
I checked the analytics events were still correctly annotated, and that card payments are still correctly cancelled/order state reset when leaving POS.
I'm just wondering whether/when we plan to make the tab bar stable again?
I do think it's worth delaying the load until we can determine eligibility – a jumpy UI doesn't give a good impression of the app.
If we really can't do that now, it might be a bit better if we could animate the insertion of the tab.
|
|
||
| configureTabViewControllers() | ||
| // POS tab is hidden by default. | ||
| updateTabViewControllers(isPOSTabVisible: false) |
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.
Have you investigated whether we can avoid this? Is it planned for a later iteration?
It would really be preferable to avoid the tab bar jumping around like this... if we release it this way it's kind of annoying and doesn't seem like the best impression for POS!
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.
In i2 from the delivery plan pdfdoF-7po-p2, the POS tab visibility check is reduced to two API requests:
- Remote feature flag: as we discussed in the team meeting, we're keeping this check in case of critical POS issues for certain app versions
- General WC site settings for store country: ideally we can reuse the site settings fetched from other API requests made during site initialization
For i1 / initial implementation, we're hiding the POS tab by default just so that it isn't shown for ineligible stores pdfdoF-7mo-p2#ui. But as you and Povilas mentioned during PR testing, plus my own testing, I'm not liking this UX. In my next task WOOMOB-599, I'm exploring caching the POS eligibility per site and using the cached value while checking eligibility async. For most of the sites, this value is hopefully rarely changed.
|
Thank you for the thorough testing Josh!
I personally don't think it's worth delaying the tab bar initial state just for POS eligibility checks, at least for i1 with eligibility dependence on several API requests. Most of the merchants aren't using POS at this point. The current eligibility delay is noticeable and will make the app feel slower with potential feedback in reviews and support tickets. For i2 maybe, or we can consider always showing the POS tab for all stores and inform them about the ineligibility reason. In this case, a setting to hide the POS tab in the app might help with the UX like for stores in ineligible countries. WDYT?
Great suggestion, I haven't thought about animating the tab changes and will look into it this week. |

Closes WOOMOB-584
Just one review is required.
Apology for the larger diffs, ~400 diffs are about unit test changes on
MainTabBarController. A few cases inMainTabBarControllerTestswere flaky from CI (example in the Tests tab even though CI passed) and locally when running the test class repeatedly for 10+ times. When a test case haswaitUntil, if the main thread is occupied by other operations like from leftover previous test cases,waitUntilcan become unresponsive and not be able to check the condition as expected. From debugging for a few hours, I noticed that instances ofMainTabBarControllerfrom previous test cases were not deallocated. And because of a combination ofServiceLocatorusage and the sharedSessionManagerdatabase in tests, the site ID from previous and current test cases could trigger site ID changes observed inMainTabBarControllerin the unintended instance (e.g. the currentMainTabBarControllerinstance is receiving site ID from a previous test case, or previous instances are receiving site IDs from the current test case). I ended up separating a few test cases on the tabs behavior to a new test class, and with a few changes I was able to run both test classes repeatedly successfully. Please feel free to share any tips on any alternatives ofwaitUntilor the test setup.Description
This pull request introduces a new feature to display the Point of Sale (POS) as a tab in the tab bar, contingent on a feature flag and user eligibility. It includes updates to feature flag handling, POS tab integration, and adjustments to existing tab bar functionality. Below is a summary of the most significant changes grouped by theme.
Feature Flag Updates
pointOfSaleAsATabi1, to control the release of the POS tab. (Modules/Sources/Experiments/FeatureFlag.swift- [1]Modules/Sources/Experiments/DefaultFeatureFlagService.swift- [2]POS Tab Integration
POSTabCoordinatorandPOSTabViewControllerto manage the behavior and presentation of the POS tab and the full-screen POS UI. (WooCommerce/Classes/POS/TabBar/POSTabCoordinator.swift- WooCommerce/Classes/POS/TabBar/POSTabCoordinator.swiftR1-R152)WooTabenum to include thepointOfSalecase and added logic to manage its visibility dynamically based on eligibility. (WooCommerce/Classes/ViewRelated/MainTabBarController.swift- [1] [2]Tab Bar Functionality Adjustments
MainTabBarControllerto observe POS eligibility and dynamically update the tab bar to show or hide the POS tab. (WooCommerce/Classes/ViewRelated/MainTabBarController.swift- WooCommerce/Classes/ViewRelated/MainTabBarController.swiftL602-R684)WooCommerce/Classes/ViewRelated/MainTabBarController.swift- WooCommerce/Classes/ViewRelated/MainTabBarController.swiftR295-R305)Hub Menu Updates
HubMenuCoordinatorandHubMenuViewModelto account for the new POS tab feature flag and ensure compatibility with the updated tab bar logic. (WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuCoordinator.swift- [1]WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewModel.swift- [2]Steps to reproduce
Prerequisite: a WPCOM account that has at least two connected stores, one eligible for POS and the other one not eligible.
Screenshots
Only the "Sweet Maple Store" is not eligible for POS.
Simulator.Screen.Recording.-.iPad.A16.-.2025-06-13.at.13.38.00.mp4
RELEASE-NOTES.txtif necessary.