Skip to content

feat(mobile): back control in the iPhone Duo status column when chat is collapsed - #37185

Open
gsxdsm wants to merge 30 commits into
stablyai:mainfrom
gsxdsm:feat/mobile-duo-rail-back-pr
Open

gsxdsm wants to merge 30 commits into
stablyai:mainfrom
gsxdsm:feat/mobile-duo-rail-back-pr

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Merged with current main (1bc358fbafb) on 2026-11-27. pnpm check:changed --base=upstream/main passed on 9b0d6f341f4.

Stacked on #36726 (Duo full-width chat, which adds the expand/collapse toggle this uses). Until #36726 merges, this diff includes its commits; review only the last commit, fix(mobile): …Duo rail back… (1138341).

ELI5

On the iPhone Duo, collapsing the chat leaves the right-hand status column empty. Now a back button sits there, centered under the status icons, so getting back to the session list is one tap away. It hides while you type.

What Changed

  • When the Duo chat is collapsed (not expanded), a 44pt back control renders in the status column and goes back to the host's session list, the same action as the header back.
  • Placement uses measured geometry, not fixed numbers. Horizontally, it is centered on the reported status-cluster midX (the island/status glyphs), clamped so the whole control stays inside the column. Vertically, it is 8pt below the reported status occlusion, or 8pt above a column that touches the bottom edge (turned posture).
  • It works on the folded cover, unfolded, book-split (never crosses the hinge) and turned.
  • It hides while the session keyboard height is above 0 (chat composer and terminal share that signal) and returns when the keyboard closes.
  • Hidden when chat is expanded or when no status column is present; other phones are unaffected.

Why

The collapsed Duo layout leaves the status column as dead space, and the header back sits far from the thumb on the cover screen. Under the status icons is the natural spot, but only if it clears the island and status glyphs in every posture, hence the measured placement.

Linked Issue

Fixes #37180

Visual Proof

Real iPhone Duo simulator screenshot (cover, collapsed scratch chat); the Back control sits in the status column below the wifi icon, clear of the chat. No personal data in frame. The headless layout mockups for cover, inner, split, turned and keyboard-hidden are layout renders, not device shots, and are in a comment.

Duo rail back control

Testing

  • Focused rail placement and visibility tests (60/60), including hide-while-keyboard-is-up.
  • pnpm typecheck && pnpm typecheck:tests in mobile; root pnpm tc; node config/scripts/verify-mobile-localization.mjs; npx oxlint (0 errors).
  • Full mobile vitest: 1217 files passed. The only failures are known local-environment ones, unrelated (NoticeRow react-native-svg symlink, a WorktreeAgentList timeout, e2ee large-frame, a stale native-document-bundle Vite cache).
  • On device: collapse a Duo chat, folded and unfolded, tap back, then open the keyboard and confirm it hides.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 1, 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 change adds side-inset release for eligible web session routes and applies the inset to session and native chat layouts. It adds a device-wide chat expansion setting synchronized through page storage, along with composer width controls. It also adds a status-column back button for collapsed chat, with page Back consumers checked before fallback navigation. Tests cover inset geometry, chat posture and persistence, and back-button visibility and dispatch.

Severity of issue fixed: Medium

Merge Risk: Low · previous review 343a1

