Interfaces
An interface is a tree: each node has a role, a name, a value, states and the actions it offers. You describe the tree in code; the framework draws it, gives it to screen readers, and gives it to agents.
One semantic tree, many renderings: pixels, accessibility, agents and tests are views of the same tree.
Three ways to write it
In TypeScript, the default:
In C++, for what must be fast:
As a view document, for interfaces a tool generates:
What an agent reads of all three is the same tree:
Identity
A node an agent or a test must find has an explicit id, and the id never depends on the text shown: undo stays undo when the label is translated.