Skip to content

Fix flash timer cancellation, update JSDoc for init and createGameCard#16

Merged
acrosman merged 2 commits intofeature/rabbit-memoryfrom
copilot/sub-pr-14
Mar 22, 2026
Merged

Fix flash timer cancellation, update JSDoc for init and createGameCard#16
acrosman merged 2 commits intofeature/rabbit-memoryfrom
copilot/sub-pr-14

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

Three targeted fixes based on PR review comments on the orbit-sprite-memory plugin and gameCard component.

Changes

  • Timer ordering in submitSelection(): clearTimers() was called after flashBoard(), immediately cancelling the 320 ms cleanup timeout and leaving the success/failure CSS class stuck on the board. Moved clearTimers() before flashBoard() so the flash animates and clears correctly.

    // Before — flash cleanup timer wiped out immediately
    flashBoard('success');
    showRoundReveal(_currentRound);
    clearTimers();          // ← cancels the 320ms remove-class timer
    
    // After — playback timers cleared first, flash runs to completion
    clearTimers();
    flashBoard('success');
    showRoundReveal(_currentRound);
  • init() JSDoc: Changed @param {HTMLElement} to @param {HTMLElement|null} to match the implementation, which explicitly handles and tests null/undefined input.

  • createGameCard() JSDoc: Added @param entries for highestLevel, maxLevel, maxPiggies, and lowestDisplayTime — the four additional progress fields the function already renders but had not documented.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI changed the title [WIP] Add orbital memory game plugin with rabbit images Fix flash timer cancellation, update JSDoc for init and createGameCard Mar 22, 2026
Copilot AI requested a review from acrosman March 22, 2026 18:28
@acrosman acrosman marked this pull request as ready for review March 22, 2026 18:40
@acrosman acrosman merged commit 9e5091b into feature/rabbit-memory Mar 22, 2026
@acrosman acrosman deleted the copilot/sub-pr-14 branch March 22, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants