Repository navigation
feat(mobile): improve mobile terminal input - #37900
Conversation
Walkthrough
Pre-merge checks:
|
| // A web <button> clicks on Enter keydown as well, which would send a held key twice. | ||
| accessibilityRole={key.repeatable ? undefined : 'button'} |
There was a problem hiding this comment.
Limit the accessibilityRole omission to web.
The code sets accessibilityRole to undefined for every repeatable key on all platforms. The comment says the cause is a web <button> that clicks on Enter keydown. That behavior exists only on React Native Web.
On iOS and Android, VoiceOver and TalkBack no longer announce Backspace, Delete, and the arrow keys as buttons. These keys are used often. Keep 'button' on native platforms and omit it only on web.
♿ Proposed fix
-
-import { View, Text, ScrollView, Pressable } from 'react-native' +import { View, Text, ScrollView, Pressable, Platform } from 'react-native' ... - accessibilityRole={key.repeatable ? undefined : 'button'} + accessibilityRole={key.repeatable && Platform.OS === 'web' ? undefined : 'button'}
1543ca2 to
2137472
Compare
Every terminal tab, shell or agent, gets the dock from before #36166: the scrolling key row (desktop width, Paste, the built-in keys, custom keys, add) above one live field that types straight into the terminal, with the attach and mic buttons beside it. The field keeps today's 3:1 outline and focus ring, and the keys use today's chips and press styles. The Keys/Message toggle, the Message composer, the arrow pad, the ⋯ sheet on the row and the per-terminal mode preference go. A stored mode from an older build is never read. Sticky ctrl/alt/shift and the More keys sheet stay only behind the iPhone Duo rail, which shipped shells still draw; the page reports no composer, so shipped shells grey their input-mode key and newer shells hide it.
With one live input there is no way to write a terminal line first and send it, so the per-terminal drafts and their storage, the Send path, command-field dictation, draft restoration and the terminal setting for autocomplete and autocorrect (which only applied to that line) go. Dictation in a terminal always types into it live. Drafts and the setting saved by older builds are never read.
2137472 to
9cbd4e3
Compare
Chat drafts and their skill picks lived only in the page document's memory, so killing the app or an OTA reload lost them. Each workspace's tab drafts are now saved in the page storage slot shells since 0.0.59 already allow (left unused by #37900). A clear saves at once so a sent draft never returns, and tabs the host stops listing or the phone closes are dropped from storage. A restored draft that leads with a skill loads the skill catalog so its chip shows again.
Chat drafts and their skill picks lived only in the page document's memory, so killing the app or an OTA reload lost them. Each workspace's tab drafts are now saved in the page storage slot shells since 0.0.59 already allow (left unused by #37900). A clear saves at once so a sent draft never returns, and tabs the host stops listing or the phone closes are dropped from storage. A restored draft that leads with a skill loads the skill catalog so its chip shows again.
…estart (#38268) * feat(mobile): keep unsent chat drafts across an app reload Chat drafts and their skill picks lived only in the page document's memory, so killing the app or an OTA reload lost them. Each workspace's tab drafts are now saved in the page storage slot shells since 0.0.59 already allow (left unused by #37900). A clear saves at once so a sent draft never returns, and tabs the host stops listing or the phone closes are dropped from storage. A restored draft that leads with a skill loads the skill catalog so its chip shows again. * fix(mobile): let a pre-load send win and keep skill scan retries A send or clear made before a workspace's saved drafts finished loading no longer gets overwritten by the saved text. A page whose shell refuses the key stops re-reading it, a dropped write is retried on the next save, and a failed skill scan is still retried the next time the menu opens. * fix(mobile): save pending chat typing when the app goes to the background A write that fails partway no longer leaves a remembered value that makes the next clear look already saved, and typing still inside the 250 ms window saves when the page is hidden. * refactor(mobile): simplify chat draft persistence Read the saved value back once per write through persistMirroredReadBack, build the key with the allowlist's own workspaceScopedKey, keep tab-scope parsing in one place, track the load as one state, stop holding retirements once the load lands, and skip the per-draft size loop when the whole value fits. Drops the test-only settle export.
|
I really hate this change |
Every terminal tab gets the Keys/Message key at the start of the key row again, and the iPhone Duo rail shows its input-mode key enabled. Keys is the default and keeps the live field from stablyai#37900. Message mode shows a multi-line composer whose Send writes the text plus Enter to the terminal; dictation fills it, and attach and mic stay in both modes. Each terminal's mode is remembered per workspace under the allowlisted orca:terminalLiveInputDisabled: key. Drafts are kept per terminal in memory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ELI5
The phone's terminal used to have two ways to type: "Keys", where each letter goes straight to the terminal, and "Message", a chat box where you write a line and press Send. You had to switch between them. Now there is one input again, like before #36166: the row of keys on top and one field below it, and whatever you type goes straight to the terminal. It looks like today's app, not the old one.
What Changed
Before: every terminal tab had a Keys/Message switch. Agent tabs opened in Message (a chat composer with Send/Stop), shells in Keys. The key row under the field had sticky ctrl/alt/shift, an arrow pad and a ⋯ sheet holding Paste, attachments, Desktop width and the rest of the keys.
After: every terminal tab, shell or agent, gets the dock from before #36166, restyled:
inputBorderoutline and 2 pt focus ring from feat(mobile): outline every text field at 3:1 with a focus ring, and drop the composer shadow #37221, and the key chips, radii, spacing and press styles from feat(mobile): polish press feedback, sheet motion, states, spacing and layout jumps #36713.Mechanism:
MobileSessionCommandDock/MobileSessionAccessoryKeysgo back to the old layout on today'sterminalDockStylestokens.TextFieldgains alabelprop for the caption. The arrow pad, the row's ⋯ and mode key, and the Message composer are gone.use-terminal-live-input-mode-preference, its opt-out storage and the default/prune/clear plumbing) is deleted, so every terminal is live. The live-input commit, flush and accessory hooks drop their per-handle membership checks; the active-handle and tab-type guards still apply.handleSend, command-field dictation, draft restoration, and the Terminal settings "Autocomplete & autocorrect" switch, which only applied to that line. Dictation in a terminal always types into it live.toggleInputModeand reportsliveInputEnabled: true, canCompose: false, so shipped shells grey that key. The shell change in this PR hides the key whencanComposeis false; that part only reaches users with the next app release. No bridge field changes shape. Held modifiers only change typed letters while the rail is on screen. When there is no rail (the unfolded Duo held horizontally), the row adds the arrow keys that the Duo layout leaves to the rail's D-pad (getVisibleTerminalAccessoryKeys(..., true)from feat(mobile): iPhone Duo key rail with D-pad, split terminal panes and half-fold layout #35177).Why
Kelvin's call: "terminal is terminal". Two inputs to switch between was the wrong model for a terminal, so this restores the single live input the old dock had (approved mock A) instead of keeping Message mode behind a toggle. With no way to reach the buffered line, its code and setting go too rather than staying dead on main. For the Duo, keeping the rail's modifiers and ⋯ sheet lets shipped shells keep working without a wire change. A rail-only page row was ruled out because it would cost the Duo a row of height and duplicate keys.
Linked Issue
No issue. This is a design change from Kelvin (mock A, "old terminal input, restyled"), reversing the dock part of #36166.
Visual Proof
Real app, iPhone simulator. Before is main (Keys/Message dock), after is this branch. Typing shots have the soft keyboard up and the letters already in the terminal.
Page captures (shell tab and agent tab). Agent tabs used to open in Message; now they get the same live input.
iPhone Duo (this branch). On the cover the keys are on the side rail and the page dock is just the live field. The rail's keyboard key focuses it, and the rail's ⋯ still opens More keys. Unfolded and held horizontally there is no rail, so the row shows, with the arrows at its end.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Real app on the iOS 27 simulator (OTA dev client, Metro from this branch) paired to a headless serve built from this branch, then the same app against main's page bundle for the before shots. Typed with the soft keyboard: letters reach the zsh prompt live, dark and light.
iPhone Duo simulator (iOS 27.2): cover screen, unfolded, unfolded horizontal. Checked the rail keyboard key, the rail ⋯ sheet, the no-rail row with arrows, and that this shell hides the input-mode key.
Page bundle builds and passes
verify-mobile-web-app-bundlewithin the asset sweep (12,515,308 B, smaller than main).Focused tests:
mobile/src/session,terminal,components,mobile-web-shell,storageand the RPC recordings (672 files), plus the held-press, session and live-input render suites in a real browser. Mobile typecheck,pnpm check:changedand the React doctor changed-lines gate pass.verify:mobile-localizationandverify:mobile-localization-coveragepass aftersync:mobile-localization.RPC goldens re-recorded deterministically (
rpc:record --prune). The only changes are the removed live-input and draft effects and the two deleted buffered-Send scenarios. The bridged-parity identical count is re-pinned 387 → 385 for those two.Tests: tests that only pinned the two modes or the buffered line are deleted. The pre-feat(mobile): match every text input to the chat composer and rebuild the terminal dock #36166 held-key render tests are restored for the old row; they caught a double send on keyboard Enter (a web
<button>clicks on keydown), now fixed by leaving repeatable keys withoutrole=button, as the old row did. One assertion pins thatcanCompose: falsedrops the rail's input-mode key.Not tested: Android, and a real iPhone Duo device.
Risk
Riskiest part: removing the per-terminal live-input membership from the live-input commit and flush hooks. If a guard there was load-bearing, typed text could reach the wrong terminal after a tab switch. The active-handle and tab-type guards cover it, and the split-pane, tab-switch and click-ordering tests pass. Older paired phones: shipped shells grey their input-mode key on the Duo rail (pressing it does nothing) until the next app release. The Terminal settings autocomplete row is a native route, so shipped shells still show it until a release, but it does nothing any more. Unsent buffered drafts from older builds are not shown. Back out with a plain revert of the two commits; the stored values left behind are just read again.
Level: Medium
AI Disclosure
Review
Review findings rejected, with reasons:
Agent skill upstream boundary
Notes
mobile-web-shell/terminal-key-rail.tsx) and removing the Terminal settings autocomplete row (mobile/app/terminal-settings.tsx).canCompose: true.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)