mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 16:33:27 +00:00
The embedded browser renders cross-process through SurfaceControlViewHost, which forwards touch but not the soft keyboard (the embedded window can't be an IME target, and androidx.privacysandbox.ui never wires IME). So focusing a field in an embedded page did nothing. Bridge the keyboard instead: host it in the main app window and relay editing to the page. - Shim IME agent (embedded browser only, gated by __nappletImeProxy): tracks the focused editable, reports focus/blur/external-change, and applies host ops (commit / compose / delete / key / editor-action) with real input & composition events. Scrolls the field into view on focus. - NappletBrowserService relays ime.* envelopes between the page bridge and the client (MSG_IME_EVENT / MSG_IME_OP), per tab. - EmbeddedBrowserController implements EmbeddedImeBridge (parses events, sends ops). - RemoteImeView: an invisible EditText in the main window that takes the keyboard for the active tab. Keeps a real local Editable (so the platform handles composing/suggestions/selection) while an InputConnection wrapper forwards every op to the page. Maps web input types / enterKeyHint to inputType/IME action. - EmbeddedTabLayer hosts the proxy bound to the active tab and shrinks the active surface by the IME height so the page can scroll the field clear of the keyboard. Covers <input>/<textarea> fully and contenteditable best-effort (plain text). Napplet/nsite embeds still need their own wiring (the shell path); this is the browser surface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgMpRcWj6y82LxLiwcuzmN