-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ABSwitch: support for accessibleName
and helpText
#880
Comments
Note that this issue blocks phetsims/models-of-the-hydrogen-atom#67. |
Support for In phetsims/scenery#1666, I also tried out a way to omit
I am not sure what the plan is for binder, and I think we should wait on these until that is decided. @pixelzoom can you please review? |
Implementation looks good. And it seems to be working in MOTHA, but that probably needs a designer to sign off. I'll comment about - export type ABSwitchOptions = TrimmedParallelDOMOptions<SelfOptions & HBoxOptions>;
+ export type ABSwitchOptions = SelfOptions & TrimmedParallelDOMOptions<HBoxOptions>; ... because HBoxOptions is where ParallelDOMOptions is coming from. Back to @jessegreenberg. |
You are right, thanks! I fixed that. OK, Ill review this with design before closing. |
I reviewed this with @terracoda. The behavior of accessibleName and helpText is correct. However, the accessible name + For example, in this ABSwitch: The user will hear "Experiment or model, not checked" - that does not convey the state. |
I suspect that this is blocking for MOTHA, so I've created a GitHub issue in that repo: phetsims/models-of-the-hydrogen-atom#74 |
This is an idea.
Focus moves to AB Switch with B selected, we hear:
Focus moves to AB Switch with A selected, we hear:
Space and Enter - toggle the position of the switch A context response could announce additional changes or used to scaffold/confirm the change in the mode. |
Second idea - H3 + dynamic button name + static help text + (optional confirmatory context response). This design might be somewhat like a radio group / radio button experience, but without the associated structures of a radio button group that make the screen reader experience very chatty. Screen readers say things like "selected, Model Mode, 1 of 2, Exploration Mode, group". H3: Exploration Mode
My understanding is that a confirmatory Context Responses is simple to implement, BUT, in this case, the response repeats what is already available in the help text. We could leave the spoken confirmation off and rely solely on the UI-sound to confirm a successful switch in the mode. |
Discussed with @terracoda. We are going to use the design in #880 (comment). So it will need options for the name for valueA and the name for valueB. The actual accessible name will be set based on the state of the switch, with a string pattern:
The aria attributes set by ToggleSwitch should be removed for ABSwitch. So we will either need to make them optional or move them somewhere else. The context responses are not part of "Accessible Names and Help Text", but they would be added with options like this:
|
This was implemented in phetsims/sun@f9f6b98. I removed the accessibleName from the ABSwitch used in MOTHA. Providing This design for ABSwitch removes the aria attributes that are usually added to ToggleSwitch, so I made them optional in phetsims/sun@bf64f68. @pixelzoom would you mind reviewing these changes? |
Code changes and API look good to me. Since @terracoda identified several design options, I think we should have her review, to verify that the implementation meets her design expectations. MOTHA may be the only sim using this feature, so feel free to review in the context of that sim. @terracoda If the current behavior looks correct, feel free to close this issue. If there are still problems, please discuss with @jessegreenberg. |
I tested MacOS 14.5 Sonoma with VoiceOver, and I think the AB Switch works great. Sounds good in Chrome, too. Tested with Version 129.0.6668.90 (Official Build) (arm64). I would love a dev version to try it out with a screen reader user. I'll ask on slack. |
Related to phetsims/models-of-the-hydrogen-atom#67 and phetsims/sun#901 ...
ABSwitch does not currently support
accessibleName
andhelpText
. Values that are provided are silently ignored.@terracoda noted that there has been work done on OnOffSwitch, but not on ABSwitch. Since OnOffSwitch extends ABSwitch, whoever does this work should review OnOffSwitch for things that may belong in the base class ABSwitch.
Binder documentation should be provided in ABSwitch.md. The documentation should be clear about the low-level internals of the component and the high-level API intended to be used in sim-specific code. Provide programming examples of how to use in sim-specific code.
The text was updated successfully, but these errors were encountered: