Skip to content

🎨 Palette: Improve GameCard keyboard accessibility#25

Open
Gamepulse wants to merge 1 commit into
Devfrom
palette/gamecard-a11y-18424975363448927866
Open

🎨 Palette: Improve GameCard keyboard accessibility#25
Gamepulse wants to merge 1 commit into
Devfrom
palette/gamecard-a11y-18424975363448927866

Conversation

@Gamepulse
Copy link
Copy Markdown
Owner

💡 What: Improved keyboard accessibility for the GameCard component and fixed a build-breaking unused variable.

🎯 Why: Interactive elements like tags and badges were using non-semantic spans, making them inaccessible to keyboard users. The entire card container was also not keyboard-focusable, preventing users from navigating the library without a mouse.

♿ Accessibility:

  • Converted spans with role='button' to semantic elements in renderTags, renderMetadataTags, and renderStatusBadge.
  • Added tabIndex={0} and role='button' to card containers in Grid, Compact, and List views.
  • Implemented keyboard handlers for Enter and Space keys on cards, using target checks to avoid conflicts with nested buttons.
  • Added visible focus rings using focus-visible:ring-2 and ring-offset for better contrast.
  • Added aria-labels to cards for screen reader support.

🛠️ Fixes:

  • Removed unused hasIgdbId state in GameScreenshotsCarousel.tsx which was causing tsc build failures.

PR created automatically by Jules for task 18424975363448927866 started by @Gamepulse

- Convert interactive spans to semantic buttons in GameCard
- Add tabIndex and role="button" to GameCard containers
- Implement onKeyDown for card navigation (Enter/Space)
- Add focus-visible styles for better navigation visibility
- Remove unused hasIgdbId state in GameScreenshotsCarousel to fix build

Co-authored-by: Gamepulse <8333979+Gamepulse@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

if (target.closest('[role="button"]') || target.closest('button') || target.closest('a')) {

P0 Badge Exclude card container from click-blocking selector

After adding role="button" to the card container, the onClick guard now always matches target.closest('[role="button"]') even when clicking non-interactive parts of the card, because closest returns the container itself. This prevents mouse navigation from ever calling onClick(game.id) in grid mode (and the same pattern is repeated in compact/list), making cards effectively unopenable by mouse.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant