Skip to content

Conversation

@7se7en72025
Copy link
Contributor

@7se7en72025 7se7en72025 commented Nov 14, 2025

Problem

The statistics cards on the homepage were displaying truncated text with ellipses, making it impossible for users to read the complete descriptions. Specifically:

  • Summary grid cards (the horizontal row of 6 cards at the bottom) were manually truncating titles to only 12 characters, showing text like "Kids whose l...", "Projects for...", "Problem-solv..." instead of the full descriptions
  • Grid cards (the larger cards above) had a fixed height constraint that was cutting off longer titles
  • Users couldn't see complete information about the statistics, reducing the effectiveness of the statistics section

Solve Issue

#550

Root Cause

  1. Manual truncation logic: The code was using substring(0, 12) to limit text to 12 characters and adding ellipses manually
  2. Fixed height constraints: Cards had h-12 sm:h-14 which didn't accommodate multi-line text
  3. Single-line clamp: Using line-clamp-1 only allowed one line of text, cutting off longer descriptions

Solution

Changes Made

  1. Removed manual truncation: Eliminated the substring(0, 12) logic that was artificially limiting text length
  2. Improved line clamping:
    • Changed summary cards from line-clamp-1 to line-clamp-2 to allow up to 2 lines of text
    • Changed grid cards from fixed height with line-clamp-2 to line-clamp-3 for better flexibility
  3. Enhanced card layout:
    • Increased padding (py-3 sm:py-4 md:py-5) to provide more space for content
    • Added minimum height (min-h-[80px] sm:min-h-[90px]) to ensure consistent card sizing
    • Added leading-tight for better text spacing

Before

  • Text truncated to 12 characters: "Kids whose l...", "Projects for..."
  • Fixed height causing content to be cut off
  • Single line display only

After

  • Full text displayed (up to 2-3 lines as needed)
  • Dynamic height that accommodates content
  • Better readability with proper spacing

Impact

✅ Users can now read complete statistics descriptions
✅ Better accessibility with full content visible
✅ Improved user experience and information clarity
✅ Responsive design maintained across all screen sizes

Testing

  • Verified full text displays on desktop view
  • Verified full text displays on mobile view
  • Verified responsive behavior across breakpoints
  • Verified dark mode compatibility
  • Checked that cards maintain proper spacing and alignment

issue :
Screenshot 2025-11-15 051320

- Remove manual text truncation that limited titles to 12 characters
- Change line-clamp from 1 to 2 for summary grid cards to show full text
- Increase padding and add min-height to accommodate full content
- Change grid cards from fixed height to line-clamp-3 for better text display
- Fixes issue where statistics card titles were truncated with ellipses
@github-actions
Copy link

🎉 All Checks Passed!

Status: ✅ Ready to merge

✅ Completed Workflows

Workflow Status Details
🔨 Continuous Integration ✅ Passed Build completed successfully
📝 Code Linting ✅ Passed All formatting and style checks passed

🚀 This PR is ready for review and can be safely merged to main branch!

Great work! Your code meets all quality standards. 👏

@sa-fw-an
Copy link
Member

Screenshot 2025-11-15 at 7 51 07 PM

How does this Solve the Problem. Probably when hovering on the card it must display the whole sentence. Try doing it in that way.

@github-actions
Copy link

🎉 All Checks Passed!

Status: ✅ Ready to merge

✅ Completed Workflows

Workflow Status Details
🔨 Continuous Integration ✅ Passed Build completed successfully
📝 Code Linting ✅ Passed All formatting and style checks passed

🚀 This PR is ready for review and can be safely merged to main branch!

Great work! Your code meets all quality standards. 👏

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