Skip to content

feat(mobile): iPhone Duo key rail with D-pad, split terminal panes and half-fold layout - #35177

Merged
AmoabaKelvin merged 30 commits into
mainfrom
iphone-duo-workspace
Oct 30, 2026
Merged

AmoabaKelvin merged 30 commits into
mainfrom
iphone-duo-workspace

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 67 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5051 $\color{#cf222e}{\Huge{\mathbf{−}}}$​250 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4801
Prod 146 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4992 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1649 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3343

Carries over #33221 by @zytakeshi, which includes #33210 (split panes) and the groundwork commits by @larskghf from #32733. Their commits are kept as they wrote them, with ours on top.

ELI5

On an iPhone Duo, Orca now uses the contributor's design instead of the one we merged in #34484. The terminal keys, including a D-pad, sit in the Duo's side status strip. Two terminals can be shown side by side or stacked. When the phone is half folded and upright, the screen works like a small laptop: terminal on the upper half, keyboard on the lower half.

What Changed

  • Our Duo support from feat(mobile): support the iPhone Duo folded and unfolded, with controls in its side status bar #34484 is reverted, so this branch's version is the only one. Its side rail, sidebar and fold handling are replaced by the contributor's.
  • From feat(mobile): add iPhone Duo workspace layouts and controls #33221 and feat(mobile): add independent split panes and session continuity #33210:
    • The Duo side rail keeps its look and D-pad, and scrolls when it runs out of room. Since feat(mobile): match every text input to the chat composer and rebuild the terminal dock #36166 rebuilt the terminal key bar on every phone, the rail now lists that bar's keys: sticky ctrl, alt and ⇧, the shell or agent row, and ⋯ for the rest (Paste, Photo, File, F-keys, combos, custom keys).
    • The terminal can show one pane, side by side or stacked. The active terminal survives rotation and resizing.
    • On the half-folded layout, the terminal and Live input sit above the keyboard.
    • On narrow headers, the tabs stay readable and the workspace buttons move into the … menu.
  • What we changed on top, to merge with main:
    • main's light and dark themes reach the contributor's new rail, D-pad and pane headings.
    • main's lazy terminal mount now uses "visible" instead of "active", so both panes of a split mount.
    • main's file-link candidates are wired into the split pane view.
    • main's replace flag on page navigation now reaches the contributor's host-area handoff.
  • Route grants: the session route now declares 17 grants (13 required, 4 optional), because main's PDF viewer and the Duo key rail each need one. The manifest used to cap both lists together at 16. Released shells check each list against 16 on its own and only grant names they implement, so the combined cap only existed for the page's own parser. That parser now accepts up to 32 for a route's granted set, and each list stays capped at 16.
  • The new "Show D-pad" setting only appears on devices that have the side rail.
  • The sidebar keeps the width you chose through folds and rotations. Before this, one narrow pose clamped the saved width and the sidebar stayed at its 280pt minimum until the app restarted. That bug was already on main; the Duo's frequent size changes just made it easy to hit.
  • The bottom bar is main's Keys/Message dock on every phone, the Duo included, so it now clears the cover screen's home indicator.
  • The contributor's new text (layout sheet, pane headings, D-pad, header menu) is translated through the mobile catalogs.
  • main now only lets the active, focused terminal take input. In a split, both visible panes take taps, as the contributor intended.

Why

The contributor's design uses the Duo better than ours. It puts every configured shortcut in the side strip, not a few. It adds split panes and a usable half-fold layout, and it was refined on a physical Duo. Rebasing their 19 commits onto 785 newer main commits would have meant re-deciding conflicts in each one. Merging main into their branch keeps their history intact and puts every reconciliation in our three commits on top, where it is easy to review.

Linked Issue

Fixes #33200

Refs #22597

Visual Proof

All shots are from the iPhone Duo simulator (iOS 27.1) on this branch, with the dev client rebuilt from the branch's native code. The page bundle's build id is in each footer. The white terminal background comes from the dev desktop's light terminal theme, not from this change.

Unfolded, held upright

List Terminal, keys and D-pad in the side strip Split panes, side by side

Unfolded, held sideways, and half-folded

Held sideways, keys along the bottom Half-folded like a laptop, keyboard below the fold Half-folded like a book

Folded, on the cover screen

List Terminal, keys in the strip Landscape, strip on the left (it scrolls)

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On the Duo simulator:

  • The keys and D-pad appear in the side strip on both screens.
  • Folding with a session open stays on that session, in both directions.
  • After you collapse the sidebar, a button brings it back, and Back returns to the list.
  • Picking "Side by side" shows two live terminals.
  • I haven't checked the sidebar width fix on the simulator yet; the machine was too loaded.
  • On the merged Release build: the rail's Ctrl latches, then the D-pad sends Ctrl+Left and the latch clears; ~ types from the rail; ⋯ opens the More keys sheet. A regular iPhone shows main's key bar.

Release build, run locally the way the release workflow runs it (Xcode 27.1, unsigned):

  • The device archive and a Release simulator build both succeed.
  • On a regular iPhone: a pairing link with the app closed opens one confirm screen (Back goes home), a notification tap with the app closed opens the paired desktop, and background, kill and relaunch keep the session and pairing.
  • On the Duo: the app resizes to the inner screen when unfolded, and half-open and closed keep the open terminal.

Run locally on the merged head:

  • pnpm lint, pnpm tc and pnpm check:react-doctor:changed pass.
  • Every mobile suite passes except one E2EE large-frame test, which fails the same way on main.
  • The route manifest and bundle contract tests pass, and the mobile web bundle builds.

Test changes:

  • Mocks were added where the contributor's tests now reach main's newer modules: host profile, top chrome, the header's … sheet and the side-rail hook.
  • One pane test now expects a terminal that was never shown to stay unmounted, which is main's lazy-mount behaviour.
  • The RPC recording harness passes the two new session-startup inputs, so the goldens replay unchanged and none are re-recorded.
  • The display-mode mutant points at the line's new spelling.

Review

Review the commits after the first merge commit, and the key bar resolution in the latest merge. The revert of #34484 and the merge itself are mechanical.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • The iOS release workflow moves to the xcode-27 runner for the 27.1 SDK, which the Duo's reserved-region APIs need. Older iOS versions and other devices keep their existing layout through availability checks.
  • New bridge fields are optional, so older pages and shells ignore them.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

larskghf and others added 24 commits October 25, 2026 01:17
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.
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.
…h controls in its side status bar (#34484)"

This reverts commit 941f4ec.
Main's own Duo support (#34484) is reverted first so this implementation is the one that ships.
…F viewer both fit

Released shells cap the required and optional lists separately and grant only names they implement, so a route's granted set can exceed one list's cap without reaching an older shell or page.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

The changes add iOS scene and reserved-region support, fold-aware host and page layouts, and route metadata for host-area ownership across layouts. The web-shell bridge now carries geometry, fold, storage, and terminal-key-rail state. Session changes add configurable shortcut and D-pad settings, terminal split layouts, per-pane sizing and keyboard handling, and key-rail controls. Tests cover these behaviors, including navigation, storage refresh, pane input, and geometry updates.

Priority: Pending latest changes

Merge Risk: Low · up to dcbcb

The Duo layout work is mostly sound. Before merging, fix the hidden split terminal staying subscribed while native chat is shown. The other open items are minor: an empty geometry field in init frames, possible stale camera-occlusion geometry, a viewport-measurement edge case, and sidebar-width retention on constrained resizes.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 34.72% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: an iPhone Duo key rail with a D-pad, split terminal panes, and a half-fold layout. The raw summary covers all three, including the Duo side rail with shortcuts and D-p…
Linked Issues check Passed The PR meets the active coding requirements in #33200. The Duo layout uses reserved-region, fold, safe-area, and keyboard geometry for cover, inner, and half-fold frames. The split-pane and terminal v…
Out of Scope Changes check Passed The changes remain connected to #33200. Reserved-region native support, scene lifecycle setup, deployment-target handling, and the iOS 27.1 workflow support Duo geometry and compatibility. Split-pane …
Description check Passed The description follows the required structure and provides a clear summary, rationale, linked issue, visual proof, testing details, review notes, compatibility notes, and checklist status. The AI Dis…
Full details: Title check

Explanation

The title names the main change: an iPhone Duo key rail with a D-pad, split terminal panes, and a half-fold layout. The raw summary covers all three, including the Duo side rail with shortcuts and D-pad, the side-by-side or stacked pane layouts, and the fold split handling. The title is specific and omits some secondary changes such as the iOS release runner update and the route-grant changes, which is acceptable.

Full details: Linked Issues check

Explanation

The PR meets the active coding requirements in #33200. The Duo layout uses reserved-region, fold, safe-area, and keyboard geometry for cover, inner, and half-fold frames. The split-pane and terminal viewport changes place visible panes above the keyboard and preserve pane identity during resize and rotation. The terminal key rail provides configured toolbar and shortcut controls, scrolling, Live input keyboard control, and a repeating D-pad. Direction-pad availability changes defaults without discarding saved settings. Preference refresh hooks update shortcuts and custom keys while the session remains mounted. Header overflow handling, fold-aware navigation, negotiated storage keys, optional bridge fields, and route grants support touchable actions and mixed-version behavior. Automated tests cover these behaviors. The broader IME, accessibility, and platform acceptance work in #22597 is explicitly separate.

Full details: Out of Scope Changes check

Explanation

The changes remain connected to #33200. Reserved-region native support, scene lifecycle setup, deployment-target handling, and the iOS 27.1 workflow support Duo geometry and compatibility. Split-pane state, pane interaction, terminal refitting, and responsive continuity implement the companion scope stated by #33200. Bridge geometry, rail claims, route grants, storage negotiation, and host-area handoff support layout continuity and the new rail. Theme, localization, tests, and main-branch integration changes support the same user-facing behavior. The summary does not demonstrate an unrelated change. The excluded mobile/pnpm-lock.yaml file was not used as evidence.

Full details: Description check

Explanation

The description follows the required structure and provides a clear summary, rationale, linked issue, visual proof, testing details, review notes, compatibility notes, and checklist status. The AI Disclosure section is omitted, but the template permits omission for internal contributors; the remaining content is sufficiently complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 34.72% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 72 functions across 95 files. (20 skipped: 3 unsupported, 17 over the file limit.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8


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: 4d7bd4f8-6b00-4c86-bdbb-47ac62835521
Commits

Reviewing files that changed from the base of the PR and between 80f47e7 and 66a3197.

Files ignored due to path filters: 1
  • mobile/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 201
  • .github/workflows/mobile-ios-release.yml
  • config/scripts/build-mobile-web-app-bundle.mjs
  • config/scripts/mobile-web-page-routes.mjs
  • config/scripts/mobile-web-page-routes.test.mjs
  • mobile/app.json
  • mobile/app/_layout.tsx
  • mobile/app/h/[hostId]/edit.tsx
  • mobile/app/h/[hostId]/index.web.tsx
  • mobile/app/h/_layout.tsx
  • mobile/modules/orca-reserved-regions/expo-module.config.json
  • mobile/modules/orca-reserved-regions/ios/OrcaReservedRegions.podspec
  • mobile/modules/orca-reserved-regions/ios/OrcaReservedRegionsModule.swift
  • mobile/modules/orca-reserved-regions/package.json
  • mobile/modules/orca-reserved-regions/src/index.ts
  • mobile/modules/orca-window-controls-inset/ios/OrcaWindowControlsInsetSubscriber.swift
  • mobile/patches/[email protected]
  • mobile/plugins/ios-pod-deployment-target-floor.js
  • mobile/plugins/ios-scene-lifecycle.js
  • mobile/pnpm-workspace.yaml
  • mobile/src/components/TerminalShortcutSettings.tsx
  • mobile/src/components/drag-reorder-test-harness.test-fixture.tsx
  • mobile/src/components/terminal-shortcut-settings-custom-keys.test.tsx
  • mobile/src/components/terminal-shortcut-settings-styles.ts
  • mobile/src/host-edit-route-accessibility.test.ts
  • mobile/src/host-edit-save-flow.test.ts
  • mobile/src/host-screen/host-rail-actions.tsx
  • mobile/src/host-screen/host-screen-header.tsx
  • mobile/src/host-screen/use-host-screen-controller.ts
  • mobile/src/layout/fold-division.test.ts
  • mobile/src/layout/fold-division.ts
  • mobile/src/layout/host-sidebar-reveal.test.tsx
  • mobile/src/layout/reserved-regions.ts
  • mobile/src/layout/reserved-regions.web.ts
  • mobile/src/layout/responsive-layout-metrics.test.ts
  • mobile/src/layout/responsive-layout-metrics.ts
  • mobile/src/layout/side-rail-strip.test.ts
  • mobile/src/layout/side-rail-strip.ts
  • mobile/src/layout/side-rail.test.tsx
  • mobile/src/layout/side-rail.tsx
  • mobile/src/layout/side-safe-area.test.tsx
  • mobile/src/layout/side-safe-area.tsx
  • mobile/src/layout/top-chrome-space.test.ts
  • mobile/src/layout/top-chrome-space.ts
  • mobile/src/layout/use-fold-split.ts
  • mobile/src/layout/use-fold-split.web.ts
  • mobile/src/layout/use-shell-side-rail.ts
  • mobile/src/layout/use-shell-side-rail.web.ts
  • mobile/src/layout/use-top-chrome-space.ts
  • mobile/src/mobile-web-shell/MobileWebShellScreen.test.tsx
  • mobile/src/mobile-web-shell/MobileWebShellScreen.tsx
  • mobile/src/mobile-web-shell/ShellStateScreen.tsx
  • mobile/src/mobile-web-shell/bridge-host-back.ts
  • mobile/src/mobile-web-shell/bridge-host-contract.ts
  • mobile/src/mobile-web-shell/bridge-host-notify.ts
  • mobile/src/mobile-web-shell/bridge-host-route.ts
  • mobile/src/mobile-web-shell/bridge-host-terminal-key-rail.test.ts
  • mobile/src/mobile-web-shell/bridge-host-test-harness.ts
  • mobile/src/mobile-web-shell/bridge-host.ts
  • mobile/src/mobile-web-shell/bridge/bridge-back-round-trip.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-inbound-frames.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-init-handshake.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-notifications.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-session.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-shell-session.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-terminal-keys.ts
  • mobile/src/mobile-web-shell/bridge/bridge-envelope.ts
  • mobile/src/mobile-web-shell/bridge/bridge-fold-division.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-fold-division.ts
  • mobile/src/mobile-web-shell/bridge/bridge-init-frame.ts
  • mobile/src/mobile-web-shell/bridge/bridge-native-verb-call.ts
  • mobile/src/mobile-web-shell/bridge/bridge-notify-envelope.ts
  • mobile/src/mobile-web-shell/bridge/bridge-notify-grants.ts
  • mobile/src/mobile-web-shell/bridge/bridge-page-geometry.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-page-geometry.ts
  • mobile/src/mobile-web-shell/bridge/bridge-page-location.ts
  • mobile/src/mobile-web-shell/bridge/bridge-page-route-grants.ts
  • mobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client.ts
  • mobile/src/mobile-web-shell/bridge/bridge-terminal-key.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-terminal-key.ts
  • mobile/src/mobile-web-shell/bridge/page-async-storage.ts
  • mobile/src/mobile-web-shell/catch-all-page-route-states.test.tsx
  • mobile/src/mobile-web-shell/encoded-route-href.test.ts
  • mobile/src/mobile-web-shell/encoded-route-href.ts
  • mobile/src/mobile-web-shell/host-area-fold.test.tsx
  • mobile/src/mobile-web-shell/host-area-in-page-cleanup.test.tsx
  • mobile/src/mobile-web-shell/host-area-layout-class-change.test.tsx
  • mobile/src/mobile-web-shell/host-area-leave-session.test.tsx
  • mobile/src/mobile-web-shell/host-area-session.test.ts
  • mobile/src/mobile-web-shell/host-area-sidebar-matrix.test.tsx
  • mobile/src/mobile-web-shell/host-area-two-hosts.test.tsx
  • mobile/src/mobile-web-shell/host-root-responsive-content.test.tsx
  • mobile/src/mobile-web-shell/mobile-web-shell-keyboard-overlay-screen.test.tsx
  • mobile/src/mobile-web-shell/mobile-web-shell-screen-test-harness.tsx
  • mobile/src/mobile-web-shell/mobile-web-shell-screen-test-mocks.tsx
  • mobile/src/mobile-web-shell/page-fold-division.test.tsx
  • mobile/src/mobile-web-shell/page-fold-division.ts
  • mobile/src/mobile-web-shell/page-location-on-fold.ts
  • mobile/src/mobile-web-shell/page-location-report.ts
  • mobile/src/mobile-web-shell/page-location-report.web.ts
  • mobile/src/mobile-web-shell/page-route-policy.ts
  • mobile/src/mobile-web-shell/page-safe-area-insets.test.ts
  • mobile/src/mobile-web-shell/page-safe-area-insets.ts
  • mobile/src/mobile-web-shell/page-storage-keys-negotiation.test.ts
  • mobile/src/mobile-web-shell/page-storage-keys.ts
  • mobile/src/mobile-web-shell/terminal-direction-pad.test.tsx
  • mobile/src/mobile-web-shell/terminal-direction-pad.tsx
  • mobile/src/mobile-web-shell/terminal-key-rail.test.tsx
  • mobile/src/mobile-web-shell/terminal-key-rail.tsx
  • mobile/src/mobile-web-shell/use-mobile-web-shell-bridge.test.ts
  • mobile/src/mobile-web-shell/use-mobile-web-shell-bridge.ts
  • mobile/src/mobile-web-shell/use-shell-page-storage-refresh.test.tsx
  • mobile/src/mobile-web-shell/use-shell-page-storage-refresh.ts
  • mobile/src/navigation/host-stack.web.tsx
  • mobile/src/navigation/route-handoff-host-area.web.test.tsx
  • mobile/src/platform/keyboard-occlusion.test.tsx
  • mobile/src/platform/keyboard-occlusion.ts
  • mobile/src/platform/shell-storage.ts
  • mobile/src/platform/shell-storage.web.ts
  • mobile/src/session/MobileSessionAccessoryKeys.tsx
  • mobile/src/session/MobileSessionActiveContent.tsx
  • mobile/src/session/MobileSessionCommandDock.test.tsx
  • mobile/src/session/MobileSessionCommandDock.tsx
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/src/session/MobileSessionHeader.test.tsx
  • mobile/src/session/MobileSessionHeader.tsx
  • mobile/src/session/MobileSessionHeaderMoreActionsSheet.tsx
  • mobile/src/session/MobileSessionSheets.test.tsx
  • mobile/src/session/MobileSessionSheets.tsx
  • mobile/src/session/MobileSessionSurface.tsx
  • mobile/src/session/MobileSessionTabStrip.test.tsx
  • mobile/src/session/MobileSessionTabStrip.tsx
  • mobile/src/session/MobileSessionTerminalLayoutSheet.tsx
  • mobile/src/session/MobileTerminalLiveInputRow.tsx
  • mobile/src/session/MobileTerminalLiveInputStatus.tsx
  • mobile/src/session/TerminalPaneView.test.tsx
  • mobile/src/session/TerminalPaneView.tsx
  • mobile/src/session/mobile-session-command-input-styles.ts
  • mobile/src/session/mobile-session-connection-retry.test.tsx
  • mobile/src/session/mobile-session-header-overflow.test.tsx
  • mobile/src/session/mobile-session-keyboard-edge-layout.test.tsx
  • mobile/src/session/mobile-session-preference-startup.test.ts
  • mobile/src/session/mobile-session-terminal-frame-layout.test.tsx
  • mobile/src/session/mobile-session-toast-owner-cleanup.test.tsx
  • mobile/src/session/mobile-terminal-layout-choice.test.tsx
  • mobile/src/session/mobile-terminal-pane-layout.test.ts
  • mobile/src/session/mobile-terminal-pane-layout.ts
  • mobile/src/session/mobile-terminal-split-gestures.test.tsx
  • mobile/src/session/mobile-terminal-split-input.test.tsx
  • mobile/src/session/session-side-rail.tsx
  • mobile/src/session/shell-terminal-key-rail.test.tsx
  • mobile/src/session/shell-terminal-key-rail.ts
  • mobile/src/session/shell-terminal-key-rail.web.test.tsx
  • mobile/src/session/shell-terminal-key-rail.web.ts
  • mobile/src/session/use-mobile-session-accessory-selection.ts
  • mobile/src/session/use-mobile-session-controller.ts
  • mobile/src/session/use-mobile-session-keyboard-state.test.tsx
  • mobile/src/session/use-mobile-session-keyboard-state.ts
  • mobile/src/session/use-mobile-session-lifecycle.ts
  • mobile/src/session/use-mobile-session-panel-route-actions.tsx
  • mobile/src/session/use-mobile-session-presentation.ts
  • mobile/src/session/use-mobile-session-screen-state.ts
  • mobile/src/session/use-mobile-session-startup.ts
  • mobile/src/session/use-mobile-session-tab-application.ts
  • mobile/src/session/use-mobile-session-tab-switching.ts
  • mobile/src/session/use-mobile-session-terminal-runtime.ts
  • mobile/src/session/use-mobile-session-terminal-stream-display.ts
  • mobile/src/session/use-mobile-session-terminal-subscription.test.tsx
  • mobile/src/session/use-mobile-session-terminal-subscription.ts
  • mobile/src/session/use-mobile-session-terminal-webview.ts
  • mobile/src/session/use-terminal-key-rail-toolbar.ts
  • mobile/src/session/use-terminal-split-layout.test.tsx
  • mobile/src/session/use-terminal-split-layout.ts
  • mobile/src/storage/mirrored-storage-keys.ts
  • mobile/src/storage/preferences.test.ts
  • mobile/src/storage/preferences.ts
  • mobile/src/terminal/document/mouse-click-drag.ts
  • mobile/src/terminal/document/surface-touch-gestures.ts
  • mobile/src/terminal/document/wheel-scroll.ts
  • mobile/src/terminal/terminal-accessory-layout.test.ts
  • mobile/src/terminal/terminal-accessory-layout.ts
  • mobile/src/terminal/terminal-accessory-repeat.ts
  • mobile/src/terminal/terminal-cell-box-refit.test.tsx
  • mobile/src/terminal/terminal-custom-keys.ts
  • mobile/src/terminal/terminal-foreground-recovery.test.ts
  • mobile/src/terminal/terminal-foreground-recovery.ts
  • mobile/src/terminal/terminal-viewport-refit-options.ts
  • mobile/src/terminal/terminal-viewport-refit.ts
  • mobile/src/terminal/terminal-webview-contract.ts
  • mobile/src/terminal/terminal-webview-notification-dispatch.ts
  • mobile/src/terminal/use-terminal-webview-controller.ts
  • mobile/src/test-support/rpc-recording/adapters/session-startup-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/mutants/operation-mutations.ts
  • mobile/src/transport/mobile-web-bundle-reply-schemas.test.ts
  • mobile/src/transport/mobile-web-bundle-reply-schemas.ts
  • mobile/vitest.setup.ts
  • mobile/web-entry/index.tsx
  • mobile/web-entry/web-overrides.json
  • src/shared/mobile-web-bundle/manifest-contract.test.ts
  • src/shared/mobile-web-bundle/manifest-contract.ts
Files with no reviewable changes: 18
  • mobile/src/layout/side-rail.test.tsx
  • mobile/src/mobile-web-shell/bridge/bridge-page-location.ts
  • mobile/src/host-edit-route-accessibility.test.ts
  • mobile/src/mobile-web-shell/page-location-on-fold.ts
  • mobile/src/session/MobileSessionAccessoryKeys.tsx
  • mobile/src/mobile-web-shell/host-area-in-page-cleanup.test.tsx
  • mobile/src/mobile-web-shell/host-area-fold.test.tsx
  • mobile/src/mobile-web-shell/encoded-route-href.test.ts
  • mobile/src/mobile-web-shell/page-location-report.ts
  • mobile/src/layout/responsive-layout-metrics.test.ts
  • mobile/src/host-edit-save-flow.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-native-verb-call.ts
  • mobile/src/mobile-web-shell/bridge-host-test-harness.ts
  • mobile/src/session/session-side-rail.tsx
  • mobile/src/host-screen/host-rail-actions.tsx
  • mobile/src/session/mobile-session-toast-owner-cleanup.test.tsx
  • mobile/src/mobile-web-shell/page-location-report.web.ts
  • mobile/src/mobile-web-shell/encoded-route-href.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment on lines +129 to +131
divisions: window.reservedRegions(kind: .division).map(\.frame),
hasFoldDivision: !window.reservedRegions(kind: .division, options: .includeInactive).isEmpty,
occlusions: window.reservedRegions(kind: .occlusion).map(\.frame),

@coderabbitai coderabbitai Bot Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Track reserved-region changes outside layout.

If the inner camera becomes active without a resize or hinge update, this probe may not run layoutSubviews again. Its onChange payload can then retain stale occlusions, leaving content under the camera. UIKit documents automatic change tracking when a view reads its reserved regions in updateConstraints; these reads occur in layoutSubviews on window instead. Read the regions from the probe in updateConstraints, convert their frames to window coordinates, and schedule a snapshot update when they change. (developer.apple.com)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this one for a follow-up: moving the reads into updateConstraints is native UIKit behaviour I can only verify on Duo hardware, where the inner camera can toggle without a layout pass. The simulator doesn't exercise that path, and every fold and rotation already goes through layoutSubviews.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmoabaKelvin Understood. Deferring this to a hardware-verified follow-up is reasonable. The inner-camera toggle path remains unverified; fold and rotation coverage does not establish that behavior.

For the follow-up, toggle the inner camera on Duo hardware without resizing or folding, and check that onChange updates the occlusions.

Would you like me to open a GitHub issue for this follow-up?

You are interacting with an AI system.

Comment thread mobile/src/layout/side-rail.tsx Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Reuse the renderer's React instance after resetting… · keyboard-occlusion.test.tsx:101-103

mobile/src/platform/keyboard-occlusion.test.tsx:101-103
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Reuse the renderer's React instance after resetting modules.

vi.resetModules() clears the cache, but the top-level React and React Test Renderer imports are not reevaluated. The dynamically imported keyboard-occlusion module can therefore load a second React instance. Its hooks use a different dispatcher than the renderer, so mounting Harness can fail with React's Invalid hook call error.

Suggested fix
-import { createElement } from 'react'
+import * as React from 'react'
+import { createElement } from 'react'
 import { act, create } from 'react-test-renderer'
@@
   beforeEach(async () => {
     vi.resetModules()
+    vi.doMock('react', () => React)
     keyboardModule = await import('./keyboard-occlusion')

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: 75d09b51-7cae-4843-86c3-3267e5d1e310
Commits

Reviewing files that changed from the base of the PR and between 66a3197 and 8295292.

Files selected for processing: 4
  • config/scripts/mobile-web-page-routes.mjs
  • mobile/src/platform/keyboard-occlusion.test.tsx
  • mobile/src/session/mobile-terminal-split-gestures.test.tsx
  • mobile/src/terminal/terminal-web-document-mount.test.ts
Files skipped from review as they are similar to previous changes: 2
  • config/scripts/mobile-web-page-routes.mjs
  • mobile/src/platform/keyboard-occlusion.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

The window-size effect re-clamped the stored width, so one narrow pose left the sidebar at its minimum until relaunch. Keep the chosen width and clamp it per window.
tjonestj3 added a commit to tjonestj3/orca that referenced this pull request Oct 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Keep the chosen sidebar width when a drag does not change the displayed width. · _layout.tsx:110

mobile/app/h/_layout.tsx:110
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the chosen sidebar width when a drag does not change the displayed width.

clampSidebarToWindow limits only the displayed width. onPanResponderMove still writes that clamped value into chosenSidebarWidth. The release and terminate handlers then save the displayed width. With a chosen width of 500 and a window that clamps the sidebar to 380, a tap or a rightward drag stores 380 in place of 500. Widening the window later does not restore 500.

Write the chosen width only when the drag changes the displayed width. Save the chosen width on release.

🐛 Suggested fix
   const widthRef = useRef(sidebarWidth)
   widthRef.current = sidebarWidth
+  const chosenWidthRef = useRef(chosenSidebarWidth)
+  chosenWidthRef.current = chosenSidebarWidth
   const windowWidthRef = useRef(windowWidth)
   windowWidthRef.current = windowWidth
   const dragStartRef = useRef(sidebarWidth)
       onPanResponderMove: (_evt, g) => {
-        setSidebarWidth(clampSidebarToWindow(dragStartRef.current + g.dx, windowWidthRef.current))
+        const next = clampSidebarToWindow(dragStartRef.current + g.dx, windowWidthRef.current)
+        // A drag that leaves the displayed width unchanged must not overwrite the chosen width.
+        if (next !== widthRef.current) {
+          setSidebarWidth(next)
+        }
       },
       onPanResponderRelease: () => {
-        void saveHostSidebarWidth(widthRef.current)
+        void saveHostSidebarWidth(chosenWidthRef.current)
       },
       onPanResponderTerminate: () => {
-        void saveHostSidebarWidth(widthRef.current)
+        void saveHostSidebarWidth(chosenWidthRef.current)
       }

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: 5cf657d4-8457-4be9-9785-8f78a95ceb67
Commits

Reviewing files that changed from the base of the PR and between 8295292 and f91c627.

Files selected for processing: 1
  • mobile/app/h/_layout.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Main now gates terminal input on the active, focused pane; split panes gate it on visibility, so the second visible pane still takes taps.
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The changes affect mobile terminal use and the shell-to-page layout contract.

Fix the hidden terminal resize and older-bundle workspace loss before merging.

Findings

  1. P1 Chat resizes a hidden terminal ▶
  2. P1 Folding loses older bundles' workspace ▶

Summary

Adds the Duo key rail and D-pad, split terminal panes, native fold geometry, and cross-layout page ownership.

  • The iPhone Duo side strip holds terminal shortcuts and a D-pad.
  • Terminal sessions can show two panes side by side or stacked.
  • The Duo layout keeps workspace and terminal content on usable sides of the fold.
  • The mobile shell shares fold, rail, and terminal layout details with web pages.
  • The iOS build includes the reserved-region support used by Duo layouts.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Geometry[Native window and keyboard geometry] --> Shell[Mobile shell]
  Shell -->|Geometry and available keys| Page[Delivered page]
  Page -->|Focused terminal and toolbar| Rail[Native key rail]
  Rail -->|Owner-checked key press| Page
  Page --> Panes[Visible terminal panes]
  Panes --> Streams[Per-terminal streams and sizes]
Loading

Reviews (1) · Last reviewed commit: "Merge main into iPhone Duo workspace" · Reviewed by Greptile

Main's rebuilt terminal key bar (#36166) wins on every phone. The Duo's
side-strip rail keeps its look and D-pad but now lists that bar's keys:
sticky ctrl/alt/shift, the shell or agent row, and ⋯ for the rest.
…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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 1
mobile/src/mobile-web-shell/bridge/bridge-client-shell-session.ts: 1

31-41: Trivial · Maintainability & Code Quality · Low value

Move the route-update doc comments back to onRouteUpdate.

The JSDoc at Lines 31-40 describes when a route update fires: a second init that rewrites a param, with one delivery per tap. That JSDoc is now attached to onStorageUpdate. onStorageUpdate fires only on a same-session init with refreshTerminalShortcuts. The comment at Lines 244-245 also describes a route ("reads the route it wants"), but it sits on onStorageUpdate. onRouteUpdate now has no contract doc.

The same displacement appears in other files:

  • In use-mobile-web-shell-bridge.ts Lines 51-54, the doc for publishStorage describes publishRoute.
  • In bridge-host-contract.ts Lines 86-87 and bridge-host-route.ts Line 31, the fold-division doc sits on pageGeometry.
♻️ Proposed fix
-  /**
-   * Fires each time the shell rewrites a param of the screen this page is already on, ...
-   */
-  onStorageUpdate: (listener: () => void) => () => void
-  onRouteUpdate: (listener: (route: BridgeInitRoute | null) => void) => () => void
+  /** Fires when a same-session `init` refreshes the terminal-shortcut storage keys. */
+  onStorageUpdate: (listener: () => void) => () => void
+  /**
+   * Fires each time the shell rewrites a param of the screen this page is already on, ...
+   */
+  onRouteUpdate: (listener: (route: BridgeInitRoute | null) => void) => () => void

Also applies to: 244-245


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: bd15c24d-6d99-4b60-9928-dd01bd960c2e
Commits

Reviewing files that changed from the base of the PR and between 180d329 and dcbcbab.

Files ignored due to path filters: 1
  • mobile/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 85
  • config/scripts/build-mobile-web-app-bundle.mjs
  • mobile/app.json
  • mobile/app/_layout.tsx
  • mobile/app/h/[hostId]/edit.tsx
  • mobile/src/components/TerminalShortcutSettings.tsx
  • mobile/src/host-screen/host-rail-actions.tsx
  • mobile/src/host-screen/host-screen-header.tsx
  • mobile/src/host-screen/use-host-screen-controller.ts
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/mobile-web-shell/MobileWebShellScreen.tsx
  • mobile/src/mobile-web-shell/ShellStateScreen.tsx
  • mobile/src/mobile-web-shell/bridge-host-contract.ts
  • mobile/src/mobile-web-shell/bridge-host-notify.ts
  • mobile/src/mobile-web-shell/bridge-host-route.ts
  • mobile/src/mobile-web-shell/bridge-host.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-notifications.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-session.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-shell-session.ts
  • mobile/src/mobile-web-shell/bridge/bridge-envelope.ts
  • mobile/src/mobile-web-shell/bridge/bridge-init-frame.ts
  • mobile/src/mobile-web-shell/bridge/bridge-notify-envelope.ts
  • mobile/src/mobile-web-shell/bridge/bridge-notify-grants.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client.ts
  • mobile/src/mobile-web-shell/bridge/bridge-terminal-key.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-terminal-key.ts
  • mobile/src/mobile-web-shell/host-area-in-page-cleanup.test.tsx
  • mobile/src/mobile-web-shell/terminal-direction-pad.tsx
  • mobile/src/mobile-web-shell/terminal-key-rail.test.tsx
  • mobile/src/mobile-web-shell/terminal-key-rail.tsx
  • mobile/src/mobile-web-shell/use-mobile-web-shell-bridge.test.ts
  • mobile/src/mobile-web-shell/use-mobile-web-shell-bridge.ts
  • mobile/src/mobile-web-shell/use-shell-key-rail.tsx
  • mobile/src/mobile-web-shell/use-shell-page-storage-refresh.test.tsx
  • mobile/src/mobile-web-shell/use-shell-page-storage-refresh.ts
  • mobile/src/navigation/host-stack.web.tsx
  • mobile/src/session/MobileSessionAccessoryKeys.tsx
  • mobile/src/session/MobileSessionActiveContent.tsx
  • mobile/src/session/MobileSessionCommandDock.test.tsx
  • mobile/src/session/MobileSessionCommandDock.tsx
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/src/session/MobileSessionHeader.tsx
  • mobile/src/session/MobileSessionHeaderMoreActionsSheet.tsx
  • mobile/src/session/MobileSessionSheets.tsx
  • mobile/src/session/MobileSessionTabStrip.tsx
  • mobile/src/session/MobileSessionTerminalLayoutSheet.tsx
  • mobile/src/session/MobileTerminalMoreKeysSheet.tsx
  • mobile/src/session/TerminalPaneView.tsx
  • mobile/src/session/mobile-session-command-dock-shown.ts
  • mobile/src/session/mobile-session-preference-startup.test.ts
  • mobile/src/session/mobile-session-toast-owner-cleanup.test.tsx
  • mobile/src/session/mobile-terminal-split-gestures.test.tsx
  • mobile/src/session/mobile-worker-takeover-send-sites.test.ts
  • mobile/src/session/orphaned-markdown-draft-tabs.ts
  • mobile/src/session/session-side-rail.tsx
  • mobile/src/session/shell-terminal-key-rail.test.tsx
  • mobile/src/session/shell-terminal-key-rail.web.test.tsx
  • mobile/src/session/terminal-dock-styles.ts
  • mobile/src/session/use-mobile-session-controller.ts
  • mobile/src/session/use-mobile-session-lifecycle.ts
  • mobile/src/session/use-mobile-session-panel-route-actions.tsx
  • mobile/src/session/use-mobile-session-screen-state.ts
  • mobile/src/session/use-mobile-session-startup.ts
  • mobile/src/session/use-mobile-session-tab-application.ts
  • mobile/src/session/use-mobile-session-terminal-runtime.ts
  • mobile/src/session/use-mobile-session-terminal-subscription.test.tsx
  • mobile/src/session/use-mobile-session-terminal-webview.ts
  • mobile/src/session/use-session-terminal-key-rail.ts
  • mobile/src/session/use-terminal-split-layout.ts
  • mobile/src/storage/mirrored-storage-keys.ts
  • mobile/src/terminal/terminal-cell-box-refit.test.tsx
  • mobile/src/terminal/terminal-foreground-recovery.test.ts
  • mobile/src/terminal/terminal-webview-notification-dispatch.ts
  • mobile/web-entry/index.tsx
  • mobile/web-entry/web-overrides.json
Files with no reviewable changes: 15
  • mobile/src/session/terminal-dock-styles.ts
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/mobile-web-shell/host-area-in-page-cleanup.test.tsx
  • mobile/src/i18n/locales/zh.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/session/session-side-rail.tsx
  • mobile/src/i18n/locales/pt.json
  • mobile/src/host-screen/host-rail-actions.tsx
  • mobile/src/session/mobile-session-toast-owner-cleanup.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit a803cbe into main Oct 30, 2026
54 checks passed
gsxdsm added a commit to gsxdsm/orca-stably that referenced this pull request Oct 31, 2026
Takes upstream's iPhone Duo design (stablyai#35177) over the fork's side-rail Duo
layout. Re-applies the fork's add-project-from-phone, terminal
dismiss-keyboard and swipe-back gestures, and dev-build chores on top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

iPhone Duo: reclaim terminal space and provide configurable side controls

2 participants