Skip to content

🎨 Palette: Improve GameCard accessibility and keyboard navigation#29

Open
Gamepulse wants to merge 1 commit into
Devfrom
palette-game-card-accessibility-2343183734902612041
Open

🎨 Palette: Improve GameCard accessibility and keyboard navigation#29
Gamepulse wants to merge 1 commit into
Devfrom
palette-game-card-accessibility-2343183734902612041

Conversation

@Gamepulse
Copy link
Copy Markdown
Owner

This PR improves the accessibility and micro-UX of the GameCard component.

💡 What

  • Added role="button", tabIndex={0}, and aria-label to the GameCard container.
  • Implemented onKeyDown to allow navigating to game details using the keyboard (Enter/Space).
  • Converted interactive <span> tags for genres, modes, and status badges into semantic <button type="button"> elements.
  • Added focus-visible:ring-2 focus indicators for better visibility during keyboard navigation.
  • Fixed a bug where the outer role="button" would block card clicks by updating the target.closest logic.
  • Cleaned up an unused variable in GameScreenshotsCarousel.tsx that was causing a build failure.

🎯 Why

  • The library view was not fully keyboard-navigable.
  • Semantic HTML (buttons) provides better native support for screen readers and keyboard interactions than spans with roles.
  • Consistent focus states are essential for accessibility.

♿ Accessibility

  • Full keyboard support for game cards and their internal filters.
  • Proper ARIA roles and labels for all interactive elements.
  • Clear focus indicators.

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

- Added keyboard navigation support (Enter/Space) to GameCard
- Converted interactive spans to semantic buttons for tags and status badges
- Added ARIA labels and focus-visible indicators to all interactive elements
- Fixed card click regression by ensuring child interactions don't block parent container when focused
- Removed unused 'hasIgdbId' in GameScreenshotsCarousel to fix build error

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.

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