Skip to content

feat(a11y): per-window tree and action hooks, for code that has a window's id but not its View - #17

Merged
adammharris merged 1 commit into
leaffrom
a11y-text-hooks
Oct 23, 2026
Merged

adammharris merged 1 commit into
leaffrom
a11y-text-hooks

Conversation

@adammharris

@adammharris adammharris commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

A component inside a document that dioxus-native's launcher runs knows its window's id, but never holds the window's View, so it cannot call View::set_accessibility_tree_hook. Diaryx's editor is such a component: it draws its own text area, and needs to put that text area's text, runs and selection into the tree, and to carry out what assistive tech asks of it (set the value, move the selection).

  • set_accessibility_hooks(window, tree, action) sets, for one window, a tree hook (run after the View's own on each tree built) and an action hook (offered each action request before Blitz carries it out; it returns whether it did). clear_accessibility_hooks(window) removes them.
  • The hooks live in a thread-local map keyed by WindowId, on the event loop's thread. A hook runs with the map free, so it may set or clear hooks.
  • The window's AccessibilityState clears its hooks when it drops.

Checked locally: cargo test -p blitz-shell --features accessibility --lib (2 new tests), cargo fmt --all --check, clippy on blitz-shell with its tests (no warnings in blitz-shell; two old upstream lints in blitz-dom and blitz-paint show only with these narrow features, and the workspace build does not hit them), cargo doc -p blitz-shell.

@adammharris
adammharris merged commit fb80cf9 into leaf Oct 23, 2026
14 checks passed
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.

1 participant