Skip to content

fix(ios): iPhone Duo support (vertical bar) + fold/unfold e2e - #8375

Draft
yedidyak wants to merge 4 commits into
yedidyak/uiscene-rn88-460234from
yedidyak/iphone-duo-b2e71b
Draft

yedidyak wants to merge 4 commits into
yedidyak/uiscene-rn88-460234from
yedidyak/iphone-duo-b2e71b

Conversation

@yedidyak

@yedidyak yedidyak commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Stacked on #8374 (UIScene + RN 0.88). Review only the commits on top of it.

Why

iPhone Duo (iPhone19,4, iOS 27.1+) is Apple's foldable iPhone. With the iOS 27.1 SDK, UIKit moves the tab bar and the navigation bar's items into a vertical bar on the trailing edge of both displays. UITabBar becomes an empty placeholder column and the system draws the tabs in a floating platter. RNN worked against that in four places.

Changes

Problem on Duo (verified on the iPhone Duo simulator, iOS 27.2) Fix
No tab is visible or tappable. On iOS 26+ RNN sets tabBar.backgroundColor from bottomTabs.backgroundColor. The placeholder is drawn above the system platter, so any app that sets a tab bar background color (the playground does) hides every tab. Detox: LAYOUTS_TAB … does not pass visibility percent threshold. Don't paint the view background while the tab bar is vertical (the appearance background still applies). Re-applied when verticalBarEdge changes (fold, unfold, scene resize).
Constants.bottomTabsHeight is the screen height (678 on the outer display), because the bar is 69×678. 0 while the tab bar is vertical.
Custom tab rows (bottomTab.component) are squeezed into the 69pt column, and the native platter shows next to them. Bottom tabs with custom item views return UIVerticalBarBehaviorDisabled, so the bar stays horizontal at the bottom.
topBar.backButton.testID is never applied. The back button is hosted outside navigationBar in the vertical bar. When the stack is in the vertical bar, also look for the back button there.

The side menu (MMDrawerController, RNNSideMenuChildViewController) now forwards childViewControllerForPreferredVerticalBarBehavior the same way it forwards the status bar. Without that, a child's preference (for example the custom-row opt-out above) is ignored under a side menu.

Every change is inside #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 270100 + @available(iOS 27.1, *) or keyed on verticalBarEdge, so nothing changes on Xcode 26, on other iPhones and iPads, or on either life cycle.

Testing on Duo: folding the simulator

Neither simctl nor DeviceHub can fold the simulator. playground/e2e/duo/hinge.m is a simulator-only tool that asks SpringBoard's display tool service for a hinge swap, the same request Apple's internal suiatool swap makes. It is private SPI used only by e2e tooling, never by the library.

  • ios.sim.release.scene.duo Detox configuration. DETOX_IOS_DEVICE_ID pins a simulator by UDID for any iOS configuration.
  • DETOX_DUO_POSE=closed|open runs a whole suite on the outer (466×678) or inner (951×669) display.
  • iPhoneDuo.test.js folds and unfolds live with bottom tabs, the custom row, a modal, an overlay and the side menu on screen. It returns early on other devices.

Validation

  • iPhone Duo, iOS 27.2, Xcode 27.2, scene scheme, RN 0.88:
    • iPhoneDuo.test.js: 5/5 pass. Before the fix, 3/5 fail (tabs not visible, so the modal and overlay flows can't be reached).
    • Full suite closed: 135 pass / 43 fail. Full suite open: 134 / 44.
  • iPhone 18 Pro Max, iOS 27.2, same build: full suite 151 / 27. The 27 are failures on iOS 27 generally, not Duo.
  • Failures only on Duo, after the fix:
    • The short outer display puts playground content below the fold or overlapping (Stack, Options, BottomTabs, External Component).
    • The inner display ignores supported orientations (Orientation suite, drawer rotation). Apple documents this.
    • Detox can't hit bar items that UIKit hosts in the vertical bar (SearchBar modal, some top-bar buttons). Hit-testing them from a plain UIKit app gives the same result.
    • Screenshot comparisons use baselines from other devices.
  • iPhone 17 Pro Max, iOS 26.3, Xcode 26.2: BottomTabs, CustomBottomTabComponent, SideMenu, BackButton, Buttons, Options and iPhoneDuo.
    • App-delegate scheme: 82/82 pass.
    • Scene scheme: 81/82 pass. Buttons › Resetting buttons should unmount button react view failed twice, then passed 4/4 with the same build (twice alone, twice in the full suite). The base code passed it 1/1. It's a flaky test; nothing in this PR runs on iOS 26.
  • Unit tests, playgroundScene, Debug, Xcode 27.2, iPhone 18 Pro Max (iOS 27.2): 288 of 289 pass. RNNRootViewControllerTest testTopBarNoBorderOff fails on the base branch too.
  • Builds: both Release schemes on Xcode 26.2, and the scene scheme on Xcode 27.2. clang-format is clean.
  • RN 0.79: not run. Nothing here is RN-version-specific.

Not changed (works on Duo, or doesn't apply)

  • Root, stack, modals (including page sheets), overlays and the side menu all render and survive fold/unfold. Window and scene geometry follow the scene, size classes change (compact/regular outer, regular/regular inner), and topBarHeight matches the safe area.
  • statusBarHeight is UIKit's own value (2 with the vertical status bar). It's documented, not changed.
  • Orientation options don't apply on the inner display. That's Apple's behavior.
  • UIScreen.mainScreen stays the outer display (466×678) while the app is on the inner one (951×669). RNN's remaining mainScreen uses only set initial frames, and layout replaces them. A cold launch and pushes on the inner display render at full width. Moving them to the window scene's geometry is a possible cleanup, not done here.

Apps built with the iOS 27.1 SDK get UIKit's vertical bar on iPhone Duo: the tab bar becomes a
floating platter on the trailing edge and `tabBar` turns into an empty placeholder column above it.

- Don't set `tabBar.backgroundColor` while the tab bar is vertical. On iOS 26+ RNN painted the
  placeholder with `bottomTabs.backgroundColor`, which covered the system tabs: no tab was visible
  or tappable. Re-applied when `verticalBarEdge` changes (fold/unfold, scene resize).
- `Constants.bottomTabsHeight` is 0 while the tab bar is vertical (it returned the full screen
  height, 678 on the outer display).
- Bottom tabs with custom item views (`bottomTab.component`) opt out of the vertical bar: the custom
  row is a horizontal bar and was squeezed into the 69pt vertical column.
- The side menu forwards the vertical bar preference to its children like it does for the status
  bar, so the opt-out above (and any child's preference) still applies under a side menu.
- `ios.sim.release.scene.duo` Detox configuration (iPhone Duo runtime, iOS 27.2).
  `DETOX_IOS_DEVICE_ID` pins one simulator by UDID for any iOS configuration.
- `e2e/duo`: a simulator-only tool that folds and unfolds the device through SpringBoard's display
  tool service (private SPI, test tooling only), and a Detox helper around it.
- `DETOX_DUO_POSE=closed|open` runs a whole suite on the outer or inner display.
- `iPhoneDuo.test.js` folds and unfolds with bottom tabs, the custom tab row, a modal, an overlay
  and the side menu on screen. It returns early on other devices.
…utton.testID

In the vertical bar UIKit hosts the back button outside the navigation bar, so backButton.testID
was never applied. Fall back to the window's bar button that shows this stack's back item.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant