Pad/internal
Greg Pomerantz 46383c1fc1 ui: dedup IME snippet/selection to fix rapid-commit desync
TextField.Draw re-pushed key.SnippetCmd and key.SelectionCmd every frame
while focused. Re-pushing an unchanged snippet resets the IME's composition
and caret, so commits arriving faster than a frame interleaved with those
resets and desynced the cursor (garbled/duplicated text).

Mirror widget.Editor's updateSnippet/selection gating: track the last-pushed
snippet and caret in the main-owned Renderer (keyed by field ID, reset on
focus (re)gain), and only emit the ops when they actually change. A fresh
push is forced whenever the field (re)gains focus so the IME always starts
from a known state. Also drop a leftover per-frame 'Focused:' debug print.

On-device: rapid back-to-back commits (0.08-0.1s cadence, faster than a
frame) now land cleanly - type HELLO, append+backspace, and a
browser->editor navigation round-trip all produce exact content.
go test -race ./... green.
2026-08-16 13:00:25 -04:00
..
browser Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
editor editor: fix whole-file shaper leak + LineIndex mismatch (Phase 3) 2026-08-16 12:16:52 -04:00
io/pool Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
test/e2e Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
ui ui: dedup IME snippet/selection to fix rapid-commit desync 2026-08-16 13:00:25 -04:00