The change is mergeable with awareness of localized layout issues and a rail Back button that can require using the header instead.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description follows the repository template and covers the main required sections. The ELI5, What Changed, and Why sections are clear and tied to the linked issue #37180. The Visual Proof section … Add a Risk section that names the riskiest part of the change (for example, the measured status-occlusion placement and the keyboard-inset hide logic), gives a Level of Low, Medium, or High, and states how to revert. Complete the Performanc…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding a back control to the iPhone Duo status column when chat is collapsed.
Linked Issues check Passed Scope: [#37180] is the only active directly linked issue. Its coding requirements are: (1) a back control in the status column when chat is collapsed; (2) centered under the status icons and below the…
Out of Scope Changes check Passed The whole-PR diff includes the stacked commits of #36726 (device-wide Duo chat width state, width toggle, storage-key plumbing). The PR description states these commits are included until #36726 merge…
Full details: Linked Issues check

Explanation

Scope: [#37180] is the only active directly linked issue. Its coding requirements are: (1) a back control in the status column when chat is collapsed; (2) centered under the status icons and below the Dynamic Island and status occlusion; (3) hidden while the keyboard is up; (4) working folded, unfolded, split, and turned.

Evidence from the whole-PR summary at the reviewed head:

  • Requirement 1: DuoRailBackButton renders only when duoRailBackVisible is true. That function requires visible chat, a collapsed rail, a non-null side-rail strip, and a keyboard inset not greater than 0 (mobile/src/session/duo-rail-back.ts). Tests in duo-rail-back.test.tsx cover visibility.
  • Requirement 2: duoRailBackFrame (mobile/src/layout/duo-status-row.ts) centers the 44-point control on the reported status-cluster mark. When no mark is found, it uses a fixed edge offset plus half the glyph size. It clamps the horizontal position inside the column. It places the control 8pt (spacing.sm) below top-origin status occlusion, or above a column that touches the bottom edge. Tests in duo-status-row.test.ts cover alignment, clearance, bottom-edge placement, missing occlusion, and edge clamping.
  • Requirement 3: duoRailBackVisible hides the control when keyboardInset is greater than 0. The duo-rail-back tests cover keyboard behavior.
  • Requirement 4: The geometry helper uses reported strip and occlusion data for left and right rails, cover and inner postures, and turned (bottom-touching) columns. The tests cover these cases. The split (book) posture is covered by the reported-geometry logic; the summary does not list a dedicated split-posture test. Device verification is reported by the author. It is manual and not counted as a coding requirement.
  • Back action: performSessionRailBack gives a page back claim priority and falls back to session navigation. This matches the control's purpose of returning to the session list.

No unmet coding requirement is established. Uncertainty: the evidence comes from the summary and the tests it describes. Source lines were not re-read in this assessment.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff includes the stacked commits of #36726 (device-wide Duo chat width state, width toggle, storage-key plumbing). The PR description states these commits are included until #36726 merges, and that the final commit (1138341) is the reviewed change. The issue depends on a collapsed state, so these changes support [#37180]. Connections to the issue:

  • duo-chat-width.ts and useDuoChatExpanded supply the collapsed state that makes the control visible.
  • page-storage-keys.ts, use-duo-chat-width-publish.ts, and web-entry/index.tsx share that state with the page and the rail.
  • pressBack and PageBackConsumers.dispatch support the back action that the control triggers.
  • use-chat-bottom-fit.ts, side-safe-area.tsx, and the side-strip helpers reserve the status column and the composer space around the rail.
  • NavBarButton size supports the 44-point control.
  • MobileNativeChatAttachButton extraction is a refactor in the composer. It supports the same composer layout change.
  • Localization strings cover the new control and width toggle labels.
  • Tests cover each added behavior.

No change is shown to be unrelated to [#37180] or its stated dependency. Uncertainty: the stacked #36726 commits are not linked to this issue directly. A reviewer should confirm that they are a prerequisite, not separate scope, when #36726 is not yet merged.

Full details: Description check

Explanation

The description follows the repository template and covers the main required sections. The ELI5, What Changed, and Why sections are clear and tied to the linked issue #37180. The Visual Proof section includes a real device screenshot and a reference to layout mockups, and the Testing section lists focused tests, typecheck, localization verification, and oxlint results. The Risk section is missing entirely: it has no Level (Low, Medium, or High) and no statement of what could break or how to back the change out. The Performance section is also incomplete because it does not finish the sentence in the template, and the Checklist items are not ticked. The Review and Notes sections are left at template defaults. The description also says the diff is stacked on #36726 and asks reviewers to review only the last commit, which is a useful note but not a substitute for the Risk section. Overall the description is mostly complete, but the missing Risk and Performance content are required, so the check should not fully pass.

Resolution

Add a Risk section that names the riskiest part of the change (for example, the measured status-occlusion placement and the keyboard-inset hide logic), gives a Level of Low, Medium, or High, and states how to revert. Complete the Performance section by finishing the sentence (for example, that the placement runs only on layout and the storage subscription is the only new work). Tick or address the checklist items, including the pnpm lint, typecheck, test, and build items. Optionally add the AI Disclosure if an AI tool was used, since the description mentions Claude Code.

  • 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

@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: 2


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: 14784be7-7e35-4e90-ae4e-4343994b45ce
Commits

Reviewing files that changed from the base of the PR and between 70dae97 and 1138341.

Files selected for processing: 37
  • mobile/app/_layout.web.tsx
  • mobile/src/components/nav-bar/NavBarButton.tsx
  • mobile/src/i18n/locales/en.json
  • mobile/src/layout/duo-status-row.test.ts
  • mobile/src/layout/duo-status-row.ts
  • mobile/src/layout/released-side-inset.ts
  • mobile/src/layout/side-safe-area.tsx
  • mobile/src/mobile-web-shell/MobileWebShellScreen.tsx
  • mobile/src/mobile-web-shell/bridge/bridge-back-round-trip.test.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client.ts
  • mobile/src/mobile-web-shell/bridge/page-back-consumers.test.ts
  • mobile/src/mobile-web-shell/bridge/page-back-consumers.ts
  • mobile/src/mobile-web-shell/host-area-in-page-cleanup.test.tsx
  • mobile/src/session/DuoRailBackButton.tsx
  • mobile/src/session/MobileSessionActiveContent.tsx
  • mobile/src/session/MobileSessionCommandDock.tsx
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/src/session/MobileSessionHeader.tsx
  • mobile/src/session/MobileSessionSurface.tsx
  • mobile/src/session/MobileSessionTabStrip.test.tsx
  • mobile/src/session/MobileSessionTitleBlock.test.tsx
  • mobile/src/session/duo-chat-width.ts
  • mobile/src/session/duo-rail-back.test.tsx
  • mobile/src/session/duo-rail-back.ts
  • mobile/src/session/mobile-session-toast-owner-cleanup.test.tsx
  • mobile/src/session/native-chat/MobileNativeChatView.tsx
  • mobile/src/session/native-chat/composer/MobileNativeChatAttachButton.tsx
  • mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx
  • mobile/src/session/native-chat/composer/MobileNativeChatWidthToggle.tsx
  • mobile/src/session/native-chat/composer/mobile-native-chat-composer-menu.ts
  • mobile/src/session/native-chat/composer/mobile-native-chat-composer-styles.ts
  • mobile/src/session/native-chat/composer/use-chat-bottom-fit.ts
  • mobile/src/session/session-side-strip-inset.ts
  • mobile/src/session/use-duo-rail-back.ts
  • mobile/src/session/use-duo-rail-back.web.ts
  • mobile/src/session/use-mobile-session-panel-route-actions.tsx
  • mobile/src/session/use-mobile-session-presentation.ts

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

@gsxdsm
gsxdsm force-pushed the feat/mobile-duo-rail-back-pr branch 2 times, most recently from 4aa3a0d to e66e6db Compare November 2, 2026 05:35

@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.

Follow-up Comments

Outside diff Keep the side inset released when the keyboard covers the status-column strip.

141-141: Minor · Functional Correctness · Quick win

Keep the side inset released when the keyboard covers the status-column strip.

The rail strip is clipped by the keyboard. In a short landscape layout, the keyboard can cover the whole strip. The strip then becomes null, which withdraws the release claim at MobileWebShellScreen.tsx:141. SideSafeArea then pads the side inset during the session, and the session WebView narrows.

The page-side sideRail in mobile/src/mobile-web-shell/page-fold-division.ts:29 uses the same clipped strip. That value also drops releaseSide in mobile/app/_layout.web.tsx, so the page pads its own side inset too.

Use the unoccluded status column for the release decisions only. Expose the unoccluded strip from SideRailProvider, then use it for the claim in MobileWebShellScreen.tsx and for sideRail in page-fold-division.ts. Keep the keyboard-clipped strip for rail controls and the direction pad.

Open the source location


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: dc49ee8c-d456-4a64-bc06-66e6f30d5e94
Commits

Reviewing files that changed from the base of the PR and between 1138341 and 4aa3a0d.

Files selected for processing: 13
  • mobile/src/i18n/locales/en.json
  • mobile/src/mobile-web-shell/MobileWebShellScreen.tsx
  • mobile/src/mobile-web-shell/bridge/bridge-client-shell-session.ts
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.ts
  • mobile/src/mobile-web-shell/bridge/page-async-storage.ts
  • mobile/src/mobile-web-shell/page-storage-keys.ts
  • mobile/src/mobile-web-shell/use-duo-chat-width-publish.ts
  • mobile/src/session/MobileSessionContentRow.tsx
  • mobile/src/session/duo-chat-width-posture.test.tsx
  • mobile/src/session/duo-chat-width.test.ts
  • mobile/src/session/duo-chat-width.ts
  • mobile/src/session/native-chat/composer/mobile-native-chat-composer-styles.ts
  • mobile/web-entry/index.tsx
Files skipped from review as they are similar to previous changes: 2
  • mobile/src/i18n/locales/en.json
  • mobile/src/session/native-chat/composer/mobile-native-chat-composer-styles.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.

@gsxdsm
gsxdsm force-pushed the feat/mobile-duo-rail-back-pr branch from e66e6db to a828945 Compare November 2, 2026 16:09
@gsxdsm

gsxdsm commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Visual proof

Real iOS Simulator screenshots (iPhone 17 Pro Max / iPhone Duo simulator). Personal info is covered with black boxes.

Duo simulator: chat collapsed, back control in the status column

@gsxdsm
gsxdsm force-pushed the feat/mobile-duo-rail-back-pr branch from a828945 to 343a18d Compare November 3, 2026 12:11

@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.

Follow-up Comments

Outside diff Avoid applying the strip inset twice when a panel is docked.

341-341: Minor · Functional Correctness · Quick win

Avoid applying the strip inset twice when a panel is docked.

When a panel is docked, MobileSessionContentRow already pads the whole row by the strip width. The collapsed transcript adds that width again, making the chat unnecessarily narrow. Suppress transcriptInset when the row already reserves the strip. (raw.githubusercontent.com)

Open the source location

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: b5a991c4-4d28-4d5e-9519-097a8129a2d5
Commits

Reviewing files that changed from the base of the PR and between a828945 and 343a18d.

Files selected for processing: 7
  • mobile/src/i18n/locales/en.json
  • mobile/src/mobile-web-shell/bridge/bridge-rpc-client.ts
  • mobile/src/mobile-web-shell/page-storage-keys.ts
  • mobile/src/session/native-chat/MobileNativeChatView.tsx
  • mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx
  • mobile/src/session/native-chat/composer/mobile-native-chat-composer-menu.ts
  • mobile/web-entry/index.tsx
Files skipped from review as they are similar to previous changes: 1
  • mobile/src/i18n/locales/en.json

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

@gsxdsm
gsxdsm force-pushed the feat/mobile-duo-rail-back-pr branch 4 times, most recently from 43a6101 to 4d68674 Compare November 6, 2026 02:38
gsxdsm and others added 2 commits November 5, 2026 22:03
…he bottom edge

Duo chats can run across the status column, with a composer toggle to
switch the width, a header that stays clear of the column, and a
bottom-edge composer fit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@gsxdsm
gsxdsm force-pushed the feat/mobile-duo-rail-back-pr branch from 4d68674 to bf7f409 Compare November 6, 2026 07:56
…l-back-pr

Keep the Duo back control and full-width chat on top of the moved mobile modules.
…t-full-width

Keep full-width Duo chat on top of the moved mobile modules.
gsxdsm and others added 9 commits November 27, 2026 06:07
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Prevents RN Web Pressable focus theft from collapsing the idle pill
composer and unmounting the width toggle before onPress fires.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	mobile/src/components/nav-bar/NavBarButton.tsx
The upstream merge left the shell screen one line over the limit. Both hooks still run for that screen.
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · No new blocking issue was found; the two earlier concerns were explicitly left unchanged by gsxdsm.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No new blocking issue was found; the two earlier concerns were explicitly left unchanged by gsxdsm.

Summary

Adds a 44-point Back button beside collapsed Duo chats. Its position follows the reported status regions, and it hides when the keyboard opens.

  • Duo sessions can use the status column for chat or keep the chat clear of it.
  • Collapsed Duo chats show a Back control in the status column.
  • Terminal panes now carry their keyboard sizing in a separate session component.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile

# Conflicts:
#	mobile/src/session/MobileSessionContentRow.tsx
# Conflicts:
#	mobile/src/session/MobileSessionContentRow.tsx
persistMirrored resolves after the local write, so the revision guard was dropping before the shell echoed the latest choice.
Keep the Duo dock on the bottom edge while taking the phone key dock and the setup update notice.
Keep the Duo rail back control with the phone key dock and the setup update notice.
Keep the Duo session content, and read the renamed session toast.

This branch has not been deployed

No deployments
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.

Mobile: back control in the iPhone Duo status column when chat is collapsed

1 participant