From a6352ec6240abfe7bfb975ef5c28ab5cb805e837 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Thu, 4 Dec 2025 13:31:20 -0600 Subject: [PATCH] fix(know-your-world): fix hot/cold visual feedback delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove early return that was blocking visual feedback when speech was active. Previously, `if (isSpeaking || externalSpeaking) return` blocked BOTH visual AND audio feedback. Now visual feedback (spinning crosshair) updates immediately while audio feedback is still properly gated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../know-your-world/hooks/useHotColdFeedback.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web/src/arcade-games/know-your-world/hooks/useHotColdFeedback.ts b/apps/web/src/arcade-games/know-your-world/hooks/useHotColdFeedback.ts index 02c759d4..9e026279 100644 --- a/apps/web/src/arcade-games/know-your-world/hooks/useHotColdFeedback.ts +++ b/apps/web/src/arcade-games/know-your-world/hooks/useHotColdFeedback.ts @@ -9,10 +9,10 @@ * - Multi-layer anti-spam (cooldowns, confidence gating) */ -import { useCallback, useEffect, useRef, useState } from 'react' import { useLocale } from 'next-intl' -import { speakText, getLanguageForRegion, shouldShowAccentOption } from '../utils/speechSynthesis' -import { getRandomPhrase, type FeedbackType } from '../utils/hotColdPhrases' +import { useCallback, useEffect, useRef, useState } from 'react' +import { type FeedbackType, getRandomPhrase } from '../utils/hotColdPhrases' +import { getLanguageForRegion, shouldShowAccentOption, speakText } from '../utils/speechSynthesis' import { useAvailableVoices } from './useSpeakHint' // Map app locales to BCP 47 language tags for speech synthesis @@ -357,7 +357,8 @@ export function useHotColdFeedback({ const checkPosition = useCallback( ({ cursorPosition, targetCenter, hoveredRegionId, cursorSvgPosition }: CheckPositionParams) => { if (!enabled || !targetCenter || !targetRegionId) return - if (isSpeaking || externalSpeaking) return + // Note: We no longer block visual feedback when speaking - only audio gates should prevent speech + // The old code had `if (isSpeaking || externalSpeaking) return` here which blocked BOTH visual and audio const now = performance.now() const state = stateRef.current