Skip to content

fix(mobile): the page's Live input on Android echoes each letter as typed (OTA phase C follow-up) - #22958

Merged
Jinwoo-H merged 3 commits into
mainfrom
ota-fu-page-live-typing
Sep 26, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
ota-fu-page-live-typing

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​139 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​137
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11

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 isComposing straight 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 last input event still says isComposing: true, then compositionend fires with no further input event (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.

Case Page before Page after Native Android
/, then compose t,tu,tui / only /,t,u,i /,t,u,i
compose teh, commit the nothing t,e,h, two DEL, he same
iPhone user agent, compose ni held held (guard) n/a

Tests (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

  • WebKit's event order around compositionend was 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.
  • A compositionend-driven release would not fix the reported symptom (Samsung keeps the region open until space or Enter) and is not added.

…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

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Android composing range ignored on the page. reportedLiveInputComposing in mobile/src/terminal/use-terminal-live-input-commit.ts returns undefined when the user agent contains Android, so the DOM's isComposing: true no 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.ts adds the page on Android to the platforms its JSDoc already lists as reporting no range.
  • Unit coverage. use-terminal-live-input-commit.test.ts pins per-letter echo after a slash and the Hangul settle-on-timer path under an Android UA, with vi.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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: eb8ffc18-9064-4267-8f3a-7f2465ce8793

📥 Commits

Reviewing files that changed from the base of the PR and between add99c9 and ee1fca7.

📒 Files selected for processing (4)
  • config/scripts/mobile-web-app-terminal-live-input-render.test.mjs
  • mobile/src/terminal/terminal-live-preedit-mirror.ts
  • mobile/src/terminal/use-terminal-live-input-commit.test.ts
  • mobile/src/terminal/use-terminal-live-input-commit.ts

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


📝 Walkthrough

Walkthrough

The 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 ee1fc

The Android input change and its tests have no remaining actionable merge concern in the supplied evidence.

Security Architecture Review

Security architecture risk: 🔵 Low · up to ee1fc

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
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The established exposure is earlier delivery of the current user’s provisional ASCII to that user’s active terminal session. The reviewed test helpers do not establish an independently reachable production endpoint.

Trust Boundaries and Controls

  • observed — The send path checks the active handle, terminal tab, and eligible terminal-handle set before queuing bytes. The Android user-agent check changes composition handling, not those checks.

Resilience and Maintainability Implications

  • observed — Local queued and held state is cancelled on reset, while explicit flush waits for pending input before ending the field session. These controls do not retract bytes already delivered to the terminal.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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, … 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 th…
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main Android Live input fix. It is concise enough for the change and identifies the affected area and behavior.
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, 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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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

Comment @coderabbitai help to get the list of available commands.

@Jinwoo-H
Jinwoo-H merged commit 570f070 into main Sep 26, 2026
33 checks passed
@Jinwoo-H
Jinwoo-H deleted the ota-fu-page-live-typing branch September 26, 2026 00:25
Jinwoo-H added a commit that referenced this pull request Sep 26, 2026
…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
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