Skip to content

Fix homepage cards rendering at inconsistent heights#2011

Open
n0umen0n wants to merge 8 commits intomainfrom
cursor/homepage-card-sizes-3a54
Open

Fix homepage cards rendering at inconsistent heights#2011
n0umen0n wants to merge 8 commits intomainfrom
cursor/homepage-card-sizes-3a54

Conversation

@n0umen0n
Copy link
Copy Markdown
Contributor

@n0umen0n n0umen0n commented Mar 16, 2026

Summary

  • keep space cards equal-height in shared card grids so short content does not shrink cards
  • truncate long card text in the body/title using Tailwind text-overflow utilities (truncate) to prevent overflow
  • improve responsive behavior at smaller breakpoints by changing card grids from 1/3 columns to 1/2/3 (base/sm/lg)
  • ensure card wrappers/links stretch full height and allow truncation via min-w-0

Testing

  • not run in this cloud environment (workspace dependencies are not installed; previous lint attempt failed with eslint: not found)
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Style
    • Refined space card layout for consistent heights and alignment across lists and grids; expanded clickable areas to cover full card height.
    • Improved responsive grid row sizing so cards remain uniform.
    • Adjusted label placement for better responsiveness and visibility across breakpoints.
    • Prevented text overflow for titles, descriptions, and meta info with truncation and sizing tweaks to avoid layout overflow.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Tailwind layout tweaks applied across space list and card components to enforce consistent heights and prevent overflow: added h-full, min-w-0, truncate, adjusted description sizing and title truncation, and added auto-rows-fr to grid containers. No data-flow, API, or logic changes. (50 words)

Changes

Cohort / File(s) Summary
My Spaces page
apps/web/src/app/[lang]/my-spaces/page.tsx
Link wrapping each space item gains h-full to extend the clickable area.
Space Card with Discoverability
packages/epics/src/spaces/components/space-card-with-discoverability.tsx
Link updated to include h-full min-w-0 alongside existing flex classes to control sizing.
Space Card Containers
packages/epics/src/spaces/components/space-card.container.tsx, packages/epics/src/spaces/components/inner-space-card.container.tsx
Grid containers add auto-rows-fr; each item wrapper adds h-full min-w-0; inner Link set to flex flex-col h-full to enforce full-height cards.
Space Card internals
packages/epics/src/spaces/components/space-card.tsx
Header made relative and added an overlay SpaceModeLabel (hidden on xl as overlay, visible on xl inline); added min-w-0 to content wrappers, truncate to title/createdAt, constrained description sizing and added title attribute for full text on hover.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • evgenibir
  • sergey3bv
  • DSanich
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title does not follow the required conventional commits format (type(scope): description) and is missing the type prefix and scope. Reformat the title to follow conventional commits format, e.g., 'fix(epics): homepage cards rendering at inconsistent heights' or 'fix(web): homepage cards rendering at inconsistent heights'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/homepage-card-sizes-3a54

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.

@n0umen0n n0umen0n marked this pull request as ready for review March 16, 2026 09:21
@n0umen0n n0umen0n requested a review from DSanich March 16, 2026 09:21
Copy link
Copy Markdown
Contributor

@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.

Caution

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

⚠️ Outside diff range comments (1)
packages/epics/src/spaces/components/space-card.tsx (1)

121-127: ⚠️ Potential issue | 🟡 Minor

Loading skeleton height no longer matches the reserved two-line description area.

Line 125 keeps height="26px" while Line 127 enforces min-h-[2.5rem] (40px), so cards can still jump in height between loading and loaded states.

Suggested fix
             <Skeleton
               loading={isLoading}
               className="mb-4"
               width="100%"
-              height="26px"
+              height="40px"
             >
               <div className="text-1 text-neutral-11 mb-4 line-clamp-2 min-h-[2.5rem]">
                 {description}
               </div>
             </Skeleton>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/epics/src/spaces/components/space-card.tsx` around lines 121 - 127,
The Skeleton's fixed height ("26px") doesn't match the content container's
reserved min height ("min-h-[2.5rem]" ≈ 40px) causing layout jumps; update the
Skeleton used around the description (the <Skeleton loading={isLoading} ...>
surrounding the div with className "text-1 ... min-h-[2.5rem]") so its height
matches the reserved space (e.g., change height to "40px" or "2.5rem") or remove
the min-h on the content div so both states reserve the same vertical space.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/epics/src/spaces/components/space-card.tsx`:
- Around line 121-127: The Skeleton's fixed height ("26px") doesn't match the
content container's reserved min height ("min-h-[2.5rem]" ≈ 40px) causing layout
jumps; update the Skeleton used around the description (the <Skeleton
loading={isLoading} ...> surrounding the div with className "text-1 ...
min-h-[2.5rem]") so its height matches the reserved space (e.g., change height
to "40px" or "2.5rem") or remove the min-h on the content div so both states
reserve the same vertical space.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 01b79d55-4cc0-4948-a1b0-069310e47d5c

📥 Commits

Reviewing files that changed from the base of the PR and between c923947 and 53609b4.

📒 Files selected for processing (4)
  • apps/web/src/app/[lang]/my-spaces/page.tsx
  • packages/epics/src/spaces/components/space-card-with-discoverability.tsx
  • packages/epics/src/spaces/components/space-card.container.tsx
  • packages/epics/src/spaces/components/space-card.tsx

Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
packages/epics/src/spaces/components/space-card.tsx (1)

127-130: Switch to line-clamp-2 for better description preview while maintaining layout consistency.

The current truncate utility forces single-line truncation. Using line-clamp-2 would display more context to users while keeping the min-h-[2.5rem] row height consistent.

♻️ Suggested adjustment
               <div
-                className="text-1 text-neutral-11 mb-4 min-h-[2.5rem] truncate"
+                className="text-1 text-neutral-11 mb-4 min-h-[2.5rem] line-clamp-2"
                 title={description}
               >

