Skip to content

feat(mobile): integrate hardware keyboard input, chat submission and navigation - #18901

Draft
nwparker wants to merge 33 commits into
mainfrom
nwparker/keyboard-issues
Draft

nwparker wants to merge 33 commits into
mainfrom
nwparker/keyboard-issues

Conversation

@nwparker

@nwparker nwparker commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Mobile hardware keyboards currently lose terminal modifiers and navigation keys, cannot submit Native Chat correctly, and require touch to change workspaces or tabs. This integrates the existing native terminal capture and navigation implementations with the current mobile session structure, preserves iPad input focus, and adds native hardware Return submission while keeping software multiline input.

Reuses work from #10148, #12772 and #18195. Related issues: #9702 A–C, #12706, #14744, #18041 and the broader editing scope in #9000. This does not claim to close those issues yet. Browser creation (#9702 D), typing latency (#12071 / #15708), and DeX Escape behavior require further category work.

Review fixes included: focused-route command ownership; pending-navigation cancellation on blur; keyboard connection notifications and software-keyboard recovery; native IME pass-through; ordered terminal flush before controls; Android consumed key-up/repeat behavior; iOS Ctrl+Shift letter and punctuation coverage; hardware input focus after accepted sends.

Validation so far:

  • All hosted workflows passed on 30d8ce8d8da: PR Checks run 34014925963 (including all eight Node test shards, static analysis, typecheck, cross-version compatibility, Linux and Windows packaging, Git compatibility and shell contracts), Mobile Checks 34014925852, Computer-use e2e 34014925861, and PR test LoC 34014925859. Draft-gated real IME and general e2e jobs were skipped, not exercised. This supersedes pending-CI statements in earlier checkpoints; physical Bluetooth/iPad, DeX and real remote-host stress remain unproved.
  • Hosted verification on 30d8ce8d8da: Mobile Checks and cross-version wire compatibility passed. Remaining PR jobs are still pending verification. Independent review of the paired-remount fixture cleared its identity wiring and unchanged rejection→remount assertions; all three tests reran successfully.
  • CI follow-up fixes: 94e55714e5f prepares the existing Node native runtime for mobile's real-PTY tests; 679582dcf53 publishes keyboard handlers/navigation refs only after React commit and stabilizes the dynamic native-presence callback; 30d8ce8d8da supplies the existing arrival-target implementation to the paired-remount test fixture. Suspended-render regressions fail before and pass after. Independent lifecycle review: 14 tests passed; independent AST audit confirms exactly one callback insertion before updating parity digests. Full mobile: 542 files / 4,375 passed / 3 skipped; typecheck/lint/format pass. React Doctor: zero blocking errors, 28 warnings remain. Remount + arrival suites: 11 passed. Prior hosted Linux/Windows packaging, cross-version, Git compatibility and seven test shards passed; replacement hosted verification is pending.
  • Integrated main a63a4579cf5 in merge 54e6bd921f7, retaining both conflict-side tests and reliability gates. Independent overlap review found no transport merge regressions; 83 focused tests passed. Post-commit pinned-v1.4.197 encrypted mobile input/recovery and structured-session compatibility suites: 20 passed. These are loopback/real-local-PTY checks, not physical keyboard or public-relay proof.
  • Post-merge full mobile suite: 541 files passed; 4,373 tests passed and 3 skipped. Full host RPC suite: 222 files passed; 1,923 tests passed and 1 skipped. Latest focused writer/queue/PTY suite: 25 passed. Mobile typecheck and 105-gate manifest validation pass.
  • Mobile typecheck, changed-file lint, formatting and commit hooks passed.
  • Focus fix independently reviewed with 51 focused tests; navigation lifecycle changes with 22 focused tests; terminal input pipeline with 56 focused tests. Source-extraction parity was updated only after independent AST comparison.
  • iOS Debug device build including Ctrl variants and the subsequent responder-ownership fix passed. The separate test app targets a physical iPad 8th generation, iPadOS 26.3.
  • Android Debug build passed. The initial generated Gradle 9 failure in foojay was fixed by the tracked resolver patch; a fresh Expo-generated Gradle 9 ARM64 debug APK subsequently built successfully (see evidence table). Earlier device runs used Gradle 8.14.3. No generated platform project is committed; the fresh APK has not been installed on a device.
  • Independent follow-up review found Android software-IME Return misclassification and held navigation keys leaking to terminal input. Both fixed; five Robolectric tests pass against real Android KeyEvent objects and registry dispatch. These do not prove Bluetooth delivery or full native view dispatch.
  • iOS terminal capture now yields to exact currently registered app shortcuts in the same window. Five binding/registry tests and mobile typecheck pass; native responder dispatch remains a device gap.
  • Existing iPad Korean-IME recorded-device-trace regression: eight tests pass. This is replay of historical physical evidence, not a new attached-device IME run.
  • Native Android runtime validation found the capture wrapper inheriting LinearLayout child placement: the hidden input became zero-width beyond its siblings, while JavaScript incorrectly reported focus. The wrapper now preserves Yoga child bounds; two native layout tests cover resize and an inherited-layout negative control. Four capture-package Robolectric tests and the final Android build pass.
  • Extended physical-event filtering to terminal capture: software/virtual IME keys remain on RN's own path, avoiding duplicate Backspace callbacks. Temporary diagnostics were removed. Android shell/InputManager injection rewrites even requested keyboard device 0 to virtual device -1, so these injections cannot prove the physical path. Before this filtering, the layout-fixed emulator delivered plain text, arrows, Escape, Tab and Delete to the isolated mock; that is limited event-path evidence, not Bluetooth proof or final-key-matrix coverage.

