Skip to content

Card Rat: play failure audio on missed triggers and add hint visibility toggle#109

Merged
acrosman merged 24 commits into
mainfrom
copilot/add-game-egyptian-rat-screw
May 25, 2026
Merged

Card Rat: play failure audio on missed triggers and add hint visibility toggle#109
acrosman merged 24 commits into
mainfrom
copilot/add-game-egyptian-rat-screw

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

Card Rat previously played failure audio only on false alarms, so missed pair/sandwich/joker windows had no immediate negative feedback. This change adds explicit miss signaling in deal flow and introduces a player control to hide/show the hint text under the cards.

  • Miss feedback wiring

    • dealNextCard() now returns missedTrigger when the prior reaction window closes without a required slap.
    • UI deal loop consumes this flag and plays failure audio for missed pair/sandwich/joker events.
  • Hint visibility control

    • Added Show hints checkbox in Card Rat controls.
    • Added UI state handler to toggle visibility of #cr-feedback without affecting gameplay state.
  • Contract + test updates

    • Updated game return contract/docs for the new missedTrigger field.
    • Extended Card Rat tests to cover miss-audio behavior and hint toggle behavior; updated existing mocks to include the new field.
// game.js
const missedTrigger = finalizeCurrentCard();
return {
  card,
  mustReact: mustReactToCurrentCard,
  missedTrigger,
  displayDurationMs,
  deckIndex,
  deckPasses,
};

// index.js
const next = game.dealNextCard();
if (next.missedTrigger) {
  playFailureSound();
}

Copilot AI linked an issue May 18, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add game based on Egyptian Rat Screw Add Card Rat game plugin with pair/joker reaction rules and deck-cycle handling May 18, 2026
Copilot AI requested a review from acrosman May 18, 2026 03:39
Copy link
Copy Markdown
Owner

@acrosman acrosman left a comment

Choose a reason for hiding this comment

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

Please address the following issues:

  1. I've replaced the sprite image, re-target the selectors for the new card locations.
  2. Test coverage is insufficient, not all functions are covered.
  3. The game doesn't reliably respond to the player pressing space. They have to click on the cards at least once first. The key listener should be for more than just the card display area.

Re-review the code, look for other issues and ways to improve the new game's code.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

Please address the following issues:

  1. I've replaced the sprite image, re-target the selectors for the new card locations.
  2. Test coverage is insufficient, not all functions are covered....

Implemented in 149d676 and 20e5d9e.

  • Retargeted Card Rat sprite selection to the updated PNG sprite layout and removed old hardcoded SVG mapping.
  • Fixed Space-key reliability by adding a document-level key listener during active gameplay, so reactions work without clicking the card area first.
  • Expanded Card Rat tests to cover all functions in game.js and index.js, including key variants (Space, Spacebar, ' '), listener idempotency, timer-loop callback behavior, and save callback merge logic.

Screenshot:
Updated Card Rat UI

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4442 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.BcwKRr --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,7295498713841537903,8235765550172289842,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,9759352871980298224,4363250348736810022,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-updated.png --window-size=1366,1100 file:///tmp/card-rat-preview.html (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4442 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.BcwKRr --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,7295498713841537903,8235765550172289842,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,9759352871980298224,4363250348736810022,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-updated.png --window-size=1366,1100 file:///tmp/card-rat-preview.html (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4442 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.BcwKRr --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,7295498713841537903,8235765550172289842,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,9759352871980298224,4363250348736810022,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-updated.png --window-size=1366,1100 file:///tmp/card-rat-preview.html (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4442 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.BcwKRr --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,7295498713841537903,8235765550172289842,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,9759352871980298224,4363250348736810022,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-updated.png --window-size=1366,1100 file:///tmp/card-rat-preview.html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from acrosman May 18, 2026 04:15
Copy link
Copy Markdown
Owner

@acrosman acrosman left a comment

Choose a reason for hiding this comment

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

Image targeting is incorrect:

Image

Remove the text below the card images.

