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): back control in the iPhone Duo status column when chat is collapsed - #37185
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.
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.
Testing
Focused rail placement and visibility tests (60/60), including hide-while-keyboard-is-up.
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.
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 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: 3 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Description check
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 checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly identifies the main change: adding a back control to the iPhone Duo status column when chat is collapsed.
Linked Issues check
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
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.
NavBarButtonsize 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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Follow-up Comments
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.
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 reason will be displayed to describe this comment to others. Learn more.
Follow-up Comments
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)
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.
…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]>
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]>
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.
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
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.
Testing
pnpm typecheck && pnpm typecheck:testsinmobile; rootpnpm tc;node config/scripts/verify-mobile-localization.mjs;npx oxlint(0 errors).🤖 Generated with Claude Code