mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 09:13:23 +00:00
Audit of the branch, two findings. `readonly` stops the *user* editing a field, not scripts: the shim writes through the native value setter, so any text that reaches the host mirror is applied to the page and fires an `input` event no native browser would. Cut and Paste were refused at their call sites, but that misses a hardware keyboard (tablets, DeX, Chromebooks) — whose Ctrl+V goes straight to `onTextContextMenuItem`, bypassing the wrapper — and autofill. Configure the mirror as TYPE_NULL for a readonly field instead: `onCheckIsTextEditor()` is then false, so there is no InputConnection to type through at all, while selection and Copy — the half native does offer on a readonly field — keep working. The selection toolbar's item list was rebuilt on every recomposition of the tab layer, which recomposes on every IME inset change, bounds report and console line, for a toolbar only shown during a selection. Remembered on the readonly flag, so it allocates once and keeps a stable identity the overlay can skip on. Adds tools/ime-test/shim-events.mjs, a regression test that drives the shipped shim in headless Chromium and asserts the page→host envelopes. It fails on main (7 cases, including "no ime.wantkb — the keyboard could never come back") and passes here. A JVM unit test cannot cover this: the host parser runs on Android's org.json, which the unit tests stub out, so it would pass without parsing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AC3ambee9KFcvHCS6HRqhS