Skip to content

feat(mobile): support the iPhone Duo folded and unfolded, with controls in its side status bar - #34484

Merged
AmoabaKelvin merged 2 commits into
mainfrom
iphone-duo
Oct 27, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
iphone-duo

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​252 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​239
Prod 36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1250 $\color{#cf222e}{\Huge{\mathbf{−}}}$​567 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​683

ELI5

The iPhone Duo folds. Before this, Orca treated the unfolded phone like a big screen in only one of the two ways you can hold it, and forgot your open session when you folded it. It also left the tall strip next to the clock empty. Now the app splits however you hold it, keeps your session when you fold, and puts its buttons in that strip.

What Changed

  • Split held either way. The wide-layout cutoff is now the sidebar's minimum plus the narrowest useful detail pane (280 + 375). The unfolded Duo shows the list beside the session in both holds, as Apple's Settings does, and rotating no longer reloads the page. The folded screen stays a phone. The sidebar starts at 30% of the window (280 to 340pt) until you drag it.
  • Folding keeps the session. When unfolded, the page opens sessions inside its own document, so the native route never moved and folding dropped you back on the list. The page now reports where it is (a new location notify; older shells refuse it with a diagnostic only), and the shell reopens that screen natively when the layout narrows. Only the focused screen does this.
  • The status-bar rail holds controls. The Duo's vertical status bar is an 84pt side inset. The native host group leaves it unpadded, so the page reaches it. The focused screen fills it:
    • A terminal session shows its key strip there as a column, and the terminal gets that row back.
    • On the folded screen, Back goes there too, the way Settings does it.
    • Unfolded with no session open, it shows the list's actions and the New button.
    • The folded list moves accounts, tasks and the terminal icon there, with search at the bottom.
    • With no rail (sideways, iPad, other phones), nothing moves.
  • Native sidebar collapse is gone. Every detail pane is a page now, and a page's header cannot bring a native sidebar back, so collapsing from that state was a dead end.

Why

A real rail needs controls inside the WebView's frame. iOS clips subviews to their parent and won't deliver touches outside it, so the shell can't reach past a padded parent. That's why the root SideSafeArea releases the rail edge for the host group, instead of the shell using a negative margin. Native views in that group (the shell's loading and error states, the host edit screen) wrap themselves in SideSafeArea again, which only pads what an outer one left unpadded.

t3code gets its rail items from UIKit's own bars on the iOS 27.1 SDK, through a forked react-native-screens. Our headers aren't system bars, so the page draws the rail itself, using the safe-area insets we already pass it. The sidebar is not aligned to the crease, because Apple's own split apps don't do that either.

Linked Issue

Refs #22597 and #33200. This covers part of each (split, fold continuity, side rail); half-fold postures, IME and VoiceOver checks, and the configurable rail and D-pad are not in it.

Visual Proof

The Duo didn't have its own layout before this, so these are after shots only. They come from the iPhone Duo simulator on iOS 27.1.

Unfolded, no session open. The list's actions are in the rail:

Unfolded list

Unfolded with a terminal. The keys are in the rail:

Unfolded session

Unfolded and held sideways. The strip runs across the top, so the keys stay in the bottom row:

Unfolded sideways

Folded list: accounts, tasks and terminal at the top, search at the bottom:

Folded list

Folded session: Back under the clock, keys below:

Folded session

Folded and in landscape, the rail moves to the left:

Folded landscape session

Testing

On the iPhone Duo simulator (iOS 27.1, Xcode 27), with a dev desktop serving the page bundle. Fold, unfold and rotate were driven through the simulator's hinge and orientation events.

  • Opened a session unfolded, folded, unfolded, rotated both ways and folded again; the session stayed open each time and Back returned to the list.

  • Tapped rail actions (search, Back) on both screens.

  • Checked held sideways, where the keys go back to the bottom row.

  • Not checked: the rail with the soft keyboard up, which doesn't appear on this simulator setup, and a physical device.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Tests cover the wide cutoff for both Duo holds, the fold reopening the session (including a host-route shell left under a pushed session), worktree-id href encoding, and the rail showing only the top screen's claim.

AI Disclosure

Review

Worth a close look: useReleasedSideRail in mobile/src/layout/side-safe-area.tsx and the screens in the host group that now pad themselves.

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

Mobile only. On phones without a rail, iPad, Android and web, the rail rule returns null, so their layout stays the same. The only change there is the sidebar's starting width, which is now 30% of the window; on iPad that ranges from 280pt in portrait to 340pt in landscape. The new bridge notify degrades on older shells (refused with a diagnostic), and older pages ignore the rail insets.

Checklist

  • 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)

@coderabbitai

coderabbitai Bot commented Oct 27, 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

No actionable comments were generated in the recent review.

Recent 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: af2621cb-f5e9-45cb-b763-d2d5f1c8c9d4
Commits

Reviewing files that changed from the base of the PR and between 6638978 and def42d2.

Files selected for processing: 1
  • mobile/src/mobile-web-shell/page-location-report.web.ts

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

Walkthrough

The mobile layout now uses responsive sidebar sizing and side rails for host and session controls. The web-shell bridge reports page locations, and the screen can open a held route when the layout narrows. Non-ready shell states now render through a dedicated screen wrapped in SideSafeArea.

Priority: Normal

Merge Risk: Minimal · up to def42

No concrete merge-blocking risk remains in the reviewed change.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description is detailed and covers the user impact, implementation, rationale, testing, visual evidence, scope, and checklist. However, the Linked Issue section uses “Refs #22597 and #33200” inste… Update the Linked Issue section with the required issue format, such as “Fixes #...”, or provide the repository-approved equivalent for existing issues. Add before-and-after visual evidence, or explicitly state N/A with a valid reason if be…
Docstring Coverage Warning Docstring coverage is 44.07% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: folded and unfolded iPhone Duo support with controls in the side status bar.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the user impact, implementation, rationale, testing, visual evidence, scope, and checklist. However, the Linked Issue section uses “Refs #22597 and #33200” instead of the required issue-link format, and the Visual Proof section provides only after screenshots despite requiring before-and-after evidence or an explicit N/A explanation.

Resolution

Update the Linked Issue section with the required issue format, such as “Fixes #...”, or provide the repository-approved equivalent for existing issues. Add before-and-after visual evidence, or explicitly state N/A with a valid reason if before evidence cannot exist.

Full details: Docstring Coverage

Explanation

Docstring coverage is 44.07% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 59 functions across 48 files.

Resolution

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

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • 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: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a43c7cd5-e48f-4f48-bc46-76a18c62e9c7
Commits

Reviewing files that changed from the base of the PR and between ac154dc and 88db806.

Files selected for processing: 47
  • mobile/app/h/[hostId]/edit.tsx
  • mobile/app/h/_layout.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/layout/host-sidebar-reveal.test.tsx
  • mobile/src/layout/responsive-layout-metrics.test.ts
  • mobile/src/layout/responsive-layout-metrics.ts
  • mobile/src/layout/side-rail.test.tsx
  • mobile/src/layout/side-rail.tsx
  • mobile/src/layout/side-safe-area.tsx
  • 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-test-harness.ts
  • mobile/src/mobile-web-shell/bridge/bridge-client-notifications.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-location.ts
  • mobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client.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-sidebar-matrix.test.tsx
  • mobile/src/mobile-web-shell/host-area-two-hosts.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-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/use-mobile-web-shell-bridge.test.ts
  • mobile/src/mobile-web-shell/use-mobile-web-shell-bridge.ts
  • mobile/src/navigation/host-stack.web.tsx
  • mobile/src/session/MobileSessionAccessoryKeys.tsx
  • mobile/src/session/MobileSessionCommandDock.tsx
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/src/session/MobileSessionHeader.tsx
  • mobile/src/session/MobileSessionSurface.tsx
  • mobile/src/session/mobile-session-command-input-styles.ts
  • mobile/src/session/mobile-session-toast-owner-cleanup.test.tsx
  • mobile/src/session/session-side-rail.tsx
  • mobile/src/storage/preferences.test.ts
  • mobile/src/storage/preferences.ts
Files with no reviewable changes: 2
  • mobile/src/mobile-web-shell/host-area-two-hosts.test.tsx
  • mobile/src/mobile-web-shell/host-area-sidebar-matrix.test.tsx

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

@AmoabaKelvin
AmoabaKelvin force-pushed the iphone-duo branch 2 times, most recently from 2eace87 to 2d0126b Compare October 27, 2026 18:07
@AmoabaKelvin AmoabaKelvin changed the title feat(mobile): iPhone Duo splits held either way, keeps the session across folds, and fills its status-bar rail feat(mobile): support the iPhone Duo folded and unfolded, with controls in its side status bar Oct 27, 2026
…ls in its side status bar

Unfolded, the Duo shows the list beside the session in both holds, and
folding reopens the session the page had open. The Duo's vertical status
bar (an 84pt side inset) now carries the focused screen's controls: the
terminal keys, Back on the cover, and the list's actions. The host group
leaves that edge unpadded so pages reach it; native views there pad it.

The sidebar now sizes from the window until dragged, and native sidebar
collapse is gone, since no page header could reveal it again.
@AmoabaKelvin
AmoabaKelvin merged commit 941f4ec into main Oct 27, 2026
25 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the iphone-duo branch October 27, 2026 22:16
tjonestj3 pushed a commit to tjonestj3/orca that referenced this pull request Oct 28, 2026
…h controls in its side status bar (stablyai#34484)"

This reverts commit 941f4ec.
tjonestj3 pushed a commit to tjonestj3/orca that referenced this pull request Oct 28, 2026
Main's own Duo support (stablyai#34484) is reverted first so this implementation is the one that ships.
AmoabaKelvin added a commit that referenced this pull request Oct 30, 2026
…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.
AmoabaKelvin added a commit that referenced this pull request Oct 30, 2026
…d half-fold layout (#35177)

Carries over #33221 and #33210. Replaces our #34484 Duo support with the community design, on top of main's rebuilt terminal key bar (#36166).

Fixes #33200

Co-authored-by: Takeshi Matsumoto <[email protected]>
Co-authored-by: Lars Keggenhoff <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant