phetsims / utterance-queue

Alerting library powered by aria-live
MIT License
0 stars 2 forks source link

Should the Announcer and UtteranceQueue both have an enabledProperty? #62

Open jessegreenberg opened 2 years ago

jessegreenberg commented 2 years ago

In https://github.com/phetsims/utterance-queue/issues/58 @zepumph said

Basically here are the control Properties that we have to keep track of: UtteranceQueue.muted UtteranceQueue.enabledProperty SpeechSynthesisAnnouncer.enabledProperty SpeechSynthesisAnnouncer.canSpeakProperty With joist (thus our sims) kinda taking its pick as to what to set during different things, it is really hard for me to see the full picture, and thus what could be the best and simplest implementation. It is a work in progress, and one that relates to our conversation from a Friday past about creating a preferences model. Do you feel this tension, or am I overreacting? (those are your only two options. . . . )

I said

I did not feel the tension but see it now that you mention it. I don't think this relates to to canSpeakProperty (A private DerivedProperty) but I see it as confusing that we have an enabledProperty on both the UtteranceQueue and the Announcer. I could see us making the enabledProperty of the Announcer utterance-queueu internal.

It seems to me that all should go through the utteranceQueue. If the Announcer is disabled, that should be utterance-queue internal.

zepumph commented 2 years ago

@jessegreenberg and I discussed this today. We can see a world where SpeechSynthesisAnnouncer's enabled Property doesn't control voicing, but a separate Joist Property does (like for the toolbar). Then most everything can be controlled by the utterance queue. And perhaps the canSpeakProperty can just change the announcer's enabled.

We don't want to work on this though until we do https://github.com/phetsims/scenery/issues/1343. On hold.