Pad/internal/ui
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
..
icons Browser page: scroll + click coexist via register order fix 2026-05-27 12:14:25 -04:00
element.go ui: dedup IME snippet/selection to fix rapid-commit desync 2026-08-16 13:00:25 -04:00
layout.go Add word-wrapped text display with two-finger scroll 2026-05-26 20:26:20 -04:00
render.go ui: dedup IME snippet/selection to fix rapid-commit desync 2026-08-16 13:00:25 -04:00
unit.go WIP baseline: Termux open-file bridge + word-wrap-aware viewport/scroll 2026-08-16 00:31:26 -04:00