Pad/internal/ui
Greg Pomerantz a9183a0f73 IME: accept the one stale-caret commit after a key-event edit; fix the IME hold
Gboard sends Enter as a key event, not a commit, so the IME's model
lags the buffer by exactly one edit and its next commit is anchored at
the pre-edit caret. The drift guard snapped such commits to the new
caret, duplicating the just-typed word (2026-09-19 phone incident:
'a<enter>a' became 'A' + 'AaAa').

- state.go: track one pending non-IME content edit (imeStaleEditByte,
  armed by noteNonIMEEdit on Enter/backspace/delete/cut/paste, consumed
  by the next IME commit or key edit, cleared by a tap). The guard
  accepts a small (<= 2 rune) TEXT commit ending at or before the edit
  position as-is (IME STALE-OK): everything before the edit is
  byte-identical in both models. Empty-text commits and commits ending
  past the edit still snap to the caret.
- render.go + state.go + main.go: arm the pre-commit flush hold with the
  drained frame's own EditSeq. The hold was armed with the last drawn
  frame's seq while the frame's TextField.EditSeq was never set (always
  0), so every frame matched and the hold released only via its
  8-frame timeout - silently swallowing the resync pushes (and all IME
  sync) that heal the desync. EditorLayout now ships EditSeq with the
  frame's TextField; FlushIME releases on the next higher seq.
- e2e (ime_key_edit_test.go): reproduce the incident (same-batch and
  next-batch variants) and pin the guard edges (deletions and
  past-the-edit commits still snap).
- ime.md: document the key-event desync invariant and the hold.
2026-09-19 21:52:35 -04:00
..
icons Add in-file search (find bar) 2026-08-20 00:02:54 -04:00
caret_point_test.go Handle drags: 1:1 finger tracking with cross-flip; fix caret/taps on empty lines 2026-08-19 22:34:12 -04:00
element.go IME: force a re-syncing snippet re-push when the IME desynchronizes 2026-09-13 18:23:06 -04:00
layout.go Make the editor top and bottom bars ~30% taller for bigger tap targets 2026-09-03 12:34:18 -04:00
pinch_test.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
pinch_tracker.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
real_draw_probe_test.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
render.go IME: accept the one stale-caret commit after a key-event edit; fix the IME hold 2026-09-19 21:52:35 -04:00
reveal_focus_drain_test.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
tag_identity_test.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
unit.go Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00