Merged
Conversation
Move the game:select event handler from the inner Play button to the
article element so that clicking anywhere on a game card (thumbnail,
title, description, score line, or button) starts the game.
CSS changes:
- Add `cursor: pointer` to `.game-card` for clear affordance
- Add `.game-card:focus-within` outline so the whole card highlights
when the Play button inside receives keyboard focus
- Restore `.game-card button:focus-visible` outline (WCAG AA safety net)
JS changes (gameCard.js):
- Replace `button.addEventListener('click', ...)` with
`article.addEventListener('click', ...)` — button clicks bubble up
naturally, so keyboard Enter/Space still works without extra wiring
Test changes (gameCard.test.js):
- Add "clicking the card body fires game:select" test
Agent-Logs-Url: https://github.com/acrosman/BrainSpeedExercises/sessions/3757ccae-218a-4cd5-91a7-b32923280193
Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Make game cards entirely clickable
Make game cards entirely clickable
Apr 15, 2026
acrosman
previously requested changes
Apr 15, 2026
Owner
acrosman
left a comment
There was a problem hiding this comment.
Very close, but clean up the noted comment please.
Agent-Logs-Url: https://github.com/acrosman/BrainSpeedExercises/sessions/de4eb621-6b1e-4ce6-b1c0-203df72e7b61 Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each game card required clicking a small "Play" button; the rest of the card surface was inert. The entire card should act as the click target.
Changes
app/components/gameCard.jsgame:selectdispatch frombuttonto the wrappingarticleelement. Button clicks bubble naturally, so keyboard Enter/Space on the focused Play button continues to work without additional wiring.app/styles/game-card.csscursor: pointerto.game-cardso the pointer cursor covers the whole tile..game-card:focus-withinoutline — when the inner Play button is keyboard-focused, the ring wraps the entire card rather than just the button.app/components/tests/gameCard.test.jsarticleelement (outside the button) to verify thegame:selectevent fires with the correctgameId.