Repository navigation
fix(kit): focus text fields and select outline rows on click - #153
frankorbit wants to merge 2 commits into
Conversation
177f2cd to
52ae199
Compare
SwiftUI text fields such as the Contacts search box expose no AXPress, only
AXConfirm, so a click submitted the search and left keyboard focus on the
list; the following type_text then failed. Sidebar rows live in an
AXOutline, which selectContainingListItem does not cover, so clicking a row
never changed the selection.
- click on AXTextField/AXTextArea sets AXFocused and verifies the app's
focused element before falling back to the action chain
- click on an element inside an AXRow sets AXSelected on the row and reads
it back
- KeyPressParser accepts ArrowUp/ArrowDown/ArrowLeft/ArrowRight
- the REPL's app.click accepts a { x, y } point as well as [x, y]
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
52ae199 to
2f2511f
Compare
|
The Contacts cases are real. We built the same kind of ladder and ran it against a compiled AppKit fixture on macOS 27.2. Three things came out of that which apply here:
Minor: the fixed 150 ms and 30 ms waits can be polls. On the fixture, writing AXSelected and reading it back took 0.7–2.2 ms end to end, polling every 5 ms with a 400 ms limit. With |
…ce a write went out selectContainingRow ran before AXPress for every element under an AXRow, so a checkbox or disclosure triangle inside an outline row selected the row and was never pressed. The row path now applies only when the target is the row or cell itself or has no AXPress of its own. AXFocused / AXSelected writes are treated as delivered unless the error proves nothing applied (attributeUnsupported, actionUnsupported, illegalArgument, noValue, notImplemented, invalidUIElement); AppKit answers -25205 for writes it did run. When the read-back does not confirm within 300 ms (focus) or 400 ms (row), the click stops instead of falling through to AXConfirm, and the result carries a note asking for get_app_state. Focus landing on the field's own editor counts as confirmed. Rows whose AXSelected is not settable are selected through the outline's or table's AXSelectedRows / AXSelectedChildren. Fixed waits became 5 ms polls. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks, the three cases are real and 3a48b3e addresses them:
The fixed 150 ms / 30 ms waits are 5 ms polls now and no longer depend on |
Problem
Measured with native AX on macOS 27.2 Contacts:
AXPress, onlyAXConfirm/AXShowMenu.clickfalls through toAXConfirm, which submits the search while keyboard focus stays on the list, so the followingtype_textfails with “requires a focused editable text element”.AXRowelements whose parent is anAXOutline, not anAXList.selectContainingListItemdoes not cover them and the rows have noAXPress, so clicking a row never changed the selection.Changes
clickonAXTextField/AXTextAreafirst setsAXFocused = trueand verifies that the app's focused element is now that element, before falling back to theAXPress/AXConfirm/AXOpenchain.clickon an element inside anAXRowsetsAXSelected = trueon the row and reads it back; it does not count as handled when the row is not settable.press_keyacceptsArrowUp/ArrowDown/ArrowLeft/ArrowRight.app.click({ x, y })is equivalent toapp.click([x, y])(models use both spellings; the object form used to be rejected).Verification
type_text("Yumi")filters the list; clicking theAll on My Mac/All Contactsrows switches the selection.CursorWindowFollowTests.testServiceClickRegistersLiveWindowAndFeedbackMatchesMovedButtondepends on the test host's own window and fails the same way onmainhere.History:
docs/histories/2026-11/20261106-1802-click-focus-text-fields-and-select-rows.md; release note added.🤖 Generated with Claude Code