The line-clamp-* utility is already supported and in use across the codebase (e.g., packages/ui/src/select.tsx, packages/epics/src/spaces/components/inner-space-card.tsx).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/epics/src/spaces/components/space-card.tsx` around lines 127 - 130,
In the space-card component replace the single-line truncation class on the
description div by swapping "truncate" for "line-clamp-2" so the element (the
div with className "text-1 text-neutral-11 mb-4 min-h-[2.5rem] truncate" and
title={description}) shows two lines of preview while keeping the existing
min-h-[2.5rem] height; update the className to "text-1 text-neutral-11 mb-4
min-h-[2.5rem] line-clamp-2" (no other logic changes needed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/epics/src/spaces/components/space-card.tsx`:
- Around line 127-130: In the space-card component replace the single-line
truncation class on the description div by swapping "truncate" for
"line-clamp-2" so the element (the div with className "text-1 text-neutral-11
mb-4 min-h-[2.5rem] truncate" and title={description}) shows two lines of
preview while keeping the existing min-h-[2.5rem] height; update the className
to "text-1 text-neutral-11 mb-4 min-h-[2.5rem] line-clamp-2" (no other logic
changes needed).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ef79267d-a3fa-43af-9741-51b0b16a818f

📥 Commits

Reviewing files that changed from the base of the PR and between 53609b4 and 30643d9.

📒 Files selected for processing (4)
  • packages/epics/src/spaces/components/inner-space-card.container.tsx
  • packages/epics/src/spaces/components/space-card-with-discoverability.tsx
  • packages/epics/src/spaces/components/space-card.container.tsx
  • packages/epics/src/spaces/components/space-card.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/epics/src/spaces/components/space-card-with-discoverability.tsx

@n0umen0n
Copy link
Copy Markdown
Contributor Author

@cursoragent make sure that two lines are fully visible in the description

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 23, 2026

Taking a look!

Open in Web Open in Cursor 

@n0umen0n
Copy link
Copy Markdown
Contributor Author

@cursoragent make sure that two lines are fully visible in the description

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 23, 2026

Handled proactively — I pushed an additional fix to ensure the description shows up to 2 full lines without clipping.

What I changed

In packages/epics/src/spaces/components/space-card.tsx, I updated the description block to use typography-token-based sizing:

  • kept line-clamp-2 (max 2 lines)
  • removed hardcoded height
  • set:
    • lineHeight: calc(var(--text-1--line-height) * var(--text-1))
    • minHeight: calc(var(--text-1--line-height) * var(--text-1) * 2)

This guarantees space for two complete lines based on the same text-1 token values used by the design system, so it won’t get cut at different breakpoints/themes.

Commit pushed: 9aea5c3c

View PR

Open in Web Open in Cursor 

@n0umen0n
Copy link
Copy Markdown
Contributor Author

@cursoragent now it is all good when the screen is very wide also good when the screen is for mobile. But there is still problem when the width of the screen is medium (check screenshot). Problem is that the date gets out of the card, there is too much spacing between the description and agreements/members. And the tag Sandbox/Pilot etc. should be placed in the right corner on top of the communities image, otherwise with certain widths it overlaps with other data in the card.

image

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 26, 2026

Implemented proactively based on that PR comment, and pushed a targeted fix for the medium-width layout issues.

What I changed

In packages/epics/src/spaces/components/space-card.tsx:

  1. Moved Sandbox/Pilot/Archived tag to image header

    • SpaceModeLabel now renders in the CardHeader as an absolute overlay (top-right).
    • Avoids overlap with body metadata at medium widths.
    • Preserves spacing with exit button (right-12 when exit button exists).
  2. Fixed date spilling out of card

    • Strengthened width constraints on the date row/container (w-full, max-w-full, truncate) so date text stays inside card bounds at medium breakpoints.
  3. Reduced excessive spacing between description and members/agreements

    • Tightened vertical margins (mb-3 and gap-y-1) in the content section.
    • Removed the previous footer-right tag block that was forcing awkward spacing.
  4. Kept two-line description behavior

    • Description remains clamped to 2 lines with token-based line-height/min-height so two full lines remain visible.

Commit pushed

  • c5647b3d9

View PR

Open in Web Open in Cursor 

@n0umen0n
Copy link
Copy Markdown
Contributor Author

@cursoragent make some changes

  1. When window is wide Sandbox/Pilot/Archived tag should be where it was before, in the lower right corner. But when the screen is not wide then keep it in the image header.
Screenshot 2026-03-27 at 10 41 46
  1. Now there is too little spacing between description and members/agreements when there is two lines of text.

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 27, 2026

Done — I made both requested changes and pushed them.

✅ Changes implemented

  1. Responsive position for Sandbox/Pilot/Archived tag

    • On wide screens (xl and up): tag is back in the lower-right card body area (like before).
    • On smaller/medium screens: tag stays in the image header top-right to avoid overlap.
    • Implemented by rendering:
      • header tag as xl:hidden
      • footer tag as hidden xl:flex
  2. More spacing between 2-line description and Members/Agreements

    • Increased spacing under description (mb-4 instead of mb-3).
    • Kept bottom section anchored cleanly with mt-auto so layout remains stable.

File changed

  • packages/epics/src/spaces/components/space-card.tsx

Commit pushed

  • d0c47cbd7

View PR

Open in Web Open in Cursor 

Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/epics/src/spaces/components/space-card.tsx`:
- Around line 131-142: Extract the inline style block applied to the description
div into a reusable CSS/Tailwind utility (e.g., .description-2-lines) and
replace the inline style in the JSX with that class; update the component
surrounding the Skeleton and the div (the div using className "text-1
text-neutral-11 mb-0 line-clamp-2" and title={description}) to include the new
utility instead of the inline lineHeight and minHeight calculations, and add the
utility to your stylesheet or Tailwind config using the same calc(...)
expressions referencing --text-1--line-height and --text-1 so the two-line
height behavior is preserved and reusable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3cb3f287-7692-45fb-a0d5-9671b97c5e69

📥 Commits

Reviewing files that changed from the base of the PR and between 9aea5c3 and d0c47cb.

📒 Files selected for processing (1)
  • packages/epics/src/spaces/components/space-card.tsx

Comment on lines +131 to +142
<Skeleton loading={isLoading} className="mb-4" width="100%" height="26px">
<div
className="text-1 text-neutral-11 mb-0 line-clamp-2"
style={{
lineHeight: 'calc(var(--text-1--line-height) * var(--text-1))',
minHeight: 'calc(var(--text-1--line-height) * var(--text-1) * 2)',
}}
title={description}
>
<div className="text-1 text-neutral-11 mb-4 line-clamp-2">
{description}
</div>
</Skeleton>
</div>
<div className="flex gap-2 text-xs items-center">
<div className="flex flex-col gap-y-2 gap-x-4 flex-wrap">
{description}
</div>
</Skeleton>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider extracting inline style calculations to a CSS class.

The inline styles using CSS custom properties are functionally correct and ensure a consistent 2-line description area as per PR objectives. However, mixing inline styles with Tailwind classes reduces consistency.

If these CSS variables (--text-1--line-height, --text-1) are part of your design system, consider adding a utility class in your Tailwind config or CSS that encapsulates this 2-line height pattern for reuse elsewhere.

Example utility class approach

In your CSS/design system:

.description-2-lines {
  line-height: calc(var(--text-1--line-height) * var(--text-1));
  min-height: calc(var(--text-1--line-height) * var(--text-1) * 2);
}

Then in the component:

 <div
-  className="text-1 text-neutral-11 mb-0 line-clamp-2"
-  style={{
-    lineHeight: 'calc(var(--text-1--line-height) * var(--text-1))',
-    minHeight: 'calc(var(--text-1--line-height) * var(--text-1) * 2)',
-  }}
+  className="text-1 text-neutral-11 mb-0 line-clamp-2 description-2-lines"
   title={description}
 >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/epics/src/spaces/components/space-card.tsx` around lines 131 - 142,
Extract the inline style block applied to the description div into a reusable
CSS/Tailwind utility (e.g., .description-2-lines) and replace the inline style
in the JSX with that class; update the component surrounding the Skeleton and
the div (the div using className "text-1 text-neutral-11 mb-0 line-clamp-2" and
title={description}) to include the new utility instead of the inline lineHeight
and minHeight calculations, and add the utility to your stylesheet or Tailwind
config using the same calc(...) expressions referencing --text-1--line-height
and --text-1 so the two-line height behavior is preserved and reusable.

cursoragent and others added 7 commits April 2, 2026 14:27
Co-authored-by: n0umen0n <n0umen0n@users.noreply.github.com>
Co-authored-by: n0umen0n <n0umen0n@users.noreply.github.com>
Co-authored-by: n0umen0n <n0umen0n@users.noreply.github.com>
Co-authored-by: n0umen0n <n0umen0n@users.noreply.github.com>
Co-authored-by: n0umen0n <n0umen0n@users.noreply.github.com>
Co-authored-by: n0umen0n <n0umen0n@users.noreply.github.com>
Co-authored-by: n0umen0n <n0umen0n@users.noreply.github.com>
@n0umen0n n0umen0n force-pushed the cursor/homepage-card-sizes-3a54 branch from d0c47cb to 668b786 Compare April 2, 2026 11:27
…thHeader hook and improve error logging in useCreateProfile hook. Also, refactor SpaceCard component for better readability and maintainability.
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