You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mobile): iPhone Duo key rail with D-pad, split terminal panes and half-fold layout - #35177
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.
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.
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)
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.
…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.
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.
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: 4 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Docstring Coverage
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 checks: 4 passed
Check name
Status
Explanation
Title check
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
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
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
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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)
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.
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?
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 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
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.
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'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.
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
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
replaceflag on page navigation now reaches the contributor's host-area handoff.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
Unfolded, held sideways, and half-folded
Folded, on the cover screen
Testing
On the Duo simulator:
~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):
Run locally on the merged head:
pnpm lint,pnpm tcandpnpm check:react-doctor:changedpass.Test changes:
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
Notes
xcode-27runner 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.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)