Skip to content

Conversation

@staskus
Copy link
Contributor

@staskus staskus commented Aug 6, 2025

WOOMOB-1009

Description

When the Woo app is initially launched and user logs in, Orders and Products tab are not displayed in a split view. The app needs to be killed and relaunched for a split view to appeared.

The iPadOS 18 + Xcode 16 hack was not working properly on first launch after login because it requires view.window to be available to access the window's trait collection. It turns all the views into .compact, not just the tab bar itself.

During initial login flow:

  1. viewDidLoad() is called before tab controller is added to window hierarchy
  2. AppCoordinator.displayLoggedInUI() sets tab controller as window root
  3. view.window becomes available, but fixTabBarTraitCollectionOnIpadForiOS18 was already called when window was nil

Fixed by adding fixTabBarTraitCollectionOnIpadForiOS18() call to viewDidAppear() which is guaranteed to run after the view controller is in the window hierarchy and view.window is available.

Steps to reproduce

  1. Remove the app
  2. Install the app on the iPad
  3. Login
  4. Open Orders or Products tab
  5. Confirm they appear in the split view

Testing information

Tested on iPad Air 18.5 simulator and iPadAir 26 device

Screenshots

Simulator.Screen.Recording.-.iPad.Air.11-inch.M3.-.2025-08-06.at.20.39.54.mov

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

The fixTabBarTraitCollectionOnIpadForiOS18 hack was not working properly on first launch after login because it requires view.window to be available to access the window's trait collection.

During initial login flow:
  1. viewDidLoad() is called before tab controller is added to window hierarchy
  2. AppCoordinator.displayLoggedInUI() sets tab controller as window root
  3. view.window becomes available, but fixTabBarTraitCollectionOnIpadForiOS18
     was already called when window was nil

Fixed by adding fixTabBarTraitCollectionOnIpadForiOS18() call to viewDidAppear() which is guaranteed to run after the view controller is in the window hierarchy and view.window is available.
@staskus staskus added this to the 23.0 milestone Aug 6, 2025
@staskus staskus requested review from iamgabrielma and jaclync August 6, 2025 19:29
@staskus staskus added feature: split view Tasks related to iPad SplitView Mode Bug labels Aug 6, 2025
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 23.0. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

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 Numberpr15985-82f9cd1
Version22.9
Bundle IDcom.automattic.alpha.woocommerce
Commit82f9cd1
Installation URL58tlqsn5s76jg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jaclync jaclync self-assigned this Aug 7, 2025
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 fixing this, tested in iPad Air 13in iOS 18.5 simulator :shipit:

@staskus staskus merged commit 9ca2d14 into trunk Aug 7, 2025
20 of 22 checks passed
@staskus staskus deleted the woomob-1009-ipad-split-view-is-not-working-on-orders-and-products-tabs branch August 7, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug feature: split view Tasks related to iPad SplitView Mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants