Pad/internal/ui
Greg Pomerantz 72b3c3f9c1 editor+ui: complete Android IME wiring (SelectionCmd, SnippetCmd, InputHintOp)
Finish Phase 1 items 1, 2, 4, on top of the range-handling done in 9b78219:

- TextField.Draw now emits, when focused:
  * key.InputHintOp{HintText}        (item 4: enable text keyboard/autocorrect)
  * key.SnippetCmd (the visible window as the snippet, Range {0,len})
                                              (item 2: swipe/autocorrect source)
  * key.SelectionCmd (caret, window-relative rune index)
                                              (item 1: IME selection sync)
  The snippet is the visible window (not the whole file), so the IME treats
  the window as the document and reports EditEvent.Range window-relative.

- HandleReplaceRange now resolves the window-relative range against
  IMEWindowText and offsets by IMEWindowStartByte to address the buffer
  (string and chunked paths). Falls back to the whole buffer when layout
  has not set the window (tests).

- EditorState gains IMEWindowStartByte / IMEWindowText, set during layout.

- Add runeCount helper (utf8 leading-byte scan) in the ui package.

- Fix a data race in three editor e2e/integration tests: they called
  OpenFile from the test goroutine while the logic goroutine ran layout;
  now wrapped in withState so the state write happens on the owner.

Tests: ime_range_test.go gains windowed-path coverage (string+chunked).
go build, go test, go vet, and go test -race are all green.
2026-08-16 02:43:58 -04:00
..
icons Browser page: scroll + click coexist via register order fix 2026-05-27 12:14:25 -04:00
element.go editor+ui: complete Android IME wiring (SelectionCmd, SnippetCmd, InputHintOp) 2026-08-16 02:43:58 -04:00
layout.go Add word-wrapped text display with two-finger scroll 2026-05-26 20:26:20 -04:00
render.go Make state single-owner and stabilize race detector 2026-08-16 01:32:27 -04:00
unit.go WIP baseline: Termux open-file bridge + word-wrap-aware viewport/scroll 2026-08-16 00:31:26 -04:00