Skip to main content

Crate uxtree

Crate uxtree 

Source
Expand description

§UxTree

Portable a11y / automation tree for the mere browser.

Projects mere’s portable structural elements (inker::EngineDocument and platen workbenches) into a tree of AccessKit Nodes with stable, deterministic NodeIds. The same projection feeds screen-reader a11y, automation tooling, and inspector overlays.

§Stable identifiers

Every projected node gets an accesskit::NodeId derived from a domain path. The same document always projects to the same IDs — automation and tests can pin to a specific node without relying on bounds or render order. See node_id_for_path.

§What this crate does NOT own

  • Bounds: gpui (or whichever host) fills Node::set_bounds after layout; the projection here is structural only.
  • Event synthesis: the host owns input. Automation tools build on top of this tree but route events through host-specific paths.
  • Host coupling: this crate depends on accesskit and inker, nothing else. No gpui types here.

Structs§

UxTree
A built tree of AccessKit nodes — the result of projecting a portable mere structural element into AccessKit’s data model.

Constants§

STAGE
Lifecycle stage marker.
VERSION
Crate version.

Functions§

node_id_for_path
Hash a domain path to a stable NodeId. The same path always produces the same id — automation and snapshot tests can pin against it across runs.
project_document
Project an EngineDocument into an UxTree rooted at a Role::Document node. Children come from the document’s blocks; inline spans are flattened into the parent block’s accessible name today (with Role::Link children as the one exception, since links are interactive and need addressable identity).
stitch
Stitch a set of subtrees under a new root. The host typically calls this once per frame to merge mere-domain projections (workbench, orrery, gloss, apparatus, …) into a single application-root tree for accesskit consumption.