Skip to content

feat: make entire product card clickable#29

Merged
rupurt merged 2 commits intomainfrom
clickable-product-cards
Dec 27, 2025
Merged

feat: make entire product card clickable#29
rupurt merged 2 commits intomainfrom
clickable-product-cards

Conversation

@rupurt
Copy link
Copy Markdown
Contributor

@rupurt rupurt commented Dec 27, 2025

Summary

  • Use Card asChild prop to make the entire card a Link element
  • Add aria-label for accessibility ("Learn more about {name}")
  • Improve UX by allowing clicks anywhere on the card, not just "Learn More"

Test Plan

  • Unit tests passing (pnpm test)
  • TypeScript and lint checks pass (pnpm typecheck && pnpm lint)
  • Manual test: clicking anywhere on product cards navigates to product page

Use the Card asChild prop to make the entire card a Link element,
improving UX by allowing users to click anywhere on the card instead
of just the 'Learn More' text.
Copilot AI review requested due to automatic review settings December 27, 2025 22:35
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

This PR enhances the product card component's user experience by making the entire card clickable instead of just the "Learn More" link. The implementation uses the Card component's asChild prop to transform it into a Link element, improving accessibility with an aria-label attribute.

Key Changes

  • Made entire product card clickable by wrapping content in a Link component using Card's asChild prop
  • Added accessibility label describing the card's purpose
  • Converted "Learn More" from an interactive link to a visual indicator

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/components/products/ProductCard/ProductCard.tsx Restructured Card component to use asChild with Link wrapper, added aria-label, converted Learn More to non-interactive span
src/components/products/ProductCard/ProductCard.test.tsx Updated test to verify entire card is clickable and check for new aria-label

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Dec 27, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
vibes-website 22872ef Commit Preview URL

Branch Preview URL
Dec 27 2025, 10:38 PM

- Remove aria-label to let screen readers announce card content naturally
- Add group hover state to 'Learn More →' for visual feedback on card hover
@rupurt rupurt merged commit 3dc8742 into main Dec 27, 2025
3 checks passed
@rupurt rupurt deleted the clickable-product-cards branch December 27, 2025 22: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.

2 participants