Field of View: address PR review feedback#19
Field of View: address PR review feedback#19acrosman merged 3 commits intofeature/field-of-view-gamefrom
Conversation
…labels, audio context, game logic validation Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com> Agent-Logs-Url: https://github.com/acrosman/BrainSpeedExercises/sessions/550ed7f7-9f1e-42b0-91bb-31cec38618ae
|
@copilot The adjustment made to hide the kitten buttons is wrong. You were instructed to ignore that feedback because it causes the game play area to move when the buttons appear and disappear. Revert this behavior so the buttons always show. The game play area should not move unless the window is being resized. |
… shifts Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com> Agent-Logs-Url: https://github.com/acrosman/BrainSpeedExercises/sessions/adc8dc8c-bc12-402a-bdd6-6c45bc00a4a5
Fixed in commit c97d669. The kitten response buttons ( |
Applies all actionable feedback from the Field of View game PR review. Image compression is excluded (handled separately).
Bug fixes
stop()no longer callssaveProgress()whentrialsCompleted === 0, preventing phantom session increments and stalelastPlayedtimestamps on idle stopsinitGame()replaces the=== 3literal withNumber.isFinite+Math.round+Math.max(1, …)validation fordownAfterSuccesses, and appliesclamp()-based validation tostepUpMs/stepDownMsModule split (
index.js831 → ~593 lines)Extracted three focused modules from the monolithic controller:
audio.js— sharedAudioContextlifecycle;getAudioContext()creates once,playFeedbackSound()resumes a suspended context instead of constructing a newAudioContextper trialrender.js— pure rendering utilities (percent,formatMs,labelForIcon,createStimulusImage,buildTrendPolylinePoints, stat/chart/selection helpers)progress.js— IPC-based progress persistenceAccessibility & correctness
aria-label="Row N, column M"for screen reader targetingmanifest.jsondescription updated to match actual assets (kittens/toys, not shapes/stars)app/index.html<title>aligned with visible heading:Brain Speed Exercisesinterface.htmlkitten response images getloading="lazy" decoding="async"Test coverage
Added
audio.test.js,render.test.js, andprogress.test.jsfor the new modules;gameCard.test.jsimport moved to file top with looseit()calls consolidated into thedescribeblock;index.test.jsmocksaudio.jsandprogress.jsto isolate the controller.⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.