Open jessegreenberg opened 3 years ago
Yes very nice thought! We do the same thing for sound:
I think my ideal strategy for this is on hold by https://github.com/phetsims/utterance-queue/issues/25. If that comes through, we could use UtteranceQueue.canAlertUtterance as the spot to check this.
https://github.com/phetsims/utterance-queue/issues/25 has been implemented. I'll add this now.
I wasn't able to complete this right now. Here is my current patch:
I see two paths forward, and I would like to ask @samreid's opinion about it before moving forward. The first is to embed iO state checking into UtteranceQueue, but this seems a bit heavy-handed:
The next is to have Sim.js do the work. That way we are keeping iO specific code out of the library (since it isn't needed anyways).
@samreid, two questions for you:
After discussing with @samreid on a call, we decided that the above commit made sense. There is already precedent for this with how sounds are handled. There was still an important design decision to discuss though, about what the behavior should be for these announced features. If a PhET-iO client sets a state on a sim, should the description or voicing detail that? Should it say what has happened in that case? Something like "state has been set." Or maybe we actually want it to restate the new state of the sim, however that may look.
Marking for design discussion to see if we want any response announcements to come through while setting state.
Now is the time!
We discussed this during PhET-iO meeting today.
We decided to treat this like a reset all button description. We want to add an option to opt out of this so that we can have silent state setting, like on startup.
Here were discussed what the utterance text should be:
Sim changed, everything reset
sim updated, the configuration has changed
sim updated,
Sim coniguration changed
The state of the sim has changed
Sim state changed, explore to discover more
Sim State change detected, the configuration may have changed
Sim state has been changed
Sim state may have changed
"We will go with Sim state changed, explore to discover more." for now.
We don't want to include the option of sound in this because we fear that it will be too intrusive in most cases. That said, we discussed super granular options like:
setState( state, {
voicingText: 'reset',
descriptionText: 'other reset',
includeSound: true
This came from https://github.com/phetsims/balloons-and-static-electricity/issues/521, where it was suggested that we should prevent alerts from coming out of the sim while the sim changes during a phet-io state set.
This is in the "phet-io + a11y" overlap category and likely needs a decision before greenhouse-effect is published with PhET-iO + Interactive Description.