Show the card deck to the left of the current card, with the back image showing (it's in the sprite in the top row).

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

Image targeting is incorrect:

Image...

Implemented in e65531f and refined in 79a991d.

  • Updated sprite coordinate targeting for the replacement sheet so cards render from the correct locations.
  • Removed the visible text under the card image.
  • Added a left-side deck card that renders the back image from the top sprite row.

Screenshot:
Updated Card Rat card area

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4819 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.Ruutvt --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,1563981000586962631,4724475912538864316,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,14423509494564198393,6932583287939218893,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-deck-update.png --window-size=1366,1100 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4819 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.Ruutvt --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,1563981000586962631,4724475912538864316,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,14423509494564198393,6932583287939218893,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-deck-update.png --window-size=1366,1100 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4819 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.Ruutvt --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,1563981000586962631,4724475912538864316,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,14423509494564198393,6932583287939218893,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-deck-update.png --window-size=1366,1100 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4819 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.Ruutvt --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,1563981000586962631,4724475912538864316,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,14423509494564198393,6932583287939218893,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-ui-deck-update.png --window-size=1366,1100 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from acrosman May 18, 2026 04:29
Copy link
Copy Markdown
Owner

@acrosman acrosman left a comment

Choose a reason for hiding this comment

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

Image alignment is still incorrect. The display area is also larger than the provided card images. Card back is not shown at all. Jokers are also a total alignment miss.

Image

Instead of using sprite image, propose a solution that uses one image per card. Generate SVG images for the main cards.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

Image alignment is still incorrect. The display area is also larger than the provided card images. Card back is not shown at all. Jokers are also a total alignment miss.

<img width="1512" height="944...

Implemented in 0a0319a.

I replaced sprite-sheet targeting with generated per-card SVG images (one image per card), including dedicated SVG rendering for jokers and deck back, and tightened the card display sizing/layout to match the rendered cards.

Screenshot:
Updated Card Rat SVG card rendering

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4403 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.yAmi47 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17705496780366832080,1993776141079034211,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2683317280122145880,4101556708788628420,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-svg-ui.png --window-size=1366,1000 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4403 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.yAmi47 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17705496780366832080,1993776141079034211,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2683317280122145880,4101556708788628420,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-svg-ui.png --window-size=1366,1000 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4403 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.yAmi47 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17705496780366832080,1993776141079034211,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2683317280122145880,4101556708788628420,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-svg-ui.png --window-size=1366,1000 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4403 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.yAmi47 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17705496780366832080,1993776141079034211,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2683317280122145880,4101556708788628420,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium-browser chromium-browser --headless --disable-gpu --no-sandbox --screenshot=/tmp/card-rat-svg-ui.png --window-size=1366,1000 file:///tmp/card-rat-preview.html ndor/bin/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add Card Rat game plugin with pair/joker reaction rules and deck-cycle handling Add Card Rat game plugin with pair/joker reaction rules and SVG card rendering May 18, 2026
Copilot AI requested a review from acrosman May 18, 2026 15:08
Copilot AI changed the title Card Rat: resolve max-len violations and replace chirpy flick cue with flip-like synthesized audio feat: replace card-flick chirp with synthesized playing-card-flip sound May 23, 2026
Copilot AI changed the title feat: replace card-flick chirp with synthesized playing-card-flip sound Refine Card Rat deal SFX and add player “Card sound” toggle May 23, 2026
Copilot AI changed the title Refine Card Rat deal SFX and add player “Card sound” toggle Card Rat: play failure audio on missed triggers and add hint visibility toggle May 23, 2026
@acrosman acrosman requested a review from Copilot May 23, 2026 02:26
Copy link
Copy Markdown
Contributor

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

This PR updates the Card Rat game to provide immediate negative feedback when players miss required reaction windows (pair/sandwich/joker), and adds a player-facing control to hide/show the hint text under the cards. It also extends the shared audio service with a synthesized “card flick” sound and adds/updates Jest coverage around the new behaviors.

Changes:

  • Added “missed trigger” signaling from game.dealNextCard() through the UI deal loop, which now plays failure audio on missed reaction windows.
  • Added a “Show hints” checkbox that toggles visibility of the in-game hint/feedback text without impacting gameplay state.
  • Expanded Card Rat and audio service test coverage (including new playCardFlickSound() coverage).

Reviewed changes

Copilot reviewed 11 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/games/card-rat/game.js Introduces missed-trigger finalization and exposes missedTrigger in the deal contract; adaptive speed tracking.
app/games/card-rat/index.js Wires missed-trigger audio + hint visibility toggle into the UI/controller layer and saveScore integration.
app/games/card-rat/interface.html Adds “Show hints” control and Card Rat UI structure including trend chart and live feedback region.
app/games/card-rat/style.css Adds Card Rat-specific layout/styling for cards, controls, and feedback text.
app/games/card-rat/cardSvg.js Adds sprite/joker/deck-back image helpers for Card Rat rendering.
app/games/card-rat/manifest.json Registers the Card Rat plugin metadata for the game registry.
app/games/card-rat/tests/game.test.js Adds node-environment unit tests for Card Rat core game logic, including missed-trigger behavior.
app/games/card-rat/tests/index.test.js Adds jsdom tests for UI/controller behavior including miss-audio and hint toggling.
app/games/card-rat/tests/cardSvg.test.js Adds unit tests for Card Rat image-path and sprite-style helpers.
app/components/audioService.js Adds playCardFlickSound() (noise swish + snap transient) and supporting constants.
app/components/tests/audioService.test.js Extends audio service mocks and tests to cover playCardFlickSound() and related behaviors.
Comments suppressed due to low confidence (2)

app/games/card-rat/game.js:467

  • The JSDoc for getSpeedHistory() says the history is “captured after successful reactions”, but the history is appended whenever applyStaircaseStep() changes the speed level (including after consecutive misses/false alarms). Update the doc (or adjust the history semantics) so it matches the actual behavior.
/**
 * Return display-duration history captured after successful reactions.
 * @returns {number[]}
 */
export function getSpeedHistory() {
  return speedHistory.slice();
}

app/components/tests/audioService.test.js:216

  • There is a playCardFlickSound() resume-rejection test nested under describe('playSuccessSound'), and it duplicates the exact test name “handles resume rejection gracefully”. This makes the suite harder to read/debug. Move the playCardFlickSound test into the describe('playCardFlickSound') block and give it a distinct name.
  test('handles resume rejection gracefully', async () => {
    const { mockCtx, MockAC } = buildMockAudioContext('suspended');
    mockCtx.resume = jest.fn().mockRejectedValue(new Error('cannot resume'));
    const existing = getAudioContext();
    if (existing) existing.state = 'closed';

    const original = globalThis.AudioContext;
    globalThis.AudioContext = MockAC;

    expect(() => playSuccessSound()).not.toThrow();
    await new Promise((resolve) => { setTimeout(resolve, 0); });

    globalThis.AudioContext = original;
  });

  test('handles resume rejection gracefully', async () => {
    const { mockCtx, MockAC } = buildMockAudioContext('suspended');
    mockCtx.resume = jest.fn().mockRejectedValue(new Error('cannot resume'));
    const existing = getAudioContext();
    if (existing) existing.state = 'closed';

    const original = globalThis.AudioContext;
    globalThis.AudioContext = MockAC;

    expect(() => playCardFlickSound()).not.toThrow();
    await new Promise((resolve) => { setTimeout(resolve, 0); });

    globalThis.AudioContext = original;
  });

Comment on lines +377 to +386
return {
score,
triggerHits,
misses,
falseAlarms,
cardsShown,
deckPasses,
lowestDisplayTime: displayDurationMs,
duration,
};
Comment on lines +468 to +494
function stop() {
clearDealTimer();
detachGlobalKeyListener();
timerService.stopTimer();

if (!game.isRunning()) {
return {
score: game.getScore(),
triggerHits: game.getTriggerHits(),
misses: game.getMisses(),
falseAlarms: game.getFalseAlarms(),
cardsShown: game.getCardsShown(),
deckPasses: game.getDeckPasses(),
lowestDisplayTime: game.getDisplayDurationMs(),
duration: 0,
};
}

const result = game.stopGame();

void saveScore(
GAME_ID,
{
score: result.score,
sessionDurationMs: result.duration,
lowestDisplayTime: result.lowestDisplayTime,
},
Comment on lines +66 to +69
aria-label="Display interval trend over recent successful slaps">
<polyline id="cr-trend-line" fill="none" stroke="currentColor" stroke-width="2" points=""></polyline>
</svg>
<p id="cr-trend-empty" class="game-trend__empty">Get a hit to populate chart.</p>
Comment on lines 59 to +68
const mockCtx = {
state,
currentTime: 0,
sampleRate: 44100,
destination: {},
createOscillator: jest.fn(() => ({ ...mockOscillator })),
createGain: jest.fn(() => ({ ...mockGain })),
createOscillator: jest.fn(() => createMockOscillator()),
createGain: jest.fn(() => createMockGain()),
createBuffer: jest.fn(() => ({ getChannelData: jest.fn(() => new Float32Array(1)) })),
createBufferSource: jest.fn(() => createMockBufferSource()),
createBiquadFilter: jest.fn(() => createMockBiquadFilter()),
Copy link
Copy Markdown
Owner

@acrosman acrosman left a comment

Choose a reason for hiding this comment

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

There is a linting error

app/components/tests/audioService.test.js
  66:1  error  This line has a length of 111. Maximum allowed is 100  max-len

✖ 1 problem (1 error, 0 warnings)

There is also a test coverage gap:
Jest: "global" coverage threshold for functions (100%) not met: 99.84%

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

There is a linting error

Fixed in the latest commit:

  • Lint: split the createBuffer mock onto multiple lines so no line exceeds 100 characters.
  • Coverage: imported getLowestDisplayTimeMs in game.test.js and added a test that verifies it initialises to BASE_DISPLAY_DURATION_MS, updates to the fastest duration after speed-ups, and remains at that minimum after the game slows back down. All 1483 tests pass and the 100% function coverage threshold is met.

Copilot AI requested a review from acrosman May 25, 2026 21:18
…sman/BrainSpeedExercises into copilot/add-game-egyptian-rat-screw

* 'copilot/add-game-egyptian-rat-screw' of github.com:acrosman/BrainSpeedExercises:
  Fix lint line-length and add getLowestDisplayTimeMs test coverage
@acrosman acrosman marked this pull request as ready for review May 25, 2026 21:23
@acrosman acrosman merged commit bf63d78 into main May 25, 2026
6 checks passed
@acrosman acrosman deleted the copilot/add-game-egyptian-rat-screw branch May 25, 2026 21:23
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.

Add game based on Egyptian Rat Screw

3 participants