Repository navigation
fix(mobile): the page's Live input on Android echoes each letter as typed (OTA phase C follow-up) - #22958
Conversation
…s they are typed The reported shape, in a browser: `/tui` on an Android keyboard, where the `/` reached the terminal and `tui` did not until Enter. Android keyboards hold a composing region over the Latin word being typed, so on the page every input event mid-word carries `isComposing: true`, and the preedit mirror holds reported preedit with no settle timer. Native Android reports no range, so there each ASCII keystroke is sent as it is typed. Driven through Chromium's own IME path with an Android WebView user agent: the letters after the slash must arrive one by one, and a correction on commit must still erase and retype. The iPhone case is the guard that a composition off Android stays held. The hook case says the same thing without a browser. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…e Android does `handleLiveInputChange` passed `nativeEvent.isComposing` straight to the preedit mirror. On the page that event is the DOM's, and an Android WebView marks the keyboard's composing region, which Samsung and other Latin keyboards keep over every word. The mirror treats a reported range as preedit that is not text yet, holds all of it with no settle timer, and Chromium fires no input event after compositionend, so the word sat in the field until the next keystroke or Enter. Native Android reports no range at all, and its fallback holds only a trailing non-ASCII run. The page on Android now reports the same: undefined. ASCII echoes on each key, a Hangul or kana run still settles on the timer, and a correction on commit still erases and retypes. iOS, where the range is the text system's marked text, is unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…o composing range The mirror's fallback note listed only React Native Android; the page on Android now reports no range too. The reader's docblock becomes the one line it needs. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Android composing range ignored on the page.
reportedLiveInputComposinginmobile/src/terminal/use-terminal-live-input-commit.tsreturnsundefinedwhen the user agent containsAndroid, so the DOM'sisComposing: trueno longer reaches the preedit mirror; the trailing non-ASCII fallback runs and ASCII keys echo as typed. This is a no-op on native Android, which already reports no range, and iOS is untouched. - Doc update.
mobile/src/terminal/terminal-live-preedit-mirror.tsadds the page on Android to the platforms its JSDoc already lists as reporting no range. - Unit coverage.
use-terminal-live-input-commit.test.tspins per-letter echo after a slash and the Hangul settle-on-timer path under an Android UA, withvi.unstubAllGlobals()in teardown. Reverting the helper makes both fail, so the assertions are load-bearing. - Render coverage. The browser check grew an
openProbe({ userAgent })option and an Android-WebView describe driving Chromium's real IME path (slash-word, correction, and an iPhone guard), with exact send sequences.
The remaining Android conversion-IME behavior (ASCII pinyin/romaji preedits echo, then correct on commit) and the unverified WebKit ordering on iOS are called out in the PR body as intentional parity / out of scope, so no action is requested here.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe live-input handler now passes a platform-adjusted composition value to the mirror. Android user agents produce an undefined value; other platforms retain the native composition value. Tests cover Android WebView Latin and Hangul input, Android and iOS browser composition expectations, and restoration of stubbed globals. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The Android input change and its tests have no remaining actionable merge concern in the supplied evidence. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Android live terminal input now sends provisional Latin letters as they are typed. The reviewed change does not add a production entrypoint or grant terminal access, but it changes when text reaches the terminal. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, cause, fix, scope, evidence, and tests, but it does not follow the required template. It omits the required ELI5, Why, Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. Resolution Reformat the description to include all required template sections. Add the linked issue after “Fixes #”, attach before-and-after visual proof or state N/A with a reason, complete the testing checkboxes and platform details, and complete the remaining checklist and review sections.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
…orm seam pair (#23037) #22958 made the page on Android report no composing range with a user-agent check inside the shared live-input hook. Host facts live in a `src/platform` pair, so the check moves to `live-input-composing-range.web.ts`; the native file passes the event's range through. Behaviour is unchanged. The hook test mocks the seam; the user-agent cases move to the seam's own test. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

What
On the hybrid-shell page's terminal Live input on Android, letters typed after a
/(or any word-ending key) were not live-typed: the word arrived only on the next key or Enter. Native Android echoes every key.Cause. The page passed the DOM input event's
isComposingstraight to the preedit mirror. An Android WebView marks the keyboard's composing region, and Samsung-style keyboards keep one open over every Latin word; the mirror holds a reported composition with no timer (a reported preedit is not text yet). On commit Chromium's lastinputevent still saysisComposing: true, thencompositionendfires with no furtherinputevent (Input Events Level 2 order; probed directly on Chromium via CDP by the reviewer), so the word sits in the field until the next key. Native Android reports no composing range at all, so its fallback holds only the trailing non-ASCII run and ASCII echoes per key.Fix. On an Android user agent the page reports no composing range, exactly as native Android does (
use-terminal-live-input-commit.ts). iOS unchanged. Hangul/kana runs still hold and settle on the existing 300 ms timer. Pinyin/romaji on the Android page now behave like native Android (letters echo, then correct on commit).Evidence
The emulator's Gboard fires no composition events in this field (every key a plain
insertText), so the device could not reproduce the symptom; the proof is Chromium's own IME path driven through CDP in the render test, red on the base commit./, then composet,tu,tui/only/,t,u,i/,t,u,iteh, committhet,e,h, two DEL,heniTests (red first)
config/scripts/mobile-web-app-terminal-live-input-render.test.mjs: slash-word and correction cases through Chromium's composition path (expected [['/'],['/'],['/']] to deeply equal [['/','t'],…], then a 30 s wait timeout, before the fix); iPhone guard.use-terminal-live-input-commit.test.ts: Android UA sends each letter after/as typed; Hangul still settles on the timer (expected ['/'] to have a length of 2,expected [] to deeply equal ['한']before).Not in this PR
compositionendwas not verified; if it matches Chromium's, the iOS page has a latent version of this and would need the same treatment behind its own check.compositionend-driven release would not fix the reported symptom (Samsung keeps the region open until space or Enter) and is not added.