From 4216c08c85476558f008ca858f12444ad1726cd7 Mon Sep 17 00:00:00 2001 From: Alice Fisher Date: Tue, 10 Feb 2026 17:52:08 +0000 Subject: [PATCH 01/11] only switch fish sets if not already showing --- package.json | 2 +- src/oceans/components/common/Guide.jsx | 26 ++-------- src/oceans/components/scenes/pond/index.jsx | 13 +++-- src/oceans/styles/index.js | 3 -- webpack.config.js | 1 + yarn.lock | 57 +++++++-------------- 6 files changed, 35 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 20cd1ccc..ab030ece 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "@fortawesome/fontawesome-svg-core": "^1.2.25", "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.7", - "messageformat": "^1.1.0", + "messageformat": "2.3.0", "react-typist": "^2.0.5" }, "files": [ diff --git a/src/oceans/components/common/Guide.jsx b/src/oceans/components/common/Guide.jsx index cc1f342c..7b98f3b9 100644 --- a/src/oceans/components/common/Guide.jsx +++ b/src/oceans/components/common/Guide.jsx @@ -1,6 +1,5 @@ import React from 'react'; import Radium from 'radium'; -import Typist from 'react-typist'; import '@ml/oceans/styles/fade.css'; @@ -144,17 +143,9 @@ let UnwrappedGuide = class Guide extends React.Component { } } - // Start playing the typing sounds. - if ( - !state.textToSpeechLocale && - !state.guideShowing && - !state.guideTypingTimer && - currentGuide - ) { - const guideTypingTimer = setInterval(() => { - soundLibrary.playSound('no', 0.5); - }, 1000 / 10); - setState({guideTypingTimer}, {skipCallback: true}); + // Skip typing animation - show text immediately + if (!state.guideShowing && currentGuide) { + setState({guideShowing: true}, {skipCallback: true}); } if (this.attemptTextToSpeechTextToSpeech(false)) { @@ -211,16 +202,9 @@ let UnwrappedGuide = class Guide extends React.Component {
{currentGuide.textFn(getState())}
- {/* Visible Typist animation for sighted users */} + {/* Visible guide text (no typing animation) */}
{ + getMatchingFishSet = (e, showMatching) => { const state = getState(); // No-op if transition is already in progress. @@ -46,6 +46,13 @@ let UnwrappedPond = class Pond extends React.Component { return; } + // No-op if already showing the desired fish set (matching or non-matching). + // Note that recallFish are fish that are not matching the word/attribute. + // pondFish are fish that are matching the word/attribute. + if (state.showRecallFish !== showMatching) { + return; + } + let currentFishSet, nextFishSet; if (state.showRecallFish) { currentFishSet = state.recallFish; @@ -194,7 +201,7 @@ let UnwrappedPond = class Pond extends React.Component {