Skip to content

fix(mobile): keep the keyboard open when a tab tap opens its details card - #36866

Merged
brennanb2025 merged 7 commits into
mainfrom
brennanb2025/phone-tab-tap-keeps-keyboard
Nov 2, 2026
Merged

brennanb2025 merged 7 commits into
mainfrom
brennanb2025/phone-tab-tap-keeps-keyboard

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​54 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​27 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20

What broke

On the phone, tapping a session tab opens a details card under it (#36395). When the card opened it moved focus into itself. So if you were typing in a chat composer or a terminal input and tapped another tab, the field lost focus and the soft keyboard closed, on both iOS and Android. You had to tap the field again to keep typing, which also closed the card. With a hardware keyboard, keys went to the card instead of the field. Tapping the session title in the top bar, which opens the same kind of card, closed the keyboard the same way.

The tab strip was already built to keep a focused text field focused through tab taps; the card opening right after undid that, and the session title had no such protection at all.

Tracked in STA-13199.

What changes

  • When the card opens while a text field has focus, it leaves focus where it is. The keyboard stays up, typing keeps going to the field, and the card still shows. Tapping the same tab or the title again, tapping elsewhere, or Escape closes it as before.
  • Tapping the session title while typing now keeps the field focused too, the same way tab taps already did, so its card opens without closing the keyboard.
  • When no text field is focused (a tap with the keyboard down, or a hardware-keyboard or screen-reader user activating a tab or the title), the card still takes focus as before, so those users land on the details.

What this covers: switching between chat tabs, between terminal tabs (including from a shell's live input to an agent terminal's message box and back, where focus already follows the visible field), and tapping the title. Switching from a chat tab to a terminal tab (or to a file or browser tab) still closes the keyboard, as it does today, because the chat's text field goes away when the view changes; the card isn't involved there.

Differences from the common pattern

  • Intended: the common pattern differs between implementations on whether an informational card takes focus when it opens: one never moves focus into a popover on a touch screen, while another focuses the popup on touch and moves focus into its details card. This PR keeps the focus-taking behavior from feat(mobile): tap the session title to see its full name, path and host #30389 when no text field is focused, because the card renders in a layer at the end of the page, away from its opener, and moving focus is what lets a hardware keyboard or screen reader reach it directly. When a text field is focused, it leaves focus alone, matching the touch rule, since typing in progress is what the user is doing.
  • Intended: the title and tab taps keep the field focused by cancelling the tap's default focus move only while a text field is focused, which is how the common pattern keeps a composer focused when a menu or chip next to it is pressed. A tap with nothing focused still focuses the title as before.
  • Intended: with the card open and a field focused, Escape closes the card and is not passed on to the field. One implementation of the common pattern also passes it on to the field; here the terminal's live input would turn that Escape into an ESC sent to the running program, which can interrupt an agent. Another implementation also captures Escape from the composer while its menu is open.

Review path

Full review path (moved from the light path during review: the change was confirmed to touch more than one opener of the card).

Validation

  • Tests: the card scope test asserts that a focused field keeps focus when the card opens and that ordinary keys still reach it; the keyboard-persisting taps test renders the real session title and asserts a tap on it keeps a focused field focused and doesn't interfere when nothing is focused. Both run in CI's Mobile checks.
  • Phone QA in the real Orca Mobile app on an iOS simulator and an Android emulator (mock desktop): chat to chat tab with the keyboard up keeps the keyboard and typing lands in the new chat; same tab again closes the card and keeps the keyboard; keyboard down still opens and closes the card as before; terminal shell input to agent terminal message box and back keeps the keyboard with typing going to the visible field. On main's code the chat-to-chat tap closed the keyboard.
  • Phone QA of the session title on the same rig, iOS and Android: with the chat composer or a terminal's live input focused, tapping the title opens its card and the keyboard stays up, typing keeps going to the field, and a second tap closes the card with the keyboard still up; with the keyboard down the card opens and closes as before. On main's code the title tap closed the keyboard.

@brennanb2025
brennanb2025 marked this pull request as ready for review November 1, 2026 02:31
@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 session title pressable now applies keyboard-persisting tap handling. The web detail-card scope skips initial focus when the active element is a text field. The platform module exports isTextField and checks for DOM availability before installing the tap handler. Tests cover title tap prevention with and without a focused input, focus retention, and non-Escape key propagation.

Merge Risk: Low · up to 1adcc

The title-focus behavior needs a test that opens the card while a field is focused. This coverage gap is bounded and does not by itself block merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the problem, user-visible behavior, implementation intent, testing, and validation. However, it omits several required template sections, including an explicit ELI5 section, a… Add the missing template sections. Include the actual linked issue under Linked Issue, provide before-and-after visual proof or state N/A with a reason, document the risk and rollback method, add the ELI5 summary, and complete the required …
Docstring Coverage Warning Docstring coverage is 50.00% 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: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: keeping the keyboard open when a tab tap opens the details card.
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 explains the problem, user-visible behavior, implementation intent, testing, and validation. However, it omits several required template sections, including an explicit ELI5 section, a Linked Issue entry with an issue link, Visual Proof or an explicit N/A explanation, Risk, and the required checklist.

Resolution

Add the missing template sections. Include the actual linked issue under Linked Issue, provide before-and-after visual proof or state N/A with a reason, document the risk and rollback method, add the ELI5 summary, and complete the required checklist items.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% 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 2 functions across 5 files.

Resolution

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

Finishing Touches
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

…details card

The session title opens the same details card as a tab, but sat outside every
keep-focus container, so its tap moved focus off a focused composer or terminal
input and closed the soft keyboard. Attach the existing keep-focus helper to the
title button so the tap leaves the field focused, as tab taps already do.

@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: d9f60cb1-748f-44a2-bc95-3188db459e18
Commits

Reviewing files that changed from the base of the PR and between 45290b2 and 312818d.

Files selected for processing: 3
  • mobile/src/components/use-detail-card-scope.web.ts
  • mobile/src/platform/keyboard-persisting-taps.test.ts
  • mobile/src/session/MobileSessionTitleBlock.tsx
Files skipped from review as they are similar to previous changes: 1
  • mobile/src/components/use-detail-card-scope.web.ts

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

# Conflicts:
#	mobile/src/session/MobileSessionTitleBlock.tsx
The session title now attaches the keep-focus helper, and the title renders in
renderers without a DOM, where checking against HTMLElement throws. Check that
HTMLElement exists first, as other mobile code already does.
@brennanb2025

brennanb2025 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Review loop status

The problem. On the phone, tapping a session tab while typing in a chat composer or terminal input closed the soft keyboard: the details card the tap opens moved focus into itself. Tapping the session title in the top bar, which opens the same kind of card, closed the keyboard too, because the title's tap itself took focus.

What changes for users. Tapping another chat tab, another terminal tab, the same tab again, or the session title while typing now keeps the keyboard up and typing keeps going to the field, and the card still opens and closes as before. With the keyboard down, nothing changes: the card opens and takes focus as it did.

Fixed during review

  • The session title closed the keyboard the same way (found by phone QA and the design review). It now keeps a focused field focused through its tap, using the same helper the tab bar already uses.
  • That fix first crashed screens rendered without a web page (CI caught it in 11 existing header and title tests); the shared helper now checks for the page first, as other phone code already does. Mobile verify passes.
  • The PR description overstated what's covered and mislabelled the difference from the common pattern; both rewritten.

Checked and not a bug. Switching from a shell's live input to an agent terminal's message box (or back) with the keyboard up: focus already moves to the visible field on main, and QA confirmed it on both phones.

Deferred, with reasons

  • With the card open and a field focused, a hardware Escape closes the card and isn't also delivered to the field. On main the field didn't get it either (focus was in the card), and delivering it would send ESC to a terminal program, which can interrupt an agent. Labelled intended in the description.
  • The new no-page check's comment says native renderers have no DOM; React Native 0.83 does define one, but the native app never renders the session title or tab strip (its session route is the WebView shell), so there's no user effect. Comment nit only.

For Brennan's list (already on main, separate mechanism, not changed here). Switching from a chat tab to a terminal (or file/browser) tab while typing still closes the keyboard, because the chat's text field goes away with the view; it happens without any card too. Keeping it up would mean auto-focusing the terminal's input on tab switch, a product choice (in Keys mode the next keystrokes would go straight to the shell).

Verified

  • Phone QA in the real Orca Mobile app (native shell loading this PR's phone page) on an iOS simulator and an Android emulator against a mock desktop:
    • On 45290b2: chat→chat tab tap keeps the keyboard and typing lands in the new chat; same tab again; keyboard down; shell↔agent terminal switches. Main's code reproduced the bug.
    • On 3af4e08 (after the title fix and the main merge): session title tap with the chat composer or the terminal live input focused keeps the keyboard, typing continues, second tap closes the card; keyboard-down title tap unchanged; chat→chat regression check passes. Main's code closes the keyboard on the title tap.
  • 4b67c09 after QA only adds a check for whether a web page exists (always true on the phone page, so QA'd behavior is unchanged); covered by CI Mobile verify, which passes.
  • Reference comparison of every changed mechanism: no unlabelled differences.
  • Synced with main once more after main's lint fix Restore main static analysis by extracting crew runtime operations #37174 landed: merge 5069ef6 (main at 2e6d660), automatic, touching none of this PR's files. Main's new composer focus code (composer-input/use-input-focus.ts, FieldTextInput.tsx) was checked against both flows by code read: it only tracks focus to draw a ring and never focuses or blurs, and the composer and terminal input are still real text fields, so the QA'd behavior holds.
  • Synced with main again after main's formatting fix chore: format AGENTS.md so main's format check passes #37243 landed: merge 25190b5 (main at 5bbbdeb), automatic, touching none of this PR's files and none of the focus code the QA relied on (main's phone changes in that range are bottom sheets, not the details card).
  • That merge let CI reach its changed-lines React Doctor check on this PR for the first time (earlier runs stopped at main's lint and format breaks). It flagged one line in this PR's new test (keyboard-persisting-taps.test.ts, an inline import() type). 1adcc9c changes it to a type-only import, the form other phone tests use. It's test-only, so phone behavior and test coverage are unchanged, and the review session agreed.
  • CI on 1adcc9c: all checks pass (static analysis and typecheck, Mobile verify, mobile web bundle, CodeRabbit). Commits since the reviewed head 4b67c09: merges 5069ef6 and 25190b5 and test-only 1adcc9c.

Not verified. Screen readers (VoiceOver/TalkBack) activating a tab or the title while a field is focused; by code, focus stays in the field and the card opens without moving focus.

For Brennan's review

Branch Main
Title tap while typing (iOS) branch main
Chat tab tap while typing (iOS) branch main

Android, branch: title tap, chat tab tap.

Spots where judgment matters:

@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

Nitpick Exercise the title activation that opens the card.

82-123: Trivial · Maintainability & Code Quality · Quick win

Exercise the title activation that opens the card.

This test only dispatches mousedown. Its toggle callback is a no-op, so it does not open the details card. A focus regression caused by the actual title activation can therefore pass. Use the real card-opening path, or invoke a callback that performs the same transition, and assert that the field remains focused after the title press.

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: ef37f6d3-8541-4d89-86ed-8bd85f505b07
Commits

Reviewing files that changed from the base of the PR and between 25190b5 and 1adcc9c.

Files selected for processing: 1
  • mobile/src/platform/keyboard-persisting-taps.test.ts
Files skipped from review as they are similar to previous changes: 1
  • mobile/src/platform/keyboard-persisting-taps.test.ts

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

@brennanb2025
brennanb2025 merged commit a1d30fb into main Nov 2, 2026
26 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/phone-tab-tap-keeps-keyboard branch November 2, 2026 03:24
AmoabaKelvin added a commit that referenced this pull request Nov 4, 2026
Reverts 852391d (#36395). The card popped up on every tab switch.
Tapping a tab switches tabs again, and the session title card goes back
to its own owner from #30389. Keeps later changes to these files: tab
press feedback, the compact top bar's + button, and #36866's keyboard
keep-focus for title taps.
AmoabaKelvin added a commit that referenced this pull request Nov 4, 2026
Reverts 852391d (#36395). The card popped up on every tab switch.
Tapping a tab switches tabs again, and the session title card goes back
to its own owner from #30389. Keeps later changes to these files: tab
press feedback, the compact top bar's + button, and #36866's keyboard
keep-focus for title taps.
AmoabaKelvin added a commit that referenced this pull request Nov 4, 2026
…abs (#38206)

* revert(mobile): drop the details card on session tab taps

Reverts 852391d (#36395). The card popped up on every tab switch.
Tapping a tab switches tabs again, and the session title card goes back
to its own owner from #30389. Keeps later changes to these files: tab
press feedback, the compact top bar's + button, and #36866's keyboard
keep-focus for title taps.

* fix(mobile): hide branch and folder when the setting is off

The phone's workspace row always printed the branch or folder path, so the
Branch name / Branch / folder path toggle under Card display did nothing.
The shared card details now carry that rule, and the row reads it.

* fix(mobile): centre the chevron on Home list rows

* fix(mobile): scroll sheets taller than the screen

Content-sized sheets ride the keyboard by translation, but their height cap ignored that lift, so a tall sheet pushed its top off screen with no way to scroll back to it. The cap now gives back the keyboard lift. Sheets that scroll their own list can now shrink to the cap instead of clipping it, and the GitHub Pages picker no longer nests its list inside the drawer's ScrollView.

* feat(mobile): show each desktop's machine kind and model

The desktop now reports whether it is a laptop, desktop or server, and its
model, on status.get. The phone stores it with the other last-known host
fields and turns it into a line like "MacBook Pro · macOS".

* feat(mobile): edit a host from its screen and align the Automations bar

The host screen's menu gains Edit host and Network diagnostics. Edit host moves
onto the standard bar and gains Remove host. Automations uses the standard bar
with its switcher pinned under it, as Source Control does.

* feat(mobile): arrange Home and bring back stats and account usage

Home drops the Jump back in times, names the repo on every Jump back in row
(#37642), shows each desktop's machine kind, and adds stats and account usage
at the bottom. A new Arrange button reorders and hides sections, saved on the
phone.

* fix(mobile): keep the page bundle within budget and show the machine on the host screen

The edit route gets a web stub so its native-only removal flow stays out of
the page's chunks, and Automations keeps its own segment style. The host
screen header shows the machine line like Home does.

* fix(mobile): give the edit route's page stub its own module

A bare re-export of the catch-all route compiled to the same asset as
[...page], so the page manifest listed it twice and the desktop template's
inventory check refused the build.

* feat(mobile): turn Home into Feed, Usage, Automations and Settings tabs

Feed keeps agents (needs-you first, five then Show all), desktops with a
needs-you count, and Tasks; New workspace moves to a floating button.
Usage shows stats and per-desktop account usage, Automations a per-desktop
summary with on/off switches that opens the page for editing (new=1 opens
its editor). Settings becomes a tab. Arrange Home is removed: tabs replace
the long scrolling Home it was for.

* style(mobile): darken the accent blue slightly

* style(mobile): give the Home Tasks row the desktop tile icon

* style(mobile): condense the Home Feed

Smaller tiles, type and gaps; a desktop is two lines with its needs-you
count as an amber pill; the Tasks row drops its duplicate heading.

* style(mobile): drop the Last known prefix on Home desktop rows

* chore(mobile): bump to 0.0.63 and Android versionCode 27

* test(mobile): re-record Linear task recordings for the darker accent blue

* test(mobile): check the page Back stack on Tasks now that Edit host is native

* fix(mobile): pass the Usage tab's limit window to the shared usage helpers

* fix(mobile): type the Usage tab test to the account-slot limits and keep the tab under 400 lines
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