Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Replace VoicingManager.speakIgnoringEnabled with a Property controlling speech

Aperta
#69 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

dev:voicing

It is confusing that the voicingManager.enabledProperty can have a value of false but there can still be speech with speakIgnoringEnabled. A better way would be to provide a separate Property to control speech output while making it so that whenever voicingManager.enabledProperty is false there can be no speech. Here is some scratch illustrating the change we are thinking of.

Index: joist/js/audioManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/joist/js/audioManager.js b/joist/js/audioManager.js
--- a/joist/js/audioManager.js	(revision ddcffa71993bd7e06725b30f5a394124e7cff693)
+++ b/joist/js/audioManager.js	(date 1634927385639)
@@ -135,6 +135,7 @@
           sim.isConstructionCompleteProperty,
           sim.browserTabVisibleProperty,
           sim.activeProperty,
+          this.simVoicingEnabledProperty, // passed to the PreferenceDialog, field on AudioManager
           sim.isSettingPhetioStateProperty,
           this.audioEnabledProperty
         ], ( simConstructionComplete, simVisible, simActive, simSettingPhetioState, audioEnabled ) => {
Index: scenery/js/accessibility/voicing/voicingManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scenery/js/accessibility/voicing/voicingManager.js b/scenery/js/accessibility/voicing/voicingManager.js
--- a/scenery/js/accessibility/voicing/voicingManager.js	(revision 414d8cf0bf3cdabc1a9c8e6eb6b7e091ae8369cf)
+++ b/scenery/js/accessibility/voicing/voicingManager.js	(date 1634927277241)
@@ -382,8 +382,8 @@
    *
    * @param {Utterance} utterance
    */
-  speakIgnoringEnabled( utterance ) {
-    if ( this.initialized ) {
+  speakIgnoringSpeechAllowed( utterance ) {
+    if ( this.initialized && this.enabledProperty.value ) {
       this.requestSpeech( utterance );
     }
   }

Likely related to https://github.com/phetsims/joist/issues/743 because that will determine where simVoicingEnabledProperty should live. COuld be on the AudioManager, but maybe it should be on a "PreferencesModel", whatever that ends up looking like.

Lingua principale
TypeScript
Stelle
1
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di phetsims/utterance-queue

Tutte le issue di phetsims/utterance-queue

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.