Open pixelzoom opened 1 month ago
Also for consideration...
Until support is implemented, exclude accessibleName
and helpText
options -- via the TypeScript Options types and/or via assertions.
All common-code components that have ParallelDOM as an ancestor currently include accessibleName
and helpText
as part of their API. This includes all scenery Nodes, and all common-code UI components. A small subset of these actually do anything with accessibleName
and helpText
, and the reset siliently ignore them. This makes it difficult to identify where accessibleName
and helpText
are actually supported, and where it still needs to be built out.
Just adding a comment that it would be wonderful to have any default descriptions percolate to our live demos of sim components. I was talking to @jessegreenberg about this.
Related to https://github.com/phetsims/special-ops/issues/269 ...
This issue is relevant for sun, scenery-phet, and any other common-code UI components.
I discussed with @jessegreenberg, and ParallelDOM has two categories of API: low-level and high-level. From ParallelDOM.ts (where they are for some reason called "functions" when they are in fact options):
The intention/goal is that sim-specific code should be using the high-level API, while common-code UI components should provide the high-level API and convert that to the low-level API. But in practice:
Towards the goal of making accessible names and help text part of the standard feature set, PhET will likely want to start by building out support for
accessibleName
andhelpText
. (Other description-related options should be kept in mind, but may be prioritized differently.) Related work includes:accessibleName
andhelpText
options in common-code UI components.innerContent
should not be settable by sublcasses of ButtonNode, because it is responsible for propagatingaccessibleName
to the appropriate low-level options.accessibleName
andhelpText
. For example, instead of every sim addingaccessibleName: 'Erase'
to EraseButton, that should be the default, which can be overridden if needed.I will create GitHub issues for specific examples that were encountered while adding accessible name and help text to MOTHA for https://github.com/phetsims/models-of-the-hydrogen-atom/issues/67. Those issues will be linked to this issue, but should not be considered a complete list of what needs to be built out.