Skip to content

Adding Orbital Memory#14

Merged
acrosman merged 6 commits intomainfrom
feature/rabbit-memory
Mar 22, 2026
Merged

Adding Orbital Memory#14
acrosman merged 6 commits intomainfrom
feature/rabbit-memory

Conversation

@acrosman
Copy link
Copy Markdown
Owner

Uses rabbits as images in another memory style game.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Electron game plugin, Orbit Sprite Memory, integrating with the existing game registry/plugin architecture and progress system, plus updates the game selection card to display broader progress stats.

Changes:

  • Introduces the orbit-sprite-memory game plugin (UI/controller, pure game logic, manifest, HTML, CSS, image assets).
  • Adds Jest coverage for the new game’s logic and plugin lifecycle/helpers.
  • Updates createGameCard() to display saved stats for more games (e.g., highest level), with corresponding test updates.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/games/orbit-sprite-memory/index.js New plugin controller/UI layer, lifecycle, timers, accessibility announcements, and progress persistence
app/games/orbit-sprite-memory/game.js New pure logic module for round generation, scoring, and difficulty
app/games/orbit-sprite-memory/interface.html New accessible UI markup for the game
app/games/orbit-sprite-memory/style.css New scoped styling for the game UI
app/games/orbit-sprite-memory/manifest.json Registers the new game (id, entry point, thumbnail, metadata)
app/games/orbit-sprite-memory/tests/index.test.js Plugin contract + helper/UI behavior tests (with mocked game logic)
app/games/orbit-sprite-memory/tests/game.test.js Unit tests for pure logic module
app/components/gameCard.js Expands displayed progress stats on game cards
app/components/gameCard.test.js Updates/extends tests for the new card stats behavior

Comment on lines +466 to +470
showRoundReveal(_currentRound);

clearTimers();
_timers.push(setTimeout(() => {
clearRevealSprites();
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In submitSelection(), clearTimers() is called after flashBoard(), which cancels the timeout that removes the success/failure class. This makes the board highlight persist until the next round resets it rather than flashing briefly. Consider clearing existing playback timers before calling flashBoard(), or keeping flash cleanup timers separate so they aren’t cleared here.

Copilot uses AI. Check for mistakes.
Comment on lines +502 to +511
* Initializes the plugin and wires UI events.
*
* @param {HTMLElement} gameContainer - Injected game container.
*/
function init(gameContainer) {
_container = gameContainer;
game.initGame();
clearTimers();

if (!_container) return;
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The init() JSDoc says the parameter is an HTMLElement, but the implementation explicitly supports null/undefined (and there is a test covering init(null)). Update the JSDoc type to reflect that (e.g., HTMLElement|null) to keep docs consistent with behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +55
// Show saved stats when available.
let scoreElem = null;
if (manifest.id === 'fast-piggie' && progress) {
if (progress) {
scoreElem = document.createElement('p');
scoreElem.className = 'game-high-score';
const details = [];
if (typeof progress.highScore === 'number') details.push(`Top Score: ${progress.highScore}`);
if (typeof progress.highestLevel === 'number') details.push(`Max Level: ${progress.highestLevel + 1}`);
if (typeof progress.maxLevel === 'number') details.push(`Max Level: ${progress.maxLevel}`);
if (typeof progress.maxPiggies === 'number') details.push(`Max Piggies: ${progress.maxPiggies}`);
if (typeof progress.lowestDisplayTime === 'number') details.push(`Lowest Display Time: ${progress.lowestDisplayTime}ms`);
scoreElem.textContent = details.join(' | ');
scoreElem.setAttribute('aria-label', `Stats for ${manifest.name}: ${scoreElem.textContent}`);
if (details.length > 0) {
scoreElem.textContent = details.join(' | ');
scoreElem.setAttribute('aria-label', `Stats for ${manifest.name}: ${scoreElem.textContent}`);
} else {
scoreElem = null;
}
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createGameCard() now renders additional progress details (e.g., highestLevel, maxPiggies, lowestDisplayTime), but the function JSDoc only documents progress.highScore. Please update the JSDoc for the progress parameter to include the additional supported fields so callers know what is displayed.

Copilot uses AI. Check for mistakes.
@acrosman
Copy link
Copy Markdown
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

@acrosman I've opened a new pull request, #16, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 22, 2026 18:27
Fix flash timer cancellation, update JSDoc for init and createGameCard
@acrosman acrosman marked this pull request as ready for review March 22, 2026 18:45
@acrosman acrosman merged commit c52b556 into main Mar 22, 2026
4 checks passed
@acrosman acrosman deleted the feature/rabbit-memory branch March 22, 2026 18:46
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.

3 participants