phetsims / greenhouse-effect

"Greenhouse Effect" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 4 forks source link

Add context response when switching between Experiment Mode radio buttons #395

Closed arouinfar closed 2 months ago

arouinfar commented 2 months ago

The Greenhouse Gas Concentration can be controlled in two ways, determined by the state of the Experiment Mode RadioButtonGroup -- by a slider (By Concentration) for a set of radio buttons (By Time Period).

image image

By design, the Experiment Mode RadioButtonGroup comes after the Greenhouse Gas concentration slider, as we want users to first experiment in 'By Concentration' mode. This creates an awkward experience for screen reader users, as they must go backward to get to the newly revealed control. This is not intuitive.

We decided to add a new context response to inform users of the new UI control and where to find it:

{{Greenhouse Gas Concentration slider}} replaced with {{Time Period radio button group}}.

The statement would be reversed when the state changes in the opposite direction.

Over to @jbphet to implement.

jbphet commented 2 months ago

I've added this. As I was doing it I asked @arouinfar over Slack whether the new context responses should come out before or after the existing ones, and she said before, so that's what I've done. I'm a little surprised by this decision, since I would think we'd want to say what changed about the sim first, and then say (essentially), "Oh by the way, something changed about the UI that you might want to know about", but I'm okay with it either way.

Here is a screenshot of the output in the a11y view after switching from BY_VALUE mode to BY_DATE mode and then back to BY_VALUE mode. Recall that the notifications are in reverse chronological order, i.e. most recent at the top.

image

Assigning to @arouinfar for review.

arouinfar commented 2 months ago

Thanks @jbphet. I reviewed on main and the changes look good.

I'm a little surprised by this decision, since I would think we'd want to say what changed about the sim first, and then say (essentially), "Oh by the way, something changed about the UI that you might want to know about", but I'm okay with it either way.

The reason I prefer to begin with the change in UI is that there is a whole chain of responsive descriptions that will get triggered. It's not just that the "Time period is the year seventeen fifty" or "Now moderate levels of greenhouse gases." There will be downstream effects to the surface temperature, for example: image

This way, the responsive descriptions related to the ongoing changes in the model are grouped together.