diff --git a/src/components/PhraseTrainer.tsx b/src/components/PhraseTrainer.tsx index 5d2eee1..b3c958f 100644 --- a/src/components/PhraseTrainer.tsx +++ b/src/components/PhraseTrainer.tsx @@ -35,7 +35,7 @@ import { TUNINGS, getFretboardPositions } from '../music/Tunings'; import { INSTRUMENT_DEFINITIONS, resolveClefTranspose } from '../music/InstrumentConfigs'; const AUTO_CONTINUE_DELAY_MS = 1500; -import { Play, Pause, RotateCcw, SkipForward, SkipBack, Volume2, Square, ChevronDown, Music2, Upload, HelpCircle, Guitar } from 'lucide-react'; +import { Play, Pause, RotateCcw, SkipForward, SkipBack, Volume2, ChevronDown, Music2, Upload, HelpCircle, Guitar } from 'lucide-react'; export interface PhraseHandle { pauseToggle: () => void; @@ -341,7 +341,9 @@ export const PhraseTrainer = forwardRef( const events = scoreEvents(activeScore); // While previewing, the hint instruments follow the preview cursor so // the user can find notes on the fretboard while listening. - const displayIdx = trainer.phase === 'preview' ? trainer.previewIdx : trainer.currentIdx; + const displayIdx = trainer.phase === 'preview' || trainer.phase === 'previewPaused' + ? trainer.previewIdx + : trainer.currentIdx; const currentMidi = displayIdx >= 0 && events[displayIdx]?.pitch ? events[displayIdx]!.pitch!.midi : null; @@ -373,7 +375,8 @@ export const PhraseTrainer = forwardRef( const statusText = useMemo(() => { if (!scoreOk) return materialError ?? 'No material.'; const p = trainer.phase; - if (p === 'preview') return 'Listen …'; + if (p === 'preview') return 'Listen … (pause to step note by note)'; + if (p === 'previewPaused') return 'Paused — step with ⏮ ⏭ or ← →, resume with P'; if (p === 'countIn') return `Count-in: ${trainer.countInLeft}`; if (p === 'paused') return 'Paused'; if (p === 'done') { @@ -392,12 +395,13 @@ export const PhraseTrainer = forwardRef( const p = trainer.phase; if (p === 'playing' || p === 'countIn') return 'Pause'; if (p === 'paused') return 'Resume'; - if (p === 'preview') return 'Stop preview'; + if (p === 'preview') return 'Pause'; + if (p === 'previewPaused') return 'Resume'; return 'Start'; }, [trainer.phase]); const startAction = useMemo(() => { - if (trainer.phase === 'preview') return trainer.previewToggle; + if (trainer.phase === 'preview' || trainer.phase === 'previewPaused') return trainer.previewToggle; return trainer.pauseToggle; }, [trainer]); @@ -719,7 +723,7 @@ export const PhraseTrainer = forwardRef( {scoreOk ? ( ( {!settings.zenMode && ( <> - {trainer.phase === 'preview' && ( + {trainer.phase === 'previewPaused' && (
)}