Repository navigation
Description
Problem
cua's macOS read-back confirms type_text by reading the field back, through confirm in native/engine/Sources/Engine/TypeReadback.swift. Safari's contenteditable reports an ending Return as "\n\n": the Return plus the empty last line's placeholder. confirm handles that case only in one direction, accepting expected + "\n" with caret evidence (readbackPlaceholderLine, ~L200–209; the placeholderLine outcome ~L793–880, ruling 1ea561bc:737 on #354, run 43752829833).
The inverse case is not covered. Take a request ending in two Returns ("x\n\n") where the field accepted only the first. Safari then exposes "x\n" plus its placeholder, which reads as "x\n\n" with the caret at 2. That raw value equals the expected text, so confirm's direct-equality branch accepts it without looking at the caret. It reports success, and the model believes a Return landed that the field does not hold.
The case was found in #616's review, round 3, where the same equality made an inputSourceChanged stop report an exact count. #616 guards its own stop path (ruling 1298). This ticket is the ordinary, non-stop path.
What is known
- The vendor answers this case the same way. The vendor's engine has no read-back:
performKeyboardActionposts and answers ok (see macOS engine: type_text that finds no focused element answers typeUnconfirmed where the vendor answers ok (declared limit) #597's disassembly notes). In this case it also reports success, so cua is no worse than the vendor here. It is only less strict than its own read-back intends. - No flip cell exercises it. Independence 4: cua's own native accessibility engine (replace sky) measured against a native baseline #117 M5's native matrix venues are TextEdit, Chrome for Testing, the Electron fixture and Finder. None is Safari contenteditable, and the placeholder line was observed only in Safari. Whether Chromium's contenteditable exposes the same placeholder is unverified.
So by ruling 1298's test this does not block #506.
Wanted
When the expected text ends in "\n", confirm accepts the direct-equality reading only with caret evidence that the caret sits after the final Return, the same evidence the placeholder rule already uses. Otherwise the result is unconfirmed (the existing reason). Add a test: "x\n\n" expected, "x\n\n" read with the caret at 2, which must not confirm.
Board
Bug, P2. Parent #117. Relates to #616 and #354. Not a #506 blocker.
Sminos-Session: cursor235#b93055dd (cua on macbook)
Activity