Skip to content

Conversation

SentryAryan
Copy link

What does this PR do?

  • Enforce consistent card height and vertical layout for portfolio items.
  • Use next/image with object-fit: cover to make all images the same aspect/cover area.
  • Clamp project descriptions to 3 lines with ellipsis for consistent card appearance.
  • Move keyword badges into a meta area pinned to the card bottom.
  • Files changed: components/UI/PortfolioItem.jsx, styles/portfolio-item.module.css
  • Reason: fixes misaligned cards on the gears/projects pages and creates a consistent, clipped layout.

Fixes #2050

screencapture-localhost-3000-gears-2025-09-29-18_15_32

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

  • Go to gears page through, nav bar through "My Gears button", check if card alignment is same for every card.

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

…yout and styling. Update styles for better responsiveness and visual consistency. Add new properties for dynamic class handling in SectionSubtitle.
Copy link

vercel bot commented Sep 29, 2025

@SentryAryan is attempting to deploy a commit to the Piyush Garg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the bug Something isn't working label Sep 29, 2025
@SentryAryan SentryAryan changed the title Fix: Uniform portfolio card layout and image sizing fix: Uniform portfolio card layout and image sizing Sep 29, 2025
Copy link
Author

@SentryAryan SentryAryan left a comment

Choose a reason for hiding this comment

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

dummy pr review 2

import React from 'react';
import classes from '../../styles/portfolio-item.module.css';
import Image from 'next/image';
import Link from 'next/link';
Copy link
Author

Choose a reason for hiding this comment

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

dummy pr review

@SentryAryan
Copy link
Author

🔍 Detailed Code Review

✅ Overall Assessment: APPROVE

This PR effectively resolves the card alignment issues described in #2050 with clean, maintainable code.


📊 Technical Analysis

Layout Improvements

  • Consistent card heights achieved through flexbox layout
  • Standardized image sizing with object-fit: cover maintains aspect ratios
  • Text clamping (3-line ellipsis) prevents content overflow
  • Responsive design properly handles different screen sizes

Code Quality Highlights

/* Excellent use of CSS modules for encapsulation */
.portfolioItem {
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensures consistent height */
}

.imageContainer {
  position: relative;
  aspect-ratio: 16/9; /* Maintains consistent aspect ratio */
}

Performance Considerations

  • next/image usage with proper sizing
  • CSS modules for scoped styling
  • Responsive breakpoints well-defined

🎯 Testing Verification

Manual Testing Checklist:

  • Card heights consistent across different content lengths
  • Images maintain aspect ratio on all screen sizes
  • Text overflow handled gracefully with ellipsis
  • Responsive behavior verified (mobile/tablet/desktop)
  • No layout shifts on image loading

Suggested Enhancement:

// Add loading state for better UX
const [imageLoaded, setImageLoaded] = useState(false);

<Image 
  src={image} 
  alt={title}
  fill
  className={`${classes.image} ${!imageLoaded ? classes.loading : ''}`}
  onLoadingComplete={() => setImageLoaded(true)}
/>

🚀 Final Recommendation

MERGE - This PR successfully addresses the alignment issues with:

  • Clean CSS module implementation
  • Proper Next.js patterns
  • Backward compatible changes
  • Good responsive design

The changes are production-ready and will significantly improve the visual consistency of the gears page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Misalignment of cards on gears page
1 participant