Rethinking bevy_a11y from the ground up
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
The current `bevy_a11y` crate uses `accesskit::Node` as a persistent data structure, when it is meant to be a wire format. This creates problems in Bevy because it makes composition hard. The issue #17644 (which was closed, although the problem was only partially solved) talks about this, but the actual problem goes deeper.
There is a natural division of labor when it comes to accessibility metadata: different development roles are responsible for different properties. The `label` property is often set by a different developer (often the app developer) than the `checked` or `role` property (which, in the case of a widget library, are typically set by the widget author). Adding a headless layer adds a third potential role.
Bevy's approach to composability, one which is particularly enshrined by BSN, involves merging trees of components and their properties. This is difficult to do with `accesskit::Node`, since all of the properties are in a single giant data structure with private fields, accessible only by methods.
The real bug, however, is that Bevy shouldn't be maintaining this data structure persistently at all; instead native ECS components like `Checked` should be the real source of truth, and the `accesskit::Node` structure should be a temporary, disposable structure used purely for communication between layers.
@alice-i-cecile @DataTriny
Contributor guide
Research direction
Start by reading the bevy_a11y crate and the discussion in issue #17644, then trace how accesskit::Node and native ECS components such as Checked are used. A complete change would need an agreed design for composable accessibility metadata and a clear boundary where a temporary Node is produced for communication.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- accessibility
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100