Skip to content

fix(a11y): emit level set size on levelled items and read item size_of_set in Windows and Linux adapters - #1819

Merged
Hona merged 1 commit into
devfrom
fix/533-item-set-size
Nov 24, 2026
Merged

Hona merged 1 commit into
devfrom
fix/533-item-set-size

Conversation

@Hona

@Hona Hona commented Nov 24, 2026

Copy link
Copy Markdown
Member

Fixes #533

Root cause

  • In a flat tree where items carry both El::level and El::position_in_set(pos, size), crates/rune/src/a11y/tree.rs wrote only the shallowest level's size_of_set onto the container and never set size_of_set on the levelled item nodes.
  • accesskit_windows (src/node.rs) and accesskit_atspi_common (src/node.rs) read size_of_set solely via size_of_set_from_container(&filter), so level-2 items like cherry (3 of 3) under a level-1 tree of size 2 were reported as "3 of 2".
  • Synthesizing unlabelled Role::Group wrappers by level cannot hide them from navigation because common_filter gates both size_of_set_from_container and platform navigation visibility on Windows UIA, macOS VoiceOver, and Linux AT-SPI.

Changes

  • crates/rune/src/a11y/tree.rs: emit node.set_size_of_set(size) directly on ordered-set items in a11y_build when both El::level and explicit El::position_in_set(pos, size) are set (keeping the shallowest level's size_of_set on the container, leaving unlevelled lists and trees without explicit position_in_set byte-for-byte unchanged, and mixing the condition into the item's fingerprint in a11y_walk).
  • vendor/accesskit_windows/src/node.rs & vendor/accesskit_windows.patch: read self.node.size_of_set() on item roles (is_item_like() || role == Role::Row) before falling back to size_of_set_from_container(&filter), so containers never report their children's count as their own sibling set size.
  • vendor/accesskit_atspi_common, vendor/accesskit_atspi_common.patch, scripts/vendor-accesskit-atspi-common.sh, Cargo.toml, Cargo.lock, README.md, crates/rune/README.md, AGENTS.md, ARCHITECTURE.md: vendor accesskit_atspi_common 0.21.1 with the same item-first size_of_set lookup for Linux AT-SPI. Apps that omit the new [patch.crates-io] entry still compile and run against crates.io accesskit_atspi_common.
  • crates/rune/src/a11y/tree_tests.rs, vendor/accesskit_windows/src/node.rs, vendor/accesskit_atspi_common/src/node.rs: regression tests for flat-tree per-level size_of_set, container non-leakage (Tree, ListBox, TreeGrid, Group), container fallback, and incremental updates.
  • Reported upstream: Allow item-level size_of_set to override container size_of_set for flat trees AccessKit/accesskit#875
// vendor/accesskit_windows/src/node.rs (and vendor/accesskit_atspi_common/src/node.rs)
(self.node.is_item_like() || self.node.role() == Role::Row)
    .then(|| self.node.size_of_set())
    .flatten()
    .or_else(|| self.node.size_of_set_from_container(&filter))

Verification

  • Windows: cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid a11y (90 passed in rune, 2 in rune-kit lib), cargo test -p rune-kit --features rune-kit/markdown,rune-kit/mermaid --test a11y (26 passed; all goldens unchanged), and headless unit tests in both vendor/accesskit_windows and vendor/accesskit_atspi_common (both passed).
  • Linux (aarch64): cargo check -p rune -p rune-kit --tests passed against vendored vendor/accesskit_atspi_common.
  • Re-ran scripts/vendor-accesskit-windows.sh 0.35.2, scripts/vendor-accesskit-atspi-common.sh 0.21.1, and scripts/file-size.sh (0 errors).
  • Not checked: live screen-reader speech output (Narrator, NVDA, JAWS, Orca, VoiceOver); macOS accesskit_macos does not expose set size or position yet.

@Hona
Hona merged commit 8a54a0a into dev Nov 24, 2026
1 check passed
@Hona
Hona deleted the fix/533-item-set-size branch November 24, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virtual lists and grids: a heading row counts as an item, an item's set size replaces its row's, and no row or column index

1 participant