Skip to content

feat(android): estimate the TalkBack swipe order in audit - #5025

Merged
thymikee merged 2 commits into
mainfrom
t3/android-screen-reader-order
Nov 24, 2026
Merged

thymikee merged 2 commits into
mainfrom
t3/android-screen-reader-order

Conversation

@thymikee

@thymikee thymikee commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

audit on Android now reports screenReaderOrder: the refs a TalkBack swipe is estimated to visit, per app window, labeled as an estimate. It comes from a TypeScript port of TalkBack 16.2's traversal and focus rules (Apache-2.0, attributed in LICENSES/talkback.txt and the bundled notices), run on one helper capture.

  • The helper adds node ids, traversal links, and focus-rule facts. Older helpers report no order.
  • The estimate drops not-important views, which UiAutomation captures and TalkBack never sees.
  • Audit computes the estimate on first read. Android helper captures retain the input facts.
  • Order refs are issued like finding refs (ADR 0014 amended).
  • iOS reports no order.

Before / after

agent-device audit on Clock (World Clock tab), emulator API 37:

Before: No findings — current screen

After:

Estimated TalkBack order: @e11~s849093 @e13~s849093 @e19~s849093 … @e37~s849093
Limitation: The screen-reader order is estimated from TalkBack 16.2's rules, not observed. …

The refs match the order TalkBack 17 recorded on this screen.

Validation

At 595590fb93, rebased onto main (ecb2089867):

  • Affected validation, production exports, and eager-closure tests pass. GitHub reruns coverage and device lanes.
  • TalkBack ordering loads on first audit read.
  • Four fixtures record TalkBack 17 swipes. One known miss is a disabled Compose button.
  • At feebc2faed, emulator API 37 with helper 0.21.43-dev and android-helper produced the output above.

Risks: no auto-scroll, cross-window order, or WebView; pinned to TalkBack 16.2.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.56 MB 6.57 MB +11.1 kB
Package (unpacked) 6.56 MB 6.57 MB +11.1 kB
Package (download) 2.00 MB 2.00 MB +5.5 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 32.4 ms 32.7 ms +0.3 ms
CLI --help 57.7 ms 62.6 ms +4.9 ms

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The code in feebc2f is ready: the review found no blocking problems. Repo Guards & Compatibility fails because the fallow production-exports gate flags the new re-export of readSnapshotScreenReaderOrderEvidence in capture.ts:98, which only tests import. Dropping that re-export, so every facade export has a production importer, should clear it. The Coverage job also fails, but its log excerpt ends inside passing test output, so the cause is not clear; please check that it goes green or find its cause. No conflicts. Before merge, fix the production-exports gate and get Coverage green or explained.

Not blocking, take or leave: (1) with this change almost every Android audit returns order refs, so a plain ref from an earlier snapshot -i can now fail with plain_ref_requires_complete_frame, which is a behavior change worth naming in the PR body, or the order could be printed without issuing refs; (2) the lazy closure in snapshot.ts:193 retains the full parsed tree on the session until audit reads it, so computing eagerly on the audit capture only would avoid that; (3) snapshot-audit.ts:166 hardcodes the talkback-16.2 identity and limitation text that the Android producer could own; (4) the limitation text in commands.md:877 could also name disabled controls and newer TalkBack versions, since the fixture already records that divergence; (5) screen-reader-order.ts is 780 production lines, and dropping the lazy closure API and moving estimator metadata to the producer would shrink it.

Not verified here: the fixture comparison tests, a fresh TalkBack recording on a device, a line-by-line diff of the port against TalkBack 16.2, and the memory the lazy closure retains on large trees. Accuracy rests on the four committed TalkBack 17 recordings and the author's emulator run.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
thymikee and others added 2 commits November 23, 2026 20:18
audit now reports screenReaderOrder on Android: the refs a TalkBack swipe is
estimated to visit, per app window, computed from one helper capture with a
TypeScript port of TalkBack 16.2's traversal and focus rules (Apache-2.0,
attributed in LICENSES/talkback.txt and the bundled notices).

The snapshot helper now writes the facts those rules read: a capture-wide node
id, traversal links, screen-reader focusable, importance, the focus action,
state description, collection and range info. The estimate drops nodes that
are not important for accessibility, which UiAutomation captures include and
TalkBack never receives. A capture from an older helper reports no order.

Fixtures are real emulator captures with the order TalkBack 17 visited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the t3/android-screen-reader-order branch from feebc2f to 595590f Compare November 23, 2026 19:34
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 595590f

Since the review of feebc2f: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' prompt (4 files)
  • packages/platform-android/src/fixtures/talkback/compose-clock.xml: its very long or mostly numeric lines were cut; reviewers could still search them
  • packages/platform-android/src/fixtures/talkback/compose-dev-launcher.xml: its very long or mostly numeric lines were cut; reviewers could still search them
  • packages/platform-android/src/fixtures/talkback/permission-dialog.xml: its very long or mostly numeric lines were cut; reviewers could still search them
  • packages/platform-android/src/fixtures/talkback/react-native-form.xml: left out as an asset or for its size; reviewers could still search it

4 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (ecb2089867e9).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at 595590f. The earlier blockers (the production-exports gate and Coverage) are fixed, and all required checks now pass, including Repo Guards & Compatibility, Coverage and a re-run of Body rules. No conflicts. Not blocking, take or leave: snapshot-audit.ts imports readSnapshotClickabilityEvidence statically from @agent-device/contracts/snapshot-private-evidence but loads its sibling readSnapshotScreenReaderOrderEvidence dynamically from the capture facade, so the dynamic import defers nothing. Importing both statically from snapshot-private-evidence would be simpler, and the facade re-export could go if nothing else in production uses it. Not verified here: the dynamic estimator load on a device audit at 595590f, since the emulator evidence is from feebc2f and this change only touches module loading, which the snapshotAndroid route test covers; and whether the fallow config counts a dynamic import as a production importer by design, which is only inferred from the green Repo Guards job.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee
thymikee merged commit 22bb75b into main Nov 24, 2026
26 of 27 checks passed
@thymikee
thymikee deleted the t3/android-screen-reader-order branch November 24, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant