Skip to content

Conversation

@Roshan-Singh-07
Copy link

@Roshan-Singh-07 Roshan-Singh-07 commented Sep 15, 2025

When hovering over protocol images, they were getting clipped by card margins.

Changes made:

  • Removed overflow-hidden from image container
  • Adjusted hover scale to allow images to overflow
  • Ensured responsive behavior remains intact

Fixes #16

Summary by CodeRabbit

  • New Features

    • Added a centered "Learn more" action on cards with hover and active effects.
    • Expanded image area behavior allowing intentional image overflow and stronger hover zoom.
  • Accessibility

    • Improved link labeling on cards for better screen-reader support.
  • Style

    • Enhanced card hover shadow transition for a more pronounced lift.
    • Minor spacing, alignment, border, and padding refinements.

@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2025

Walkthrough

Updated components/card.tsx to allow image overflow on hover, adjusted container classes and transitions, changed Image width/height to numeric values and increased hover scale, simplified description mapping, removed an extra space in title classes, and added a centered “Learn more” action block. No public API changes.

Changes

Cohort / File(s) Summary
Card container
components/card.tsx
Updated outer wrapper classes to include transition, hover shadow (hover:shadow-2xl) and z-index utilities; adjusted layout wrappers around card content.
Image container & image props
components/card.tsx
Replaced the overflow-hidden image wrapper with a flex-centered container to allow image overflow; kept the Image component but changed width/height from string literals to numeric (700) and increased hover scale from group-hover:scale-105 to group-hover:scale-110.
Text/content rendering
components/card.tsx
Removed an extra space in the title's text-center class and refactored description rendering from an explicit return in map to an inline map returning <span> elements.
Action block
components/card.tsx
Added a surrounding wrapper and a centered "Learn more" action block with complex utility classes and hover/active effects.

Sequence Diagram(s)

Not applicable — changes are presentational (UI/hover) only.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my whiskers, give a hop,
The picture grows — it cannot stop.
A tidy title, spans in line,
A “Learn more” button — bright and fine.
I nudge the card, the hover gleams — 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning Alongside the overflow and scale adjustments, the PR introduces unrelated additions such as new hover shadows, transition utilities, an aria-label, and a “Learn more” action block that were not part of the original issue’s scope. These enhancements extend beyond the specified objective of unclipping and resizing images on hover. Please extract the accessibility improvements, container styling tweaks, and new action block into a separate pull request to keep this change focused solely on the image overflow fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly highlights the main fix by stating that protocol card images will overflow on hover rather than being clipped, directly reflecting the core change of removing the overflow-hidden constraint. It is concise and focuses on the key behavior adjustment without extraneous details. This makes it easily understandable for teammates reviewing the PR history.
Linked Issues Check ✅ Passed The PR directly addresses issue #16 by removing the overflow-hidden wrapper on the image container and increasing the hover scale so that images can extend beyond their card boundaries, exactly as requested. The responsive layout appears preserved with the updated numeric width and height values. All coding requirements from the linked issue have been implemented.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
components/card.tsx (2)

18-18: Let the zoomed image reliably paint above neighbors; make overflow intent explicit.

Without overflow-hidden, the scaled image can be occluded by adjacent cards in certain stacking contexts. Recommend: explicitly set overflow-visible on the wrapper and elevate the card on hover.

-    <div
-      key={index}
-      className="group relative flex h-auto flex-col justify-evenly rounded-lg border border-zinc-200 p-6 shadow-xl"
-    >
+    <div
+      key={index}
+      className="group relative flex h-auto flex-col justify-evenly rounded-lg border border-zinc-200 p-6 shadow-xl z-0 hover:z-10 isolate"
+    >
@@
-      <div className="relative h-fit rounded-md flex justify-center items-center">
+      <div className="relative h-fit rounded-md flex justify-center items-center overflow-visible">

Quick check: hover a middle card next to others and confirm the zoom isn’t clipped or painted under neighbors.


25-25: Smoother transform, fewer accidental intercepts.

Tighten transition to transforms, hint the compositor, and avoid the image intercepting clicks when it overflows.

-          className="h-64 w-full object-contain transition duration-500 group-hover:scale-110"
+          className="h-64 w-full object-contain transition-transform duration-500 ease-out will-change-transform transform-gpu group-hover:scale-110 pointer-events-none"

Optional: mirror the effect for keyboard users with group-focus-within:scale-110, and consider a more descriptive alt (e.g., alt={title}) for a11y.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e270a4 and 18d93e5.

📒 Files selected for processing (1)
  • components/card.tsx (1 hunks)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/card.tsx (1)

27-59: Remove misused key prop.

Line 29 uses key={index} on a div that is not inside a .map() iteration. The key prop should only be used when rendering lists of elements. Since this Card component is likely called within a .map() in the parent component, the key should be applied there, not within the component itself.

Apply this diff to remove the unnecessary key prop:

     <Link href={link}>
       <div
-        key={index}
         className="group relative flex h-auto flex-col justify-evenly rounded-lg border border-zinc-200 p-6 shadow-xl"
       >
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18d93e5 and d16059a.

📒 Files selected for processing (1)
  • components/card.tsx (1 hunks)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d16059a and 6707181.

📒 Files selected for processing (1)
  • components/card.tsx (1 hunks)

- Added `hover:z-10 focus-visible:z-10` to card wrapper for proper stacking
- Maintains smooth hover zoom overflow and accessibility
- Fixes image clipping and layering in protocol card grid
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
components/card.tsx (1)

4-12: Remove unused index prop from interface.

The index prop is defined in the Props interface but is not destructured or used anywhere in the component. This creates inconsistency and should be removed.

Apply this diff to remove the unused prop:

 interface Props {
-  index: number
   image: string
   title: string
   description: string
   link: string
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6707181 and be3cfb4.

📒 Files selected for processing (1)
  • components/card.tsx (1 hunks)
🔇 Additional comments (5)
components/card.tsx (5)

14-14: Good accessibility improvement!

Adding aria-label={title} to the Link improves screen reader navigation by providing clear context for the link destination.


16-16: LGTM! Z-index stacking issue resolved.

The addition of hover:z-10 and focus-visible:z-10 addresses the previous review concern about scaled images being occluded by neighboring cards. The transition and hover:shadow-2xl classes add nice polish to the hover effect.

Based on previous review comments.


18-28: Core fix implemented correctly!

The removal of overflow-hidden from the image container (line 19) successfully addresses the PR objective of allowing protocol card images to overflow on hover instead of being clipped. Additional improvements:

  • The flex justify-center items-center classes properly center the image
  • Converting width and height from strings to numbers (lines 24-25) is correct—Next.js Image component expects numeric values
  • Increasing hover scale to 110 (line 26) makes the zoom effect more pronounced

31-31: Minor cleanup noted.

Removed extraneous space in className string—good attention to detail.


34-41: Cleaner description rendering.

Refactoring from explicit return to inline map expression improves readability. Using index as the key prop is acceptable here since description lines are static text that won't be dynamically reordered.

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.

Cropping when hovering

1 participant