Repository navigation
feat: element actions and value setting for non-text controls - #47
Merged
Merged
Conversation
iamnbutler
force-pushed
the
feat/element-actions
branch
from
October 17, 2026 02:40
9922c34 to
a0acdc1
Compare
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two snapshot-bound tools for controls that clicking and typing handle badly.
Tools
desktop_element_actionperforms one named Accessibility action on an observed element:AXShowMenu,AXIncrement,AXDecrement,AXConfirm,AXCancel,AXPick,AXRaiseorAXScrollToVisible. The client refuses before dispatch when the element doesn't list that action inattributes.actions.AXPressis left out because it duplicatesdesktop_click.desktop_set_valuesets a non-text control and checks the result by reading the same element back.AXIncrementor) and level indicators.true/falseworks for checkboxes, switches and disclosure triangles, wheretrueexpands.AXPress, as SwiftUI checkboxes do, it gets at most one press. If the state already matches, nothing is sent. A mixed state is refused.desktop_type.desktop_clickto open, thenAXPick(or a click) on the item from the next inspection. Open menus are now listed first inui_elements, so the 32 KB result bound doesn't trim them away.desktop_inspectnow addsattributes.actionsto each element. It lists only the standard AX names, at most 16, from the supported set (AXPressis omitted).Exactness (
peekaboo-element-action.patch, last in the stack afterpeekaboo-layout-keys.patchfrom #46)performActionandsetValueresolved the target by snapshot ID and fell back to a fuzzy label query. They then found the live element by a score in which a label or frame alone could win. The only check afterwards compared that live element with itself.SNAPSHOT_STALErefusal.desktop_typestricter, since it routes throughsetValue.DetachedAXActionRunner.native/patches/README.md.Verified
npm run build:js && npm run checkpasses.node dist/build.js --out build --scratch native/.buildpasses with the full patch stack.ActionInputDriverTests|UIAutomationActionOutcomeProvidingTests|DetachedAXObservationWorker|AgentCursor|SetValue.~/.peekaboolane lock by a throwaway local edit that pointedDesktopCoordinationRuntimeRoot.defaultURLat a temp directory. The edit was reverted before pushing and is not part of this PR.HOMEdoesn't isolate the lock, because the lane root comes from the account database (getpwuid_r).desktop_set_value0.25 completed with readback 0.25.AXIncrementwent 0.25 to 0.35 andAXDecrementwent back.falsewhen already unmuted wasconfirmed_no_changeand sent no input.truewas confirmed by a press with readback; then restored.desktop_clickopened the menu, the items listedAXPick, andAXPickon the current item completed.Pending: screen locked
The Mac's screen locked partway through, so these live checks have not run:
AXShowMenuon a Finder file: check the context menu appears in the next inspection, then dismiss it withAXCancel.desktop_set_valuetrue/falseto expand and collapse, then restore.AXIncrementor):AXIncrement/AXDecrementanddesktop_set_value.desktop_typeinto a TextEdit or Settings search field under the exact binding.AXConfirm,AXRaiseandAXScrollToVisibleon elements that advertise them.Caveats
UIElementValuehas no date type.desktop_set_valuecompares numbers exactly on readback, so a control that rounds or snaps reportsunknown. Re-inspect it rather than repeat.accessibility_actiondelivery, notaccessibility_value.attributes.actionsmakes inspect results a few percent larger, still within the 32 KB bound.