Native Android final-build proof: authenticated localhost emulator gRPC sends real kernel events through the nonvirtual qwerty2 InputDevice (not adb input or JavaScript key callbacks). A repeatable exact-byte harness checks native EditText focus before/after each case and observes the isolated mock host. All 12 cases pass exactly once: four arrows, Tab, forward Delete, Backspace, Home, End, Shift+Tab, Ctrl+C and Ctrl+D. This proves native app-to-mock delivery, not real PTY execution, Bluetooth, or DeX. AOSP's qwerty2 layout maps Linux Escape to Android Back and PC Home to Android Home; emulator Escape route changes are not evidence of an Orca Escape defect. W3C Home/End use its MOVE_HOME/MOVE_END mappings successfully.

Additional native Android evidence: held Backspace produces repeated DEL bytes and stops after release. Rapid abc + hardware Return exposed a real Chat race: the mock received only a while the field still showed abc. Commit a5471cf02e9 reads the latest native change-event text; rapid xyz + Return now submits exactly xyz and clears the focused field. a, Shift+Return, b, Return submits exactly a\nb. The regression fails with the stale React prop read and passes with the native-text ref; autocomplete followed immediately by Return is also covered. Composer styles were extracted unchanged to preserve the file-size limit.

Native Chat primary-modifier submission (#14744): capable native builds now use Cmd+Enter on iPad and Ctrl+Enter on Android; plain Enter remains a native multiline edit. iPadOS's hold-Command menu names the action “Send message.” The existing send path, disabled/empty guards, focus handling and composition pass-through are reused. The prop is capability-gated and default-false, so older installed native builds retain their previous Enter/Shift+Enter convention until updated.

Native Android nonvirtual-keyboard proof: alpha, Enter, beta leaves exactly alpha\nbeta in the composer with no send request. Ctrl+Enter sends that text once through the existing Ctrl+U preparation/send flow, clears the draft and retains focus. Ctrl+Enter on empty input sends nothing; rapid gamma, Ctrl+Enter sends gamma once. This is app-to-mock acceptance, not real agent execution or Bluetooth proof. All 20 Android capture tests pass, including five new real-KeyEvent dispatch tests; 30 independently rerun JS tests pass. Independent review found no concrete regression blocker. Both native builds pass; the iPad test app is installed and reports the new capability, but keyboard detection remains false. The physical Cmd+Enter/IME acceptance criteria remain open.

Still draft: IME candidate navigation, clipboard/editing, attach/detach and modal/route transitions require further evidence. iOS UIKeyCommand does not expose repeat state for Chat Return; do not infer held-key suppression after fast rejection from the JavaScript repeat test. No screenshot or successful build is presented as proof of physical key delivery.

Latency PR #15708 was independently reviewed and is not imported unchanged: concurrent 20,000-byte text followed by Z interleaved at byte 16,384 in the host writer. Commit fc0944ce1db fixes that prerequisite using the existing bounded cancellable queue, keyed by PTY generation, with synchronous stale/cancellation guards and original lease admission preserved. Re-review found and fixed a microtask stale-write race, canceled-entry capacity retention, and consumed-slot payload retention. Writer/queue tests cover paste ordering, independent terminals, lease/generation replacement, cancellation saturation, retained-text limits and both queue lanes. The later integration below adds pre-validation arrival ordering, negotiated receipts and explicit recovery; socket enqueue is never treated as host acceptance. Dependent controls still await accepted prefix receipts; old-host typing stays serialized.

Reliability contract: terminal-input.mobile-hardware-routing and terminal-input.generation-ordered-writes — captured keys reach the current terminal in order without crossing route/handle boundaries or consuming native IME edits. Behavioral mapping, writer ordering/cancellation and focus-lifecycle tests plus the native Android mock-byte matrix are the current oracles; physical-device/full-provider delivery remains an explicit incomplete gate. No new wire opcode is introduced. Local, daemon, SSH/WSL and folder/worktree execution retain the existing host-owned send path, now serialized at its writer. Provider callbacks remain unchanged; real daemon/SSH/WSL/Windows stress is an explicit gap, not inferred from unit coverage. Pending writes are capped at 1,023 per PTY generation, 2,048 globally, and approximately 32MiB retained text. No polling or subprocess-per-key work is added. Native command tables are bounded and keyboard attachment uses notifications. Final native/runtime evidence and performance review remain required before readiness.

Latest latency integration (a0ef01f11e6, c8a98363a3a): host input is ordered before asynchronous dispatch/validation, pinned to the subscribed PTY identity/generation, and accepted only after complete host writes. Optional ordered-input capability negotiation reuses opcode 7; old peers retain their previous wire behavior. Mobile direct/relay/logical clients pipeline only negotiated input, await receipts for dependent Enter, fence JSON suffixes after uncertain writes, and never replay. Failed mirrors clear native/JS text; recovery requires an explicit action and a fresh compatible subscription. Legacy JSON failures also show a warning and require explicit resubscription. Recovery is fenced against route A→B→A, newer interaction, and late pre-recovery failure callbacks.

Real-clock encrypted test: four input events at 50ms cadence; with 300/400/500ms host-receipt delay, all 18,029 prefix bytes reached real PTY stdin before the first receipt in the pipelined runs, versus only seven bytes in serialized controls. Both paths delivered exactly 18,030 bytes after Enter, including Unicode paste, BOM, NUL, Tab, arrow and DEL. Latest receipt completion totals: pipeline 792/983/1180ms versus serial 923/1218/1517ms. This is production stream/E2EE/host receipt/writer code over loopback sockets with stubbed runtime metadata and a real local macOS PTY—not full network RTT, public relay authentication, or native-app proof. Cross-version terminal-wire suite: ten tests pass; that suite does not cover mobile/E2EE/relay skew.

Failure-history review finding fixed: detailed detached failures and explicit recovery permits are capped at 256. Overflow becomes a conservative client-wide unknown-input fence, never a missing failure record that could reopen JSON fallback. Recovery requires a fresh compatible subscription and an explicit action; permits are bounded and generation-scoped. Tradeoff: after extreme failure churn, unfamiliar terminals, old-host terminals and evicted permits are also fenced until compatible recovery. Active subscription records remain subscription-owned, not included in the historical cap. Five 2,048-cycle/recovery tests check bounded records, zero retained pending bytes/timers, earliest-identity JSON/binary fencing, stale candidates, permit eviction and late completions. Independent review passed 59 focused tests without blocking findings; the full transport run passed 719 tests, three skipped. No wire change; the overflow adapter is local-only. The reliability manifest includes the new history oracles. Native overflow interaction remains unproved.

Native latency ordering finding fixed (62ecf93f41d): at 150ms each direction, Backspace previously overtook Return/Tab/Up. Three deterministic regressions now pass: control order, typing after Return without phantom deletes, and suffix suppression after failed Return. Controls enter the existing bounded queue synchronously as non-coalescing receipt barriers; mirror/native field state ends at admission, never at a late receipt. Paste, dictation and image callbacks use the same queue. Local admission failures show the existing recovery warning. Deferred attachment lease waits are cancelled on retained-route blur without poisoning resumed input; already-dispatched input keeps its actual result. Independent review passed 94 initial focused tests and a final 71 mobile / 13 host receipt tests without blocking findings. Changed-code quality across 153 branch files, targeted formatting, mobile typecheck and commit hooks pass.

Native Android→production E2EEChannel/dispatcher/receipts/writer→real raw-stdin PTY now passes exact 19-byte order at 300/400/500ms simulated application-frame RTT, with 17 binary frames, 17 receipt sends and zero JSON fallback. First-input→final receipt-send totals were 2377/3189/3443ms; these are not native receipt-consumption or shell-execution measurements. first, Return, immediately x also passes at 500ms, exactly seven bytes and no phantom deletes (1692ms). Runtime/workspace metadata is stubbed; this is not public relay, Bluetooth or DeX proof. One initial 400ms attempt was one byte short and manually stopped; the diagnostic rerun passed, but the initial shortfall remains unexplained, so no native soak/reliability claim is made. Initial harness churn separately came from iPad and Android sharing one mock device token; keeping iPad at home removes that fixture collision.

Remaining latency limitation: receipt barriers preserve the conservative rule that uncertain controls cannot dispatch a suffix. Consequently 64 held controls with 500ms receipts take 32 seconds; the 65th simultaneous admission fails closed. Tests prove this bound, not satisfactory fast-repeat responsiveness. Negotiated-only control pipelining needs a deliberate client-unknown outcome contract before adoption. The PR remains draft.

Rapid native input finding: three back-to-back 19-byte sequences at 400ms simulated RTT produced only 56 bytes: the third Tab was absent even though kernel logging captured all three presses. A second run missed two Tabs; its bounded JS callback trace also lacked them. Temporary native diagnostics then observed a missing Tab at pre-IME but not normal window/capture dispatch, with focus retained and no composing span. Rapid runs additionally exposed text-boundary corruption (antive-proof or a duplicated prefix). An unsuccessful Enter-release experiment was removed. The replacement and new exact-byte evidence follow; these are focused regressions, not a native soak claim.

Follow-up isolation: control-interleaved input also failed with 30ms pacing between injected key events, while uninterrupted text passed. Replacing raw clear with RN clear() or making the field uncontrolled failed; both experiments were removed. The replacement uses opt-in Android pre-IME capture, an atomic native field snapshot/reset, and a noncoalescing event on the TextInput's own change stream. Native capability detection preserves older installed builds and iOS behavior. JavaScript acknowledges the reset, ignores stale events and never clears newer native typing at a late receipt. No prefix-stripping heuristic or transport change is used.

Native field-boundary validation: the final build passes three mixed sequences at 30ms key-request pacing and 400ms simulated application-frame RTT: exactly 57 bytes, 29 frames/receipts, zero JSON fallback. first, Enter, x while JavaScript was stalled for six seconds passes exactly 7 bytes with 7 frames/receipts. Ctrl+1, Alt+Enter, Ctrl/Alt+Backspace and Ctrl+Delete interleaved with text pass exactly 23 bytes with 15 frames/receipts at the same RTT. This is native nonvirtual keyboard→production encrypted transport/dispatcher/writer→real local raw-stdin PTY with stubbed runtime metadata, not Bluetooth/DeX/public-relay/soak proof.

Peer review caught and fixed cross-target coalescing, modified-delete delegation, unmapped-control baseline retention, Alt+Enter mapping, an empty-payload mock mismatch, premature release ownership on fallback, and release ownership crossing keyboard devices. Final independent native ownership review found no remaining concrete blocker. All 15 capture-package Robolectric tests pass, including 10 new real-ReactEditText tests for reset, stale controlled writes, composition/deletion delegation, navigation, repeats and release ownership. The fixture records events rather than serializing through Fabric; actual deletion and newer-edit count advancement are not inferred from its delegation/direct-append tests. Full mobile regression: 4,268 passed / 3 skipped across 529 files; mobile typecheck, changed-code quality across 154 branch files, formatting, Android build and 104-gate manifest validation pass.

Native negotiated recovery now exercised: on the published app at 300ms simulated application-frame RTT, native s followed by Return received a production pre-write rejected receipt; the PTY remained empty and Return was suppressed. The warning focused Reconnect input. Hardware Enter recovered through a fresh compatible stream, with no terminal bytes; fresh u and Return delivered exactly 75 0d, zero JSON fallback. A second run injected an error after the real writer delivered s: the host sent unknown, the UI accurately warned that input may have arrived, and queued Return was suppressed. Explicit keyboard recovery plus fresh u, Return yielded exactly 73 75 0d—the original s appeared once, never replayed. Runtime metadata/provider fault injection is fixture-owned; receipt dispatch, native UI, encrypted transport and raw PTY are real. This does not prove relay-service or physical Bluetooth recovery.

PR / category Exercised evidence Review Remaining proof
This PR, main integration 54e6bd921f7 Post-merge: 4,373 mobile tests passed / 3 skipped; 1,923 host RPC tests passed / 1 skipped; 20 pinned-v1.4.197 compatibility tests passed. Mobile typecheck, full lint/format, 105-gate manifest pass Independent two-parent transport review found no merge regression and passed 83 focused tests; retained both conflict-side regressions and reliability gates Hosted CI pending at publication; physical keyboard, DeX, public relay and real-host/platform stress remain separate
Android AltGr ownership; test-only ea79923f2eb Real capture view/ReactEditText with a synthetic alternate character map: synthesized Ctrl+Alt and shifted variants preserve field/events/release ownership; ordinary Ctrl+Q still captures. Disabling only the existing alternate-character safeguard fails the regression; restoration passes all 47 native capture tests. 36 JS mapping/accessory tests pass Independent test review cleared scope and fixture reuse; no production behavior change Pre-IME delegation only, not actual accented/AltGr insertion, physical layout or PTY delivery. Shift variants exercised, but losing Shift specifically during map comparison is not a separate oracle
Merged #15218, iPadOS IME platform detection Merge 598ba5d2765 is an ancestor; current pane gate retains Mac-only forwarder exclusion for iOS. Four current suites / 73 tests pass: platform detection, forwarder, Hangul coexistence and composition ownership Independent scoped current-code review checked installation, platform extraction and cleanup; no proven pane-gate defect Synthetic coverage, not fresh physical iPad capture. Preview-terminal bridge is a separate unverified consumer; not a whole-PR/hardware readiness claim
Merged #11865, focus after mouse-aware TUI touch Merge c2e3d13efe8 is an ancestor; current 6 focus/tap/pointer/scroll suites / 49 tests pass. Mouse-aware touch keeps PTY mouse bytes then requests deferred focus; external mouse semantics retained Scoped source review checked current client/handle/connection and retained-route cancellation; hook now also includes this PR's hardware-presence reopening policy Original author reports emulator keyboard-to-mock evidence, not newly repeated here. Actual Kimi, physical iPad/Bluetooth and visible software-keyboard lifecycle remain separate
Closed-unmerged IME attempts #13346 / #10162 / #11450 Inventory/body and actual GitHub merge-state inspection only. #13346 records iPad Hangul traces; #10162 lacks physical Japanese validation; #11450 targets touch kana and explicitly excludes romaji Historical references, not newly reviewed or exercised as whole PRs Do not count as shipped fixes. Closed #7427 does not prove physical Japanese IME correctness
DeX #18841 / #8592; adjacent #17730 Fresh issue-body inspection: #18841 reports v0.0.47 DeX rendering; #17730 explicitly requests a tap-to-software-keyboard opt-out, not a regression Inventory classification only No new DeX rendering or tap-opt-out implementation/proof. Keep these separate from keyboard focus and shortcut fixes
Reproducible Gradle 9 Android build; 7fe19f20ee9 Resolver initialization fails with foojay 0.5.0 and passes with 1.0.0. Tracked dependency patch survives fresh frozen install. Fresh Expo-generated Gradle 9 ARM64 debug APK builds on macOS in 4m23s: all 627 tasks executed. APK package/native libraries checked; staged patch/lock and keyboard navigation sources match working-tree inputs Independent patch/supply-chain/platform review cleared change and reran all 259 RN plugin tests across 27 suites. Java 17 minimum matches release CI. Formatting/diff checks pass Debug ARM64 build only; shared dependency/download caches permitted, fresh native output tree. Not signed release/all ABI/Windows/Linux build or device installation. APK SHA256 166d7810abdf02bc32be4512fc9ad1d957e69156f4e078f35c397e36a5b0e98b
Android IME composition fallback; be997c070e7 Actual Activity handler captured composing Ctrl+Tab in red regression. Both Window and Activity now reuse the same composition guard. Five Robolectric tests pass, including full callback fallback, post-composition capture and owned repeat/release cleanup; nine JS integration tests pass Independent native review cleared fix and extended callback coverage; native compilation/tests and diff check pass Native handler proof, not physical IME delivery. No app installation/device changes; full mobile suite last ran on preceding preference commit
Shortcut preference hydration; 114cdf940a7 Delayed initial storage read reproduced overwriting a successfully saved policy. Regression fails before guard and passes afterward; full mobile run from mobile directory: 4,328 passed / 3 skipped, 536 files. Mobile typecheck, formatting, lint and hooks pass Independent review cleared fix and reran 7 preference/registry/binding tests Storage-order regression, not rendered settings/device proof. Root-directory full invocation separately failed in unchanged mock-server child import; normal mobile-directory full run passes
Earlier integrated readiness audit checkpoint Parent reliability gates: 25 host and 74 mobile tests. Independent transport audit: 98 focused tests including real PTY; native/build compatibility: 32 tests. Android Gradle validation succeeded; capture unit task was cached in that run Scoped transport/native/security/resource reviews found no remaining proven candidate; subsequent settings hydration and native composition findings fixed above. No whole-category readiness verdict That checkpoint's clean-build gap was subsequently resolved by the Gradle 9 build above. Physical IME/device, public relay/Iroh and SSH/WSL/Windows stress gaps remain
Android first-tap IME recovery; 5c1ae4035d3 On task emulator with hardware keyboard detected, first tap on buffered input previously left Android mInputShown=false; second tap opened IME. Trace showed native touch reclaimed focus before deferred RN focus, making it a no-op. Conditional Android re-blur now yields first-tap hidden→shown with native field focus retained. Red/green regression plus iOS non-regression; full mobile 4,327 passed / 3 skipped; typecheck/quality/hooks pass Independent review cleared fix and reran 21 focused tests; reviewer checked recorded trace, did not independently operate emulator Native emulator touch/IME proof, not Bluetooth detach, physical iPad, DeX, or repeated-toggle soak. Android-only correction reuses existing deferred focus path
Touch-to-software-input race; e0e5add59d0 Pending hardware-focus frame or 120ms verification could re-disable software input after touch requested it. Both timing regressions fail before the fix and pass after touch cancels both phases. Disconnect/foreground/route-blur cleanup tests added; full mobile suite 4,325 passed / 3 skipped across 536 files; typecheck/quality/hooks pass Independent reviewer identified the race and cleared the fix; 19 independently rerun focused tests pass, parent broader run 78 pass. Existing hook/cancellation reused per react-useeffect guidance Hook-level callback/native-prop proof, not rendered physical IME or Bluetooth detach/reconnect acceptance; no style/native/wire changes
Merged #14219; adjacent to #13845 picker lag Current repeat controller is identical to merge 4f14d6d757c; 64 focused repeat/accessory/raw-send/input tests pass, covering release, stale targets/connections and distinct taps Scoped source review of controller scheduling/cleanup; no concrete blocker found, not full original-PR review Touch-accessory repeat backlog only. PR explicitly does not fix ordinary single-tap lag; closed #13845 is not proof of responsive physical-key repeats. No new native timing run
This PR; ports #12772 / #18195 / #10148 Latest 4,373 mobile tests passed / 3 skipped; 47 Android capture tests passed before main integration; native builds, 12 native-to-mock keys/chords, held Backspace; source-built APK native-to-real-PTY regression below Independent focus/navigation/capture/Chat, ordering/blur, native-boundary/ownership, undo, arrow lifecycle and paste reviews; findings fixed Physical iPad, modals/IME, Chat held Return
#14744 / #14782; replacement in this PR Android plain Enter newline, Ctrl+Enter exact multiline send, empty-input suppression, rapid follow-up and retained focus; iOS build/install/capability verified Independent primary-modifier review; 30 JS tests rerun, no concrete blocker Physical iPad Cmd+Enter, Korean/IME, held-key behavior; issue not claimed closed
Native Chat editing; Android analogue of #9000 (iPad) Native clipboard/cursor edit and exact send; source-built Android first Ctrl+Z/redo and Unicode insertion undo pass; empty/end boundary arrows and one-second held Right retain focus Independent RN undo and submit-arrow lifecycle reviews; 40 native tests cover routing, undo, spans, stock Android behavior and focus-transfer release ownership Physical iPad Cmd editing, actual IME, exact native repeat count and on-device same-window focus transfer not proved
Writer prerequisite in this PR 25 writer/queue/real-PTY tests; exact 25,007 bytes, with serialization-bypass negative control Independent re-review cleared all three findings; real-PTY test reviewed Daemon/SSH/WSL/Windows stress
#15708 latency; replacement in this PR Six encrypted stream→PTY cases, exact 18,030 bytes; native Android→PTY exact 19 bytes at 300/400/500ms simulated RTT; revised 57-byte mixed burst, 7-byte JS-stall and 23-byte modifier checks at 400ms; negotiated rejected/unknown recovery without replay Independent arrival/receipt/transport/history/control-order/attachment and native-boundary reviews Native soak, repeat RTT cost, public relay, physical recovery, native overflow UX
#4666 original native capture (closed, unmerged draft) Historical source/inventory review only; author explicitly lacked device QA/repeat proof Not claimed ready by this work Not imported or newly exercised
#10123 native selection/cursor sync (closed, unmerged) Author reports deterministic middle-edit, Hangul and duplicate hardware-arrow tests; explicitly no physical iOS/native build proof Inventory/body inspection here, not a fresh code review Not imported; native selection/arrow interaction remains a device acceptance case
Android hardware terminal tap focus; this PR Native app with IME hidden and keyboard height zero: three spaced taps, three focus calls, zero blurs, focus retained; previous-policy negative control causes one blur/refocus Independent review passed; native presence sampled at dispatch, no duplicate state; 4,309 mobile tests / 3 skipped Physical detach/software-IME recovery and rapid-tap behavior remain unproved
Blank terminal-area focus; this PR Previously failing native taps below the scaled terminal now retain RN input focus with zero programmatic blurs Seven blank-tap regressions; independent review passed 95 focused tests and caught/fixed three-finger rearming Native pinch/selection and physical-device matrix remain open; no terminal-cell or mouse bytes synthesized for blank taps
Android modal/navigation ownership; published 8ffa3513409 New Tab modal blocks terminal x/Ctrl+C and palette Ctrl+Shift+J; hardware Tab moves native focus Codex→Claude. After dismissal, Ctrl+Shift+J opens focused search and Ctrl+1 returns to the workspace; fresh q, Return sends exactly q, \r to mock Existing native/window ownership implementation; new acceptance check, not new code review One native Android modal and mock acceptance only; no PTY, iPad, Bluetooth or all-modal claim
Mixed-version input safeguards Direct/relay registry tests cover absent, future-version and invalid-limit echoes; uncertainty remains blocked after processing an older-host subscription, with no binary replay. 26 focused mobile tests and 19 host/two-build terminal tests pass Self-reviewed test-only extension; no transport behavior change These registry tests simulate capabilities; actual encrypted two-build evidence follows
Mobile encrypted two-build input; c134a02c43f Actual current/released E2EE sessions, mobile channels/stream registries and host dispatchers: all four version pairs deliver exact BOM/Hangul/newline/control bytes to a real PTY. Negotiation checked against same-version references; byte-corruption and refused-send negative controls pass. Full cross-version + CI scope run: 87 tests across 9 files; typecheck/lint/hooks pass Independent review found cleanup gaps, now fixed; final re-review cleared changes and independently passed 19 mobile/structured tests Released source uses installed mobile crypto primitives and current runtime writer; JSON fallback is fixture-generated. Public relay, physical keyboards and hosted CI remain unverified; recovery extension follows
Mixed-build uncertain-input recovery; b513cce6f08 Production logical client persists across current → actual v1.4.197 → current encrypted sessions. Real PTY receives prefix before its receipt is dropped. Old host refuses recovery; stream Enter and JSON input never reach the physical adapter. Compatible reconnect still requires explicit recovery; exact final bytes prefix한글fresh\r prove no replay or stray Enter. Full cross-version + CI scope: 88 tests / 10 files; final strengthened recovery test, typecheck, quality gate and hooks pass Separate implementing agent and parent code review; optional API presence preserved, cleanup reused, adapter-entry assertions strengthened Session assembly, receipt-loss trigger and runtime metadata are fixture-owned; current writer in every phase. Not public-relay reconnect, native recovery UI, Bluetooth or iPad proof
Android terminal hardware paste; this PR Ctrl+Shift+V plus immediate typing/Enter: exact 20 PTY bytes; prefix + paste + typing/Enter: exact 21 bytes at 400ms simulated application-frame RTT Independent native/admission/snapshot review; clipboard timing, resource cancellation and reconnect-wait findings fixed Physical Bluetooth, held-paste device trace, native image allocation, public relay and iPad Cmd+V
#15480 Korean IME (merged) Eight historical device-trace replay tests Historical fix; not newly device-validated here Fresh attached-iPad IME run
#7273 held Backspace (merged), #16018 DeX (open) Android nonvirtual keyboard held-Backspace-to-mock check; DeX source review only Not claimed ready by this work Physical Bluetooth repeat and actual DeX matrix
#16018 DeX keyboard subset, head 09716afbe57f Author reports Galaxy/emulator layout proof; no new DeX device test here Independent review found generic Android Back is converted to terminal Escape after inferred hardware presence; do not port unchanged Preserve system Back versus real Escape ownership; hardware-presence/detach and IME-free focus checks

Native Android recovery UI

Android undo and boundary-arrow follow-up

Android Ctrl+Shift+V paste

Follow-up on the published source-built APK: hold Ctrl+Shift+V, release Shift while V stays down for another second, release V/Control, then H, fresh Ctrl+V, Enter. The native nonvirtual keyboard → encrypted dispatcher/writer → real raw-stdin PTY check passes exactly paste-한글\nline-2H\x16\r (21 UTF-8 bytes), with exactly one paste JSON RPC at 400ms simulated application-frame RTT. This verifies no extra bytes in the observed hold sequence and preserves literal Ctrl+V; it does not establish an exact kernel/native repeat count or Bluetooth behavior. Two runs pass; final evidence is notes/keyboard-native-held-paste-final-pty.log and the matching key log.

Commit 8a3b81699f3: opt-in capable Android builds now use exact Ctrl+Shift+V for terminal paste. Ctrl+V remains terminal 0x16; iOS Cmd+V, Native Chat editing, composition and older installed native builds retain their existing paths. Native capture reuses the same-input field snapshot/reset/count event and suppresses held-paste repeats, including after Shift release. JavaScript admits the boundary once and never clears later typing.

The existing clipboard/image paste implementation now reserves its queue position before clipboard work. An accepted request snapshots promptly even while an earlier receipt is pending; later Enter cannot overtake it. Early read errors are handled immediately, failed paste fences the suffix, and stale pre-dispatch work is cancelled without replay. Requests use the existing fail-when-disconnected terminal option. Text reservations retain the existing queue budget; image snapshots have a separate 24MiB base64-character cap and four image-read/preparation permits held until native work actually settles, even after cancellation. Existing large-image downscaling is preserved. These are concurrency/retention bounds, not measured peak native raster memory. Cancelled remote uploads may leave unused temporary images.

Final actual Android nonvirtual qwerty2 flow: a, Ctrl+Shift+V, x, Enter delivers exactly apaste-한글\nline-2x\r (21 UTF-8 bytes) through production encrypted transport, dispatcher and writer to a real raw-stdin PTY. It uses one existing paste JSON RPC and three ordered input frames/receipts at 200ms each application-frame direction. The earlier no-prefix flow passes exact 20 bytes. Runtime metadata is stubbed; this is not Bluetooth/public-relay/agent execution proof. Final native45 tests, mobile4308 tests/3skip, typecheck, changed-code quality, host25 tests and104gate validation pass. Source-parity updates were limited to AST-verified new strings/handler/prop; style and component-count invariants are unchanged.

Commit 65852e2aacb fixes the invisible undo step described below: identical nonempty RN/Fabric updates reconcile spans without replacing text. Changed text and empty clears retain the native path. First Ctrl+Z now changes abxc to abc; Ctrl+Shift+Z restores abxc. Unicode insertion undo and exact Ctrl+Enter submission also pass on the nonvirtual emulator keyboard. Android now builds RN from source so the Kotlin patch actually reaches the APK; README documents SDK/toolchain and first-build cost. The existing iOS source-build setting and patches remain intact. Metro excludes only generated native-build trees; the lockfile differs only in patch/peer hashes.

Android's exact-source boundary check let combined keyboard/DPAD arrows escape the composer. Submit mode now delegates native movement first and consumes only otherwise-unhandled, unmodified arrows from physical alphabetic keyboards. Recorded empty four-direction/end-of-text flows retain focus. Independent review found no concrete blocker; 37 native tests pass. A later paste-selection observation was traced to stock Android's toggled-keyboard Shift latch after redo, not established paste timing or RN patch regression; native sticky modifiers are preserved.

Source-built APK terminal regression passes all 57 expected bytes through native input, production encrypted transport/dispatcher/writer and real PTY stdin: 29 input frames, 29 receipts, zero JSON fallback at 400ms simulated application-frame RTT (200ms each direction). Runtime metadata is stubbed; this is not Bluetooth, public relay or soak proof. The earlier undo failure below is historical evidence from published 23e0a70f37f, not the new candidate's result.

Arrow lifecycle follow-up: three additional native tests cover held movement reaching an unhandled boundary, captured release after focus moves to a button, and fresh native movement superseding a lost release. All40 native tests pass; independent review found no blocker. The new tests simulate editor dispatch results and prove ownership, not real caret movement. On the published emulator APK, abc/Home, Right held for one second, release, then x produces abcx with composer focus retained. No exact repeat-count trace or Bluetooth delivery is inferred. Responsive high-RTT editing repeats remain a separate contract decision: pipelining preserves no replay but allows several keys to have arrived before a lost receipt becomes known; current receipt-per-control behavior is unchanged.

Undo provenance follow-up on 23e0a70f37f: a debugger caught maybeSetTextFromState via Fabric updateState, with native and incoming text both abyc and native/incoming event counts both 140. This confirms the actual identical-update path that the native fixture reproduces. Debugger detached and app resumed. This is not latency evidence; the source-built fix is described above.

Native Chat clipboard follow-up on 23e0a70f37f: nonvirtual Android hardware events replace the draft with paste-한글\nline-2, move the cursor and insert x, copy exact paste-한글\nline-x2, cut it (independently replacing a clipboard sentinel), and paste it back. Editing generates no sends. Ctrl+Enter then sends the existing Ctrl+U preparation plus the exact draft once; the composer clears and stays focused. Assertion-generated evidence: notes/keyboard-native-chat-editing-proof.json. This uses real task-owned Android clipboard APIs and app-to-mock acceptance, not Korean IME composition or physical iPad proof. Undo failed: first Ctrl+Z leaves abxc unchanged; second restores abc. A separate four-test native fixture reproduces the invisible undo step after identical RN JS/Fabric text updates; on-device provenance is recorded above. No speculative production undo fix is included.

After clearing a stale Metro cache, verified the current recovery module is loaded. Native nonvirtual keyboard s reached the mock as a rejected send; the app cleared the field, disabled input controls and displayed the warning. With the mock restored to acceptance, tapping Reconnect input removed the warning without any input replay. The next native t and Return produced exactly t then \r. This exercises legacy JSON failure/recovery, not negotiated-stream failure or real PTY execution.

Android keyboard recovery follow-up: the initial failed-field focus landed on Back, so Enter navigated away. Recovery now requests native button focus after mount on the active route, canceling the request on blur/unmount. Native qwerty2 s rejection showed Reconnect input as focused in the Android accessibility hierarchy; hardware Enter removed the warning without navigation or terminal bytes, then u + Enter delivered exactly u, \r. Five lifecycle tests cover delayed focus, no automatic recovery, route blur/return, inactive routes, unmount and the Android-only platform boundary; together with recovery-state and keyboard-focus tests, 16 pass. Mobile typecheck and targeted lint pass. Independent focus re-review found no blocking issues. iOS button focus remains unproved and is unchanged.

Paused state:

Native Android input paused

After explicit recovery and new input:

Native Android input recovered

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

1 participant