Description
Problem
A coordinate click's caret effect can land after the next action, and override it. Click into a field, select at once, then type: the click's caret reappears after the selection, so the typed text goes in the wrong place.
It was measured in #354's spike (kit probe/354-measure; evidence ~/.local/share/probe-354/click-order-facts.json on the MacBook):
-
Click, then a full selection by script at once, then
type_text: the placement went wrong in Chrome for Testing 9/10, Safari 3/10, and Firefox 2/9, with 1 guard refusal. -
In one Chrome trace:
- the click returns;
- the script's full selection completes at +4 ms;
type_textstarts at +11 ms;- the click's caret at offset 3 reappears at +237 ms;
- the first typed input arrives at +416 ms.
The final text is
OldNew typed sentence goes here. draft sentence goes here. -
A model's real flow (click into a field, Cmd+A, type) is exposed the same way.
It is likely in #341's family: on Chromium, the click writes the caret with AXSelectedTextRange before any focus, and answers "placed" on the read-back. That read-back may pass before the write's effect has landed for good, or the page may re-apply it later.
Intent
A click answers only once its caret effect is final, so nothing later re-applies it. Measure first:
- Which part lands late per browser: Engine: a click in a scrolled Chromium textarea places the caret on the line as if the field were scrolled to the top (focus scrolls it first) #341's selection write, the focus, or the posted click.
- Whether the "placed" read-back can pass while an effect is still pending.
Constraints
- Keep Engine: a click in a scrolled Chromium textarea places the caret on the line as if the field were scrolled to the top (focus scrolls it first) #341's rules: "placed" only on proof, and nothing raised.
- Spawned by Engine: in background Safari, cmd+a then type_text can lose the first typed character, both calls answering success (the key equivalent's effect trails the next call) #354, and related to Engine: a click in a scrolled Chromium textarea places the caret on the line as if the field were scrolled to the top (focus scrolls it first) #341. Design session ruling 1ea561bc:585: P1, first in lane 1 after Engine: in background Safari, cmd+a then type_text can lose the first typed character, both calls answering success (the key equivalent's effect trails the next call) #354. No parent; not blocked.
Success criteria
- Click, then an immediate selection (by key or by script), then
type_textplaces the text as selected in 20 of 20 trials per browser. - No regression on Engine: a click in a scrolled Chromium textarea places the caret on the line as if the field were scrolled to the top (focus scrolls it first) #341's cells.
Activity
SSFSKIM commentedon Nov 17, 2026
[board] in-progress: Taken by cursor235 per design 1ea561bc:777. Measurement first: kit probe/359-measure (offline f4ccd10) re-pinned to current main, smoke then full on hosted runners.
Probe #359: prepare screenshot parents before setup observations [ski…
Probe #359: separate the original equal-range foreground diagnostic […
Probe #359: preserve diagnostic dispatch coverage [skip ci]
Probe #359: measure real continuations, typing baselines and selectio…
SSFSKIM commentedon Nov 17, 2026
Measured cause, and the restated success criterion (ruling 1ea561bc:785)
Cause (spike runs 44107967517, 44112583792, 44126242634; main 15acf09). This is a foreground posted-click ordering race, not #341's AX caret write. With the browser in the background (#341's route), 0 of 3,437 scorable attempts were wrong. In the foreground the click is a posted mouse event and answers at once, but the browser dequeues it late: the revert lands p50 14–19 ms after the click returns, and the worst case was +419 ms. AX actions (select_text, set_value, type_text's baseline read) can overtake it. Posted keys (Cmd+A) are queued behind the click: 0/20 wrong in every browser. type_text's false success came from a baseline read taken after the revert.
Fix shape (ruling 785):
Success criteria (they replace the script-selection criterion):
macOS engine: type_text checks select_text's range on its final start…
Probe #359: qualify paired unmodified engines and forced tails [skip ci]
Probe #359: prove tail exposure and retain dispatch-wide coverage [sk…
Probe #359: hold the posted FIFO without blocking AX [skip ci]
9 remaining items
SSFSKIM commentedon Nov 17, 2026
[review-trail] doperpowers:reviewer-high 136183a..ef998db incorrect (P1 earlier-read selection check, P2 truncation, P2 secure recheck) -> fixed f350ced, re-review correct.
macOS engine: AX text actions wait for a foreground click to land, an…
SSFSKIM commentedon Nov 17, 2026
[board] done: Landed via PR #402 (cua 0.28.9)
Engine: an unfocused read-back confirms only an exact read, and set_v…
macOS engine: set_value writes a background Chromium page's field wit…
macOS engine: a field route's pending-click wait rechecks the point, …
Probe 456: the field's jitter moves the page's focus, and a field row…
Probe 456: the reader times the field's recheck by #359's wait, and c…
macOS engine: the element route's recheck after its wait refuses a wi…
macOS engine: one classification identity, one comparison, one select…
macOS engine: type_text answers ok with a note on a non-text target (#…
Secret wrapper: "nothing was entered" only on the macOS engine's posi…
macOS engine: type_text's paste route gates every ⌘V and Return on th…