phetsims / friction

"Friction" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/friction
GNU General Public License v3.0
4 stars 6 forks source link

Use Utterance.predicate() to make sure that alerts aren't spoken when stale #255

Closed zepumph closed 2 years ago

zepumph commented 2 years ago

Utterance.predicate can be really useful in terms of making sure that utterances added to the queue, and then wait for quite some time before being announced, are still useful and not just stale information.

I could see us using this for "super fast, super hot" alerts over in https://github.com/phetsims/friction/issues/253, and also for the cooling alerts, since they respond to the model, and not to interaction. We don't want someone's attention to be somewhere else once cooled and still hear those.

This is coming from https://github.com/phetsims/joist/issues/752

zepumph commented 2 years ago

The warming alerts' predicate was added over in https://github.com/phetsims/friction/issues/253. This commit for the cooler alert isn't too important, but it is good to make sure this logic is correct for consistency. Closing