Skip to content

Conversation

@sergiocarracedo
Copy link
Collaborator

@sergiocarracedo sergiocarracedo commented Nov 7, 2025

Description

Removes the pointer-events: none from the card when no link to allow click on children elements

Screenshots (if applicable)

[Link to Figma Design](Figma URL here)

Implementation details

@sergiocarracedo sergiocarracedo requested a review from a team as a code owner November 7, 2025 14:38
Copilot AI review requested due to automatic review settings November 7, 2025 14:38
@github-actions github-actions bot added the fix label Nov 7, 2025
Copy link
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 enhances the F0Card component by improving pointer event handling for card content and adding comprehensive documentation and test scenarios. The key change ensures that children elements within cards are only non-interactive when an overlay link is active.

  • Modified pointer-events logic to conditionally apply based on overlay link state
  • Added interactive button example to SlotComponent demonstrating clickable children
  • Enhanced Storybook documentation with component descriptions and argTypes details
  • Added new story WithChildrenAndLink to test cards with both children and links

Reviewed Changes

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

File Description
packages/react/src/components/F0Card/CardInternal.tsx Updated pointer-events logic on CardContent and CardHeader to conditionally disable interactions based on link and disableOverlayLink props
packages/react/src/components/F0Card/stories/Card.stories.tsx Added F0Button import, enhanced SlotComponent with interactive button, added component documentation, argTypes descriptions, and new WithChildrenAndLink story

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

<CardContent className="pointer-events-none">
<CardContent
className={cn(
(disableOverlayLink || link) && "pointer-events-none"
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The logic for applying pointer-events-none appears incorrect. Currently, it applies when disableOverlayLink is true OR when link exists. However, based on the context:

  • When disableOverlayLink is true, the overlay link is disabled, so children SHOULD be clickable
  • When link exists (and disableOverlayLink is false), the overlay link is active, so children should NOT be clickable

The condition should be (!disableOverlayLink && link) to only disable pointer events when there's a link AND the overlay is enabled.

Suggested change
(disableOverlayLink || link) && "pointer-events-none"
(!disableOverlayLink && link) && "pointer-events-none"

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 17.85% 18582 / 104054
🔵 Statements 17.85% 18582 / 104054
🔵 Functions 43.46% 872 / 2006
🔵 Branches 69.94% 2641 / 3776
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/components/F0Card/CardInternal.tsx 93.36% 90.62% 40% 93.36% 147-153, 166, 213-214, 216-219
packages/react/src/components/F0Card/__stories__/Card.stories.tsx 0% 0% 0% 0% 1-413
Generated in workflow #9060 for commit 67c93a2 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

size-limit report 📦

Path Size
JS: Stable 608.99 KB (-0.01% 🔽)
JS: Experimental 1014.3 KB (+0.02% 🔺)
CSS 72.44 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants