mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 01:07:46 +00:00
Rework the host-side input proxy to mirror Flutter's TextInputPlugin / InputConnectionAdaptor instead of forwarding individual IME ops: - RemoteImeView ships the whole editing STATE (text + selection + composing region) rather than per-op messages, coalesced across IME batch boundaries (beginBatchEdit/endBatchEdit nesting, like Flutter's batchEditNestDepth). A TextWatcher + onSelectionChanged flush captures every mutation, so the soft keyboard, HARDWARE keyboards, autofill, paste, and context-menu edits are all covered uniformly — they all mutate the same real Editable. Composing region is read from the platform via BaseInputConnection.getComposingSpan*. - The shim adopts that state and synthesizes the matching DOM input/composition events (insertText / insertCompositionText / deleteContentBackward / insertReplacementText, with compositionstart/update/end) so web frameworks react as if typed natively — going beyond Flutter, whose consumer is a Dart widget. A common prefix/suffix diff classifies each change. - Beyond Flutter: backed by a REAL EditText, so the platform answers getTextBeforeCursor/getExtractedText, suggestions, and spell-check for free rather than hand-rolling a ListenableEditingState. - showSoftInput is posted after focus settles (avoids the show no-op race). This collapses the op vocabulary to ime.set (state) + ime.action and removes the commit/compose/delete/key/setSelection messages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgMpRcWj6y82LxLiwcuzmN