Repository navigation
Done
Description
Part of the Android series (#2484), on the host of #2689. Needs touch (#2649) for explore by touch.
Gap on dev (2f15e4a90)
- The
accessibilityfeature has adapters for Windows, macOS and Linux only (crates/rune/src/a11y/mod.rs:41-45), so on Android a screen reader sees one unnamed view.
Slice
RuneViewreturns anAccessibilityNodeProvider; its three calls and, with touch exploration on, the hover events go over JNI toaccesskit_android's low-levelAdapter, on the UI thread where the runtime lives. The existingAccessibilityLinkqueues activation and actions for the next frame.- The root node is the view itself, focusable for keys: TalkBack took it for one control and skipped every text. Its node is made passive, and each text leaf is screen-reader focusable (API 28+).
- Scroll pacing (a pure step, host-tested): at rest each frame's changes are sent; while a viewport scrolls, at most one sync per 100 ms, then at once on the frame it rests.
Checked (on the fork's host)
- Host: 5 pacing tests (rest, hold, a one-second fling at 120 Hz syncs about ten times, the resting frame, the wake).
- API 35 emulator, TalkBack 15.0, with real touchscreen events so they pass through TalkBack: explore by touch focuses the button or the label under the finger; swipe right walks label, button, switch, checkbox, segments in order; double-tap opens a dialog and focus moves into it.
uiautomator dumplists 149 nodes for the kit gallery with roles, names and checked states. - Xiaomi 14 (Android 16, 120 Hz), kit gallery scrolled for two minutes, three runs each way: 97.6 % of frames within one period with TalkBack off, 98.3 % on; TalkBack costs about a third more CPU (0.45 to 0.60 cores).
- Not checked: what TalkBack says (no audio capture), typing in a field with TalkBack, Switch Access, Voice Access.
Cost: accesskit_android 0.9.1 depends on jni 0.21 while the lock has 0.22, so a second jni enters Cargo.lock.
Reference: NeuralNomadsAI/rune@android/s5-services...android/s4-a11y (the fork's host predates #2689; a11y/android/throttle.rs and its tests are host-independent).
Questions
- Is the second
jniacceptable untilaccesskit_androidmoves to 0.22, or do you prefer a hand-written node mapping? - A scroll viewport's single content child is what TalkBack calls a list item, so its plain texts are read as one unless marked focusable. We marked every text leaf; would you rather decide it per role in the tree?
Metadata
Metadata
Assignees
Labels
No labels
Activity
opencodejr commentedon Nov 28, 2026
the native host from #2689 is on
dev(touch in #2649 is still waiting on design), andcrates/rune/src/a11y/mod.rs:41-46/crates/rune/Cargo.toml:120confirm android has noaccessibilityadapter yet. this raises two design calls before building:accesskit_android(withjni0.21 alongsidejni0.22) vs a hand-written mapping:PLAN.mdcommits to accesskit rather than custom per-os bridges, andCargo.lockalready carries a secondobjc2(0.5.3beside0.6) foraccesskit_macos.jni0.22 only enters viawinit->android-activity(platform/android/host.rsuses rawjni-sys), so a temporary android-onlyjni0.21 follows existing precedent and avoids maintaining a separateAccessibilityNodeInfo/ action / text-range bridge. keeping the passive-root and focusability adjustments on theRuneView/ adapter side also avoids adding another[patch.crates-io]vendor entry.a11y_repeats_control(crates/rune/src/a11y/tree.rs:574) already collapses text insideleaf_controlroles (Button,Switch,CheckBox,RadioButton,Tab,ListBoxOption,Link,MenuItem), but not insideListItem,Row,Article,Heading,Paragraph, or labelledGroup. marking everyLabelleafscreenReaderFocusablestops talkback from merging a scroll viewport's content into one announcement, at the cost of splitting multi-text rows/cards into separate swipes; a role-based rule (closer to chromium'sBrowserAccessibilityAndroid, grouping plain text insideListItem/Article/Heading/Paragraphwhile keeping standalone text leaves focusable) keeps composite items as one stop.the pure scroll-pacing step (throttled while scrolling, immediate on rest) fits cleanly alongside
RuntimeCore::scrolling(runtime/layout_read.rs:661) andweb_a11y_scroll_active(runtime/web/a11y.rs:1083).questions for maintainers:
accesskit_android(accepting a duplicate android-onlyjni0.21 inCargo.lockuntil upstream moves to 0.22), or a hand-written node mapping?screenReaderFocusable(api 28+), or decide it per role soListItem/Article/Heading/Paragraphkeep their plain text children grouped as one swipe stop?pascalandr commentedon Nov 28, 2026
accesskit_androidwith the secondjni: the fork's choice, no trouble met with it.ListItem,Article,HeadingandParagraphas one stop and standalone text focusable fixes the same thing without splitting rows.feat(android): add TalkBack accessibility via accesskit_android (#2697)
feat(android): add TalkBack accessibility via accesskit_android (#2697)
feat(android): add TalkBack accessibility via accesskit_android (#2697)
feat(android): add TalkBack accessibility via accesskit_android (#2697)…
Hona commentedon Nov 28, 2026
Implemented in #2713 (merged on
devasadb52ae84).Design decisions
accesskit_android0.9.1 (accepting the Android-onlyjni0.21 dependency alongsidejni0.22 until upstream updates) behind theaccessibilityfeature, bridgingRuneView'sAccessibilityNodeProvider(createAccessibilityNodeInfo,findFocus,performAction) and touch-exploration hover events (dispatchHoverEvent) on the UI thread viaAccessibilityLink, withQueuedEvents::raisestrictly after releasingHOSTborrows.HOST_VIEW_ID(-1) andonInitializeAccessibilityNodeInfostrip focusable/clickable/accessibility-focus actions and move any window title into API 28+paneTitle, andfindFocus(FOCUS_INPUT)returnsnullwhen keyboard focus rests on the rootWindow.screenReaderFocusable&isHeadinggrouping (API 28+):ListItem,Article,Heading, andParagraphkeep their plain text grouped as one swipe stop (withisHeading = trueonHeading), while standaloneLabelleaves (and standalone labelledImageleaves) outside grouping roles or leaf controls getscreenReaderFocusable = trueso TalkBack walks them individually inside scroll views.Rest/Cooldown/Holdingstate machine (a11y/android/throttle.rs) syncs immediately at rest, caps syncs to once per 100 ms whileRuntimeCore::a11y_scroll_active()is true, flushes immediately on the resting frame, and schedules a fencedAttemptwake when frames stop.What was verified vs not run on hardware
a11y::android(5 scroll-pacing tests including a 1 s 120 Hz fling + 5 per-role focusability andRuntime::accessibility_tree()tests), alla11y::(150 tests) andplatform::android::(40 tests) host suites, andcargo check -p rune --no-default-features.android(aarch64-linux-android,x86_64-linux-androidwithrune/accessibility, pluskotlinc/d8andandroid-helloAPK build),check, andsizeall passed.