Repository navigation
Conversation
Builds against an older SDK run letterboxed in compatibility mode on iPhone Duo. Moving to Xcode 27.1 needs the UIScene lifecycle the SDK makes mandatory, a floor for pod deployment targets Xcode 27 rejects, and one availability guard in expo-router.
Keeps the host sidebar left of the fold in book posture so the terminal never crosses the crease, and draws the terminal keys in the strip below the Duo's status column on session routes.
|
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: 3
🧹 Nitpick comments: 1
mobile/src/mobile-web-shell/page-fold-division.ts: 1
88-88:Trivial · Performance & Scalability · Quick win Memoize
measuredPageSafeAreaInsetsto avoid per-render Zod parsing and repeated warnings.
usePageFoldDivisioncallsmeasuredPageSafeAreaInsetson every render ofMobileWebShellScreen. Each call runs two ZodsafeParseoperations. It also returns a new object when the geometry is valid.If the native module sends malformed geometry, each re-render logs
console.warn('[web-shell] invalid measured safe-area geometry', ...). Keyboard events, route changes, and layout updates all trigger re-renders. The log would flood.Memoize the result on its inputs. This keeps the parse and the warning to one per input change.
♻️ Proposed change
- const safeAreaInsets = measuredPageSafeAreaInsets(windowSafeArea, frame, insets) + const safeAreaInsets = useMemo( + () => measuredPageSafeAreaInsets(windowSafeArea, frame, insets), + [windowSafeArea, frame, insets] + )
insetscomes fromuseSafeAreaInsets, which is expected to be referentially stable between changes. Confirm this before relying on the memo.

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:
813b543a-d1fb-412d-bf61-ac8e993f94c7
Files ignored due to path filters: 1-
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
Files selected for processing: 157-
.github/workflows/mobile-ios-release.ymlconfig/scripts/build-mobile-web-app-bundle.mjsconfig/scripts/mobile-web-page-routes.mjsconfig/scripts/mobile-web-page-routes.test.mjsmobile/app.jsonmobile/app/_layout.tsxmobile/app/h/[hostId]/index.web.tsxmobile/app/h/_layout.tsxmobile/modules/orca-reserved-regions/expo-module.config.jsonmobile/modules/orca-reserved-regions/ios/OrcaReservedRegions.podspecmobile/modules/orca-reserved-regions/ios/OrcaReservedRegionsModule.swiftmobile/modules/orca-reserved-regions/package.jsonmobile/modules/orca-reserved-regions/src/index.tsmobile/modules/orca-window-controls-inset/ios/OrcaWindowControlsInsetSubscriber.swiftmobile/patches/expo-router@55.0.18.patchmobile/plugins/ios-pod-deployment-target-floor.jsmobile/plugins/ios-scene-lifecycle.jsmobile/pnpm-workspace.yamlmobile/src/components/TerminalShortcutSettings.tsxmobile/src/components/terminal-shortcut-settings-custom-keys.test.tsxmobile/src/layout/fold-division.test.tsmobile/src/layout/fold-division.tsmobile/src/layout/reserved-regions.tsmobile/src/layout/reserved-regions.web.tsmobile/src/layout/side-rail-strip.test.tsmobile/src/layout/side-rail-strip.tsmobile/src/layout/side-rail.tsxmobile/src/layout/side-safe-area.test.tsxmobile/src/layout/side-safe-area.tsxmobile/src/layout/top-chrome-space.test.tsmobile/src/layout/top-chrome-space.tsmobile/src/layout/use-fold-split.tsmobile/src/layout/use-fold-split.web.tsmobile/src/layout/use-shell-side-rail.tsmobile/src/layout/use-shell-side-rail.web.tsmobile/src/layout/use-top-chrome-space.tsmobile/src/mobile-web-shell/MobileWebShellScreen.test.tsxmobile/src/mobile-web-shell/MobileWebShellScreen.tsxmobile/src/mobile-web-shell/bridge-host-back.tsmobile/src/mobile-web-shell/bridge-host-contract.tsmobile/src/mobile-web-shell/bridge-host-notify.tsmobile/src/mobile-web-shell/bridge-host-route.tsmobile/src/mobile-web-shell/bridge-host-terminal-key-rail.test.tsmobile/src/mobile-web-shell/bridge-host.tsmobile/src/mobile-web-shell/bridge/bridge-back-round-trip.test.tsmobile/src/mobile-web-shell/bridge/bridge-client-inbound-frames.tsmobile/src/mobile-web-shell/bridge/bridge-client-init-handshake.tsmobile/src/mobile-web-shell/bridge/bridge-client-notifications.tsmobile/src/mobile-web-shell/bridge/bridge-client-session.tsmobile/src/mobile-web-shell/bridge/bridge-client-shell-session.tsmobile/src/mobile-web-shell/bridge/bridge-client-terminal-keys.tsmobile/src/mobile-web-shell/bridge/bridge-envelope.tsmobile/src/mobile-web-shell/bridge/bridge-fold-division.test.tsmobile/src/mobile-web-shell/bridge/bridge-fold-division.tsmobile/src/mobile-web-shell/bridge/bridge-init-frame.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-geometry.test.tsmobile/src/mobile-web-shell/bridge/bridge-page-geometry.tsmobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.tsmobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.tsmobile/src/mobile-web-shell/bridge/bridge-rpc-client.tsmobile/src/mobile-web-shell/bridge/bridge-terminal-key.test.tsmobile/src/mobile-web-shell/bridge/bridge-terminal-key.tsmobile/src/mobile-web-shell/bridge/page-async-storage.tsmobile/src/mobile-web-shell/host-area-layout-class-change.test.tsxmobile/src/mobile-web-shell/host-area-leave-session.test.tsxmobile/src/mobile-web-shell/host-area-session.test.tsmobile/src/mobile-web-shell/host-area-sidebar-matrix.test.tsxmobile/src/mobile-web-shell/host-root-responsive-content.test.tsxmobile/src/mobile-web-shell/mobile-web-shell-keyboard-overlay-screen.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-fold-division.tsmobile/src/mobile-web-shell/page-route-policy.tsmobile/src/mobile-web-shell/page-safe-area-insets.test.tsmobile/src/mobile-web-shell/page-safe-area-insets.tsmobile/src/mobile-web-shell/page-storage-keys-negotiation.test.tsmobile/src/mobile-web-shell/page-storage-keys.tsmobile/src/mobile-web-shell/terminal-direction-pad.test.tsxmobile/src/mobile-web-shell/terminal-direction-pad.tsxmobile/src/mobile-web-shell/terminal-key-rail.test.tsxmobile/src/mobile-web-shell/terminal-key-rail.tsxmobile/src/mobile-web-shell/use-mobile-web-shell-bridge.test.tsmobile/src/mobile-web-shell/use-mobile-web-shell-bridge.tsmobile/src/mobile-web-shell/use-shell-page-storage-refresh.test.tsxmobile/src/mobile-web-shell/use-shell-page-storage-refresh.tsmobile/src/navigation/route-handoff-host-area.web.test.tsxmobile/src/platform/keyboard-occlusion.test.tsxmobile/src/platform/keyboard-occlusion.tsmobile/src/platform/shell-storage.tsmobile/src/platform/shell-storage.web.tsmobile/src/session/MobileSessionActiveContent.tsxmobile/src/session/MobileSessionCommandDock.test.tsxmobile/src/session/MobileSessionCommandDock.tsxmobile/src/session/MobileSessionHeader.test.tsxmobile/src/session/MobileSessionHeader.tsxmobile/src/session/MobileSessionTabStrip.test.tsxmobile/src/session/MobileSessionTabStrip.tsxmobile/src/session/MobileTerminalLiveInputRow.tsxmobile/src/session/MobileTerminalLiveInputStatus.tsxmobile/src/session/TerminalPaneView.test.tsxmobile/src/session/TerminalPaneView.tsxmobile/src/session/mobile-session-command-input-styles.tsmobile/src/session/mobile-session-connection-retry.test.tsxmobile/src/session/mobile-session-preference-startup.test.tsmobile/src/session/mobile-session-terminal-frame-layout.test.tsxmobile/src/session/mobile-terminal-layout-choice.test.tsxmobile/src/session/mobile-terminal-pane-layout.test.tsmobile/src/session/mobile-terminal-pane-layout.tsmobile/src/session/mobile-terminal-split-gestures.test.tsxmobile/src/session/mobile-terminal-split-input.test.tsxmobile/src/session/shell-terminal-key-rail.tsmobile/src/session/shell-terminal-key-rail.web.test.tsxmobile/src/session/shell-terminal-key-rail.web.tsmobile/src/session/use-mobile-session-accessory-selection.tsmobile/src/session/use-mobile-session-controller.tsmobile/src/session/use-mobile-session-keyboard-state.test.tsxmobile/src/session/use-mobile-session-keyboard-state.tsmobile/src/session/use-mobile-session-lifecycle.tsmobile/src/session/use-mobile-session-presentation.tsmobile/src/session/use-mobile-session-screen-state.tsmobile/src/session/use-mobile-session-startup.tsmobile/src/session/use-mobile-session-tab-application.tsmobile/src/session/use-mobile-session-tab-switching.tsmobile/src/session/use-mobile-session-terminal-runtime.tsmobile/src/session/use-mobile-session-terminal-stream-display.tsmobile/src/session/use-mobile-session-terminal-subscription.test.tsxmobile/src/session/use-mobile-session-terminal-subscription.tsmobile/src/session/use-mobile-session-terminal-webview.tsmobile/src/session/use-terminal-key-rail-toolbar.tsmobile/src/session/use-terminal-split-layout.test.tsxmobile/src/session/use-terminal-split-layout.tsmobile/src/storage/mirrored-storage-keys.tsmobile/src/storage/preferences.tsmobile/src/terminal/document/mouse-click-drag.tsmobile/src/terminal/document/surface-touch-gestures.tsmobile/src/terminal/document/wheel-scroll.tsmobile/src/terminal/terminal-accessory-layout.test.tsmobile/src/terminal/terminal-accessory-layout.tsmobile/src/terminal/terminal-accessory-repeat.tsmobile/src/terminal/terminal-cell-box-refit.test.tsxmobile/src/terminal/terminal-custom-keys.tsmobile/src/terminal/terminal-foreground-recovery.test.tsmobile/src/terminal/terminal-foreground-recovery.tsmobile/src/terminal/terminal-viewport-refit-options.tsmobile/src/terminal/terminal-viewport-refit.tsmobile/src/terminal/terminal-webview-contract.tsmobile/src/terminal/terminal-webview-notification-dispatch.tsmobile/src/terminal/use-terminal-webview-controller.tsmobile/src/transport/mobile-web-bundle-reply-schemas.test.tsmobile/src/transport/mobile-web-bundle-reply-schemas.tsmobile/vitest.setup.tsmobile/web-entry/index.tsxmobile/web-entry/web-overrides.jsonsrc/shared/mobile-web-bundle/manifest-contract.test.tssrc/shared/mobile-web-bundle/manifest-contract.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
Observe layout changes on the measured shell root so the page receives updated status-area geometry without requiring rotation. Cover root-only movement and root-before-child ordering without remounting the WebView.
|
Thanks @zytakeshi, this is the Duo design we want. We've carried it over in #35177 so it merges on current main. Your commits and those from #33210 are kept as you wrote them, and our fixes for main's themes, lazy terminal mounts and the route grant cap are on top. We'll leave this PR open until that one merges. |
|
Thank you! This landed in #35177 with your commits intact, merged with main's newer terminal key bar. The Duo rail keeps your design and D-pad, and now lists that bar's keys. |
ELI5
Orca should use an iPhone Duo like a foldable workspace: more terminal space when open, a keyboard-friendly upper display when half folded, and reachable controls in the side strip. This is the main PR for that experience, with independent terminal panes supplied by #33210.
Latest series status
a2583f4eb1d91d732e760143419d30a73fca3095f1e64ef830690f0914437ecde16ab49ac010963bThe main PR includes narrow-header actions in …, removal of the synthetic top band and Duo input-dock bottom reservation, and keyboard alignment scoped to the visible terminal dock. Native chat, browser, Markdown and file views retain their existing keyboard clearance. Review the companion first, then the Duo-only comparison.
What Changed
Why
On the open Duo, redundant bottom rows and unused layout space cost terminal lines. A small fixed subset of side shortcuts also makes the side strip less useful than the normal accessory row. This keeps Orca's existing input behavior while moving the complete control set into the available side area.
The split-pane and navigation changes are isolated in the supporting PR so they can be reviewed on other mobile/tablet layouts independently. Review and merge #33210 first, then this PR. Both PRs target main; this aggregate includes #33210 as a dependency. Review and land the generic split PR first, then update this aggregate PR against main again if main advances. Duo-only comparison excludes the companion changes.
Linked Issue
Fixes #33200.
Part of #22597. That broader issue remains open for its remaining device, accessibility, IME and transition acceptance criteria.
This series proposes a broader replacement for the narrow Duo compatibility work in #32733 by @larskghf. Its two SDK/scene/fold groundwork commits retain @larskghf’s authorship, and the controls, layout choices and continuity are added here.
Related Expo 58 proposals #33155 and #33157 by @kazu-42 remain separate. This series stays on current upstream’s Expo 55. Maintainers decide the disposition of those PRs.
Visual Proof
The following media show the community implementation before the public port. The earlier and later simulator prototypes use neutral local fixtures. They are neither a matched comparison against current upstream main nor final-head acceptance evidence. Final-branch validation is listed separately below.
Motion overview (actual simulator captures with labeled explanatory motion graphics):
orca-duo-x.mp4
Keyboard space: earlier and later prototypes
The exact builds and fixture output differ; this illustrates layout rather than a controlled pixel-difference measurement.
Complete controls in the side strip
The pane arrangements differ; this is a control-placement comparison, not a measured terminal-height gain.
Half-fold keyboard layout
The simulator keyboard menu exposed the keyboard for this capture. This still image demonstrates layout; it does not prove that the application's Show keyboard control opened it.
All prototype media and provenance.
Testing
Latest contributor device feedback
On October 25, 2026, Takeshi Matsumoto (@zytakeshi) checked the latest combined implementation on his physical iPhone Duo and reported that the layout looks good after the added edge gaps were removed. This is contributor-reported layout feedback for the combined implementation. It does not establish exhaustive touch, home-gesture, rotation or keyboard acceptance, or a separate native run of the rebased public branch.
f8180bfa04c9435b490aef2ebd193ed427b17b61(base41d25c07).ORCA_BACKGROUND_LAUNCH=1 ./node_modules/.bin/vitest run config/scripts/mobile-web-page-routes.test.mjs src/shared/mobile-web-bundle/manifest-contract.test.ts./node_modules/.bin/tsc --noEmit --project mobile/tsconfig.json --pretty falseORCA_BACKGROUND_LAUNCH=1 ./node_modules/.bin/tsx --conditions=orca-source config/scripts/check-changed-code-quality.mjs 41d25c07ORCA_BACKGROUND_LAUNCH=1 node config/scripts/build-mobile-web-app-bundle.mjscd mobile && node node_modules/expo/bin/cli prebuild --platform ios --no-installplutilaccepts Info.plistRegression controls failed before the relevant repair and passed afterward: reconnect availability, non-Duo live/buffered spacing, rail view continuity across pane focus, immediate keys after host rebuild, plus the companion PR’s pane/rotation/legacy-storage controls.
Exact mobile regression selection
cd mobile ORCA_BACKGROUND_LAUNCH=1 ./node_modules/.bin/vitest run \ src/mobile-web-shell \ src/components/terminal-shortcut-settings-custom-keys.test.tsx \ src/layout/fold-division.test.ts \ src/layout/side-rail-strip.test.ts \ src/layout/side-safe-area.test.tsx \ src/layout/top-chrome-space.test.ts \ src/navigation/route-handoff-host-area.web.test.tsx \ src/platform/keyboard-occlusion.test.tsx \ src/session/MobileSessionCommandDock.test.tsx \ src/session/MobileSessionHeader.test.tsx \ src/session/MobileSessionTabStrip.test.tsx \ src/session/TerminalPaneView.test.tsx \ src/session/mobile-session-preference-startup.test.ts \ src/session/mobile-session-terminal-frame-layout.test.tsx \ src/session/mobile-terminal-layout-choice.test.tsx \ src/session/mobile-terminal-pane-layout.test.ts \ src/session/mobile-terminal-split-gestures.test.tsx \ src/session/mobile-terminal-split-input.test.tsx \ src/session/shell-terminal-key-rail.web.test.tsx \ src/session/use-mobile-session-keyboard-state.test.tsx \ src/session/use-mobile-session-terminal-subscription.test.tsx \ src/session/use-terminal-split-layout.test.tsx \ src/terminal/terminal-accessory-layout.test.ts \ src/terminal/terminal-cell-box-refit.test.tsx \ src/terminal/terminal-foreground-recovery.test.ts \ src/transport/mobile-web-bundle-reply-schemas.test.ts \ src/session/mobile-session-connection-retry.test.tsx \ src/session/shell-terminal-key-rail.test.tsx \ --maxWorkers=2Full repository CI and a complete native app build from the public rebase have not run.
Takeshi Matsumoto (@zytakeshi) tested the earlier implementation on his physical iPhone Duo, including the disappearance of the large unused terminal band. This is user-reported physical-device evidence for that implementation; final public-branch results are recorded separately above.
Reviewer exercise: open a terminal, fold/unfold and rotate; show/hide the keyboard through Live input and the side control; scroll to every configured rail shortcut; change shortcut visibility and D-pad setting; verify the terminal's last complete row remains visible and input reaches the active pane.
Local automated checks ran on Apple Silicon macOS with Xcode 27.1. The final public native app has not been exercised on physical iPhone Duo, other iPhones/iPad, Android, Windows/Linux or live SSH. The screenshots are from the earlier simulator implementation. The native reserved-region source matches the module used for those captures; this is not a substitute for building and testing the complete rebased app.
AI Disclosure
Implementation assistance: Codex GPT-6 Astra (high) during device iteration, Codex GPT-6.1 Sol (xhigh) during upstream preparation, and Claude Code Opus 5.5 (high) on the public continuity/storage port. Independent public-diff reviews and motion graphics: Claude Code Opus 5.5 (xhigh).
The initial product code at
4ce77df4passed a fresh Claude Code Opus 5.5 xhigh review with zero P1/P2 or in-diff defects. Subsequent CodeRabbit and independent Codex reviews led to the runtime repairs listed in the follow-up below; the current follow-up also passed fresh independent standards, behavior and source reviews. Current execution results are recorded above.Review
Fresh Claude Code Opus 5.5 xhigh review covered the aggregate public diff and the standalone companion. It identified the missing reconnect control and non-Duo spacing change, plus rail scroll/rebuild behavior and unnecessary prototype compatibility code. Those paths were repaired with regression evidence. A fresh final pass over the repair diff is recorded in the AI disclosure above. The runner-label concern was checked against current GitHub documentation and image inventory; it is a supported hosted label.
CodeRabbit and review follow-up
CodeRabbit follow-up head:
f8180bfa04c9435b490aef2ebd193ed427b17b61. Companion reviewed head:f1e64ef830690f0914437ecde16ab49ac010963b. Both PRs target main; land #33210 first, then rebase this aggregate. The Duo-only comparison above excludes the companion changes.New regressions failed on the prior implementations for the intended reason and pass after repair, including overlapping route patterns, inactive-pane bottom rows, held-owner handoff, and real Suspense/transition input delivery. The bot's docstring percentage is advisory here: this repository asks for concise comments only where code needs explanation, so boilerplate docstrings were not added.
Narrow header follow-up
At
e15c0ba16820c0e6446f53c96cd86bca09f7f4d1, a narrow one-row header reserves its width for scrollable tabs and the Back/More controls. Terminal layout, New tab, Quick commands, File explorer and Source control move into the existing … sheet when the measured header is below 600 points. Wider headers retain the inline buttons. This also handles a sidebar narrowing an otherwise wide window without adding a row or changing terminal height.The menu reuses the existing action handlers, connection/capability restrictions, and sheet-dismissal sequencing. The terminal-layout chooser has one stable session owner, and the tab strip remains mounted across width changes.
f8180bfaThe narrow-header regression fails on the preceding implementation. The integration test exercises retained tab identity/selection through resizing, every collapsed action, and the wait for menu dismissal before opening another sheet. These are local source/automated results; fresh physical-device acceptance and full upstream CI are not claimed.
Edge spacing follow-up
At
b82ca3f5cd5e5c52bef4f4c9578917bb8a860b11, remove the synthetic 20-point top guard and the terminal input dock's bottom reservation on Duo layouts, including portrait without the side rail. Existing system occlusion handling and side-inset protection remain. Ordinary devices retain their original bottom spacing.With no bottom inset reserved while the Duo terminal dock is visible, the shared keyboard lift uses the full keyboard overlap. This keeps the input row and terminal panes on the same boundary when the keyboard opens. Native chat, browser, Markdown and file modes retain their previous keyboard calculation and safe-area handling, as do ordinary devices. The presentation hook remains the single lift writer; its terminal/dock/toast and reader/chat/browser consumers keep their existing contracts.
e15c0ba1The updated regressions fail on the previous spacing/keyboard implementation. The latest contributor device feedback is recorded above. Exhaustive native touch, home-gesture, orientation and keyboard acceptance remains open; the latest spacing change has no new simulator acceptance run.
Root layout measurement follow-up
At
353a4054de653fdf9c8ed51ab0e29944ea480ee9, remeasure the shell when its root view lays out, including when the WebView's local frame and screen dimensions stay unchanged. This refreshes the status-area geometry after a root-only move, without requiring rotation or remounting the WebView.The root-movement regression fails on the preceding public head and passes with the fix. On this PR branch, the focused mobile selection passed 36 tests across 8 files; mobile production TypeScript, the test typecheck ratchet, all seven changed-code-quality scans, formatting, and
git diff --checkpassed. An independent source review found no blocking defect. Physical Duo confirmation of this intermittent symptom and full upstream CI are not claimed.Upstream main conflict reconciliation
Merge commit
a2583f4eb1d91d732e760143419d30a73fca3095incorporates upstreammainat9149d77de4a588f0ec20f8a37c68a92ca57b2eb6. The 34 reported conflicts are resolved, including Duo rail and pane behavior alongside upstream route, bridge, keyboard, test and comment changes. Both the upstream@expo/clipatch and this branch’sexpo-routerpatch remain in the mobile lockfile; a frozen install passed. The Duo-only comparison linked above ends before this merge so it excludes the repository-wide main changes.On this merged head,
pnpm tcpassed; the mobile Vitest sweep passed 4,972 tests across 492 files; route and shared mobile-bundle tests passed 50 tests across 2 files; and the changed-code-quality gate reported zero new findings across 155 source files. The merged PR is currently reported mergeable by GitHub. Upstream CI and physical-device acceptance are separate pending checks.Agent skill upstream boundary
Notes
xcode-27hosted runner; the October 23 image includes Xcode 27.1. No release workflow was triggered for this contribution.Original community implementation credit is preserved for @larskghf. The media illustrate a broader workspace proposal; maintainers decide the disposition of other contributors' open PRs.
Checklist