Repository navigation
feat(mobile): support the iPhone Duo folded and unfolded, with controls in its side status bar - #34484
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a43c7cd5-e48f-4f48-bc46-76a18c62e9c7
Files selected for processing: 47-
mobile/app/h/[hostId]/edit.tsxmobile/app/h/_layout.tsxmobile/src/host-screen/host-rail-actions.tsxmobile/src/host-screen/host-screen-header.tsxmobile/src/host-screen/use-host-screen-controller.tsmobile/src/layout/host-sidebar-reveal.test.tsxmobile/src/layout/responsive-layout-metrics.test.tsmobile/src/layout/responsive-layout-metrics.tsmobile/src/layout/side-rail.test.tsxmobile/src/layout/side-rail.tsxmobile/src/layout/side-safe-area.tsxmobile/src/mobile-web-shell/MobileWebShellScreen.tsxmobile/src/mobile-web-shell/ShellStateScreen.tsxmobile/src/mobile-web-shell/bridge-host-contract.tsmobile/src/mobile-web-shell/bridge-host-notify.tsmobile/src/mobile-web-shell/bridge-host-test-harness.tsmobile/src/mobile-web-shell/bridge/bridge-client-notifications.tsmobile/src/mobile-web-shell/bridge/bridge-notify-envelope.tsmobile/src/mobile-web-shell/bridge/bridge-notify-grants.tsmobile/src/mobile-web-shell/bridge/bridge-page-location.tsmobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.tsmobile/src/mobile-web-shell/bridge/bridge-rpc-client.tsmobile/src/mobile-web-shell/catch-all-page-route-states.test.tsxmobile/src/mobile-web-shell/encoded-route-href.test.tsmobile/src/mobile-web-shell/encoded-route-href.tsmobile/src/mobile-web-shell/host-area-fold.test.tsxmobile/src/mobile-web-shell/host-area-in-page-cleanup.test.tsxmobile/src/mobile-web-shell/host-area-sidebar-matrix.test.tsxmobile/src/mobile-web-shell/host-area-two-hosts.test.tsxmobile/src/mobile-web-shell/mobile-web-shell-screen-test-harness.tsxmobile/src/mobile-web-shell/mobile-web-shell-screen-test-mocks.tsxmobile/src/mobile-web-shell/page-location-on-fold.tsmobile/src/mobile-web-shell/page-location-report.tsmobile/src/mobile-web-shell/page-location-report.web.tsmobile/src/mobile-web-shell/use-mobile-web-shell-bridge.test.tsmobile/src/mobile-web-shell/use-mobile-web-shell-bridge.tsmobile/src/navigation/host-stack.web.tsxmobile/src/session/MobileSessionAccessoryKeys.tsxmobile/src/session/MobileSessionCommandDock.tsxmobile/src/session/MobileSessionContentRow.tsxmobile/src/session/MobileSessionHeader.tsxmobile/src/session/MobileSessionSurface.tsxmobile/src/session/mobile-session-command-input-styles.tsmobile/src/session/mobile-session-toast-owner-cleanup.test.tsxmobile/src/session/session-side-rail.tsxmobile/src/storage/preferences.test.tsmobile/src/storage/preferences.ts
Files with no reviewable changes: 2-
- mobile/src/mobile-web-shell/host-area-two-hosts.test.tsx
- mobile/src/mobile-web-shell/host-area-sidebar-matrix.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
2eace87 to
2d0126b
Compare
2d0126b to
83f3c4e
Compare
…ls in its side status bar Unfolded, the Duo shows the list beside the session in both holds, and folding reopens the session the page had open. The Duo's vertical status bar (an 84pt side inset) now carries the focused screen's controls: the terminal keys, Back on the cover, and the list's actions. The host group leaves that edge unpadded so pages reach it; native views there pad it. The sidebar now sizes from the window until dragged, and native sidebar collapse is gone, since no page header could reveal it again.
83f3c4e to
6638978
Compare
…h controls in its side status bar (stablyai#34484)" This reverts commit 941f4ec.
Main's own Duo support (stablyai#34484) is reverted first so this implementation is the one that ships.
…ps' workspace on fold Native chat's visible-terminal override now publishes the ref itself after the runtime, so a split companion stops streaming while chat covers it. Pages from desktops released with #34484 still report their in-page location, so the shell keeps reopening it natively on fold. Also restores the measured flag when a width change keeps the grid, keeps the side rail registered across strip changes, omits empty page geometry from init, and mocks the side rail in the root recovery test.
…d half-fold layout (#35177) Carries over #33221 and #33210. Replaces our #34484 Duo support with the community design, on top of main's rebuilt terminal key bar (#36166). Fixes #33200 Co-authored-by: Takeshi Matsumoto <[email protected]> Co-authored-by: Lars Keggenhoff <[email protected]>
ELI5
The iPhone Duo folds. Before this, Orca treated the unfolded phone like a big screen in only one of the two ways you can hold it, and forgot your open session when you folded it. It also left the tall strip next to the clock empty. Now the app splits however you hold it, keeps your session when you fold, and puts its buttons in that strip.
What Changed
locationnotify; older shells refuse it with a diagnostic only), and the shell reopens that screen natively when the layout narrows. Only the focused screen does this.Why
A real rail needs controls inside the WebView's frame. iOS clips subviews to their parent and won't deliver touches outside it, so the shell can't reach past a padded parent. That's why the root
SideSafeAreareleases the rail edge for the host group, instead of the shell using a negative margin. Native views in that group (the shell's loading and error states, the host edit screen) wrap themselves inSideSafeAreaagain, which only pads what an outer one left unpadded.t3code gets its rail items from UIKit's own bars on the iOS 27.1 SDK, through a forked react-native-screens. Our headers aren't system bars, so the page draws the rail itself, using the safe-area insets we already pass it. The sidebar is not aligned to the crease, because Apple's own split apps don't do that either.
Linked Issue
Refs #22597 and #33200. This covers part of each (split, fold continuity, side rail); half-fold postures, IME and VoiceOver checks, and the configurable rail and D-pad are not in it.
Visual Proof
The Duo didn't have its own layout before this, so these are after shots only. They come from the iPhone Duo simulator on iOS 27.1.
Unfolded, no session open. The list's actions are in the rail:
Unfolded with a terminal. The keys are in the rail:
Unfolded and held sideways. The strip runs across the top, so the keys stay in the bottom row:
Folded list: accounts, tasks and terminal at the top, search at the bottom:
Folded session: Back under the clock, keys below:
Folded and in landscape, the rail moves to the left:
Testing
On the iPhone Duo simulator (iOS 27.1, Xcode 27), with a dev desktop serving the page bundle. Fold, unfold and rotate were driven through the simulator's hinge and orientation events.
Opened a session unfolded, folded, unfolded, rotated both ways and folded again; the session stayed open each time and Back returned to the list.
Tapped rail actions (search, Back) on both screens.
Checked held sideways, where the keys go back to the bottom row.
Not checked: the rail with the soft keyboard up, which doesn't appear on this simulator setup, and a physical device.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Tests cover the wide cutoff for both Duo holds, the fold reopening the session (including a host-route shell left under a pushed session), worktree-id href encoding, and the rail showing only the top screen's claim.
AI Disclosure
Review
Worth a close look:
useReleasedSideRailinmobile/src/layout/side-safe-area.tsxand the screens in the host group that now pad themselves.Agent skill upstream boundary
Notes
Mobile only. On phones without a rail, iPad, Android and web, the rail rule returns null, so their layout stays the same. The only change there is the sidebar's starting width, which is now 30% of the window; on iPad that ranges from 280pt in portrait to 340pt in landscape. The new bridge notify degrades on older shells (refused with a diagnostic), and older pages ignore the rail insets.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)