Repository navigation
Conversation
…lable on snapshot nodes A snapshot node carries hittable, which is true for a node that is clickable, focusable or focused. A reader that audits what an accessibility service is offered needs those apart: a node a screen reader can land on but cannot activate is hittable, and so is one it can activate. The Android reader already parses clickable, focusable and scrollable; this publishes them on the node. The snapshot helper now writes long-clickable, with both answers so a capture from an older helper is not read as a node that offers no long click.
|
The code change at d56b15a looks reasonable, but it has no live device evidence yet, so it needs one recorded run before merge. The PR changes the device-facing helper (a new XML attribute on every node) and the Android snapshot projection. The PR body has only three pasted node lines from an unnamed build, and its State section says the full check:affected, a helper-suite test and docs are not done. Nothing shows that the rebuilt helper serializes long-clickable on a device, that the default The four new keys are also written as explicit booleans on every node in the default projection, not only raw, at ui-hierarchy-builder.ts:481. Is that intended? Not blocking, and fine to take or leave: longClickable is a pure passive fact, so it fits in The failing check is |
What
Android snapshot nodes publish four accessibility facts next to
hittable:clickable,focusableandscrollable: the reader already parses these and drops them at the projection.longClickable: the snapshot helper now writeslong-clickable(a comment inAccessibilityTreeXml.javalisted it as declared residue of Android native-a11y → snapshot: conform to the acquire/present engine contracts (sibling of #1797) #1832), with both answers, so a capture from an older helper reports nothing instead offalse.Why
hittableis true for a node that is clickable, focusable or focused. That is the right question for driving a screen, and it hides a difference an accessibility check needs: a node a screen reader can land on but cannot activate is hittable, and so is one it can activate.My case is a suite that tests native controls hosted in a React Native app (Compose inside React Native views). It asserts things like "the node carrying the control's name is the clickable one" and "a control with a long-press menu offers a long click". Today those few assertions need
adb shell uiautomator dump, which cannot run while the helper session holds the accessibility connection, so they live in a separate pass after the suite.From a build of this branch, on an API 35 emulator (
snapshot --json --raw):The first line is the case
hittablecannot tell apart from a button.The part I am unsure about
snapshot-private-evidence.tssays clickability is deliberately kept outsideSnapshotNode, and two tests insnapshot-clickability.test.tsasserted thatclickablenever appears on a published node. This change reverses that, and I changed those two tests to match. If you would rather keep the default node as it is, I am happy to put these behind an opt-in capture option (the way--actionsworks), or publish them on--rawcaptures only. Tell me which you prefer.It also adds four booleans to every Android node in
--jsonoutput. The text snapshot is unchanged.State
pnpm lintandpnpm typecheckpass. Theplatform-androidand capture unit tests pass (1,548).check:affectedrun, a test in the helper's own suite for the new attribute, docs.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.