Skip to content

fix: align project cards left on wide screens#4590

Closed
ravindu0823 wants to merge 2 commits into
Dokploy:canaryfrom
ravindu0823:fix/projects-grid-wide-screen-alignment
Closed

fix: align project cards left on wide screens#4590
ravindu0823 wants to merge 2 commits into
Dokploy:canaryfrom
ravindu0823:fix/projects-grid-wide-screen-alignment

Conversation

@ravindu0823

Copy link
Copy Markdown

What

On large/wide screens (e.g. 1920px+, ultrawide), project cards on the Projects page (/dashboard/projects) spread far apart horizontally with large empty gaps instead of packing to the left.

Root cause

apps/dokploy/components/dashboard/projects/show.tsx used fixed column counts (grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5) on a w-full container, plus a per-card lg:max-w-md cap (and a dead flex-wrap left over from a previous flex layout). On very wide screens each fixed grid track becomes much wider than the capped card, leaving big gaps between cards.

Fix

Two className-only edits:

  • Grid container: replace the fixed grid-cols-* and dead flex-wrap with an auto-fill track — grid grid-cols-[repeat(auto-fill,minmax(20rem,1fr))] gap-5 (keeping w-full and gap-5).
  • Per-card wrapper: remove lg:max-w-md (keeping w-full).

This packs cards to the left at a stable width and grows the column count naturally with screen width.

Test

This is a pure Tailwind className change with no extractable logic, and the repo has no jsdom / React Testing Library (React components cannot be rendered in tests), so there is genuinely no unit test to add. Verified pnpm --filter=dokploy run typecheck passes clean:

> dokploy@v0.29.8 typecheck
> tsc --noEmit

(no errors)

Fixes #4523

🤖 Generated with Claude Code

Fixes Dokploy#4523

Root cause: the projects grid used fixed column counts
(grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4
3xl:grid-cols-5) on a w-full container plus a per-card lg:max-w-md
cap. On very wide screens each fixed track is far wider than the
capped card, leaving large gaps between cards.

Fix: use an auto-fill grid track
(grid-cols-[repeat(auto-fill,minmax(20rem,1fr))]) and drop the
per-card lg:max-w-md cap so cards pack to the left at a stable
width while the column count grows with the viewport.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ravindu0823 ravindu0823 requested a review from Siumauricio as a code owner June 9, 2026 09:07
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 9, 2026
Address review: a rigid minmax(20rem,1fr) track cannot shrink below 20rem, so
on ~320-375px phone viewports the single column overflowed its container (the
old grid-cols-1 never did). Clamp the minimum with min(20rem,100%) so the
column collapses to the container width on small screens while keeping the
auto-fill packing on wide screens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Siumauricio

Copy link
Copy Markdown
Contributor

Duplicate #4524

@Siumauricio Siumauricio closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project cards spread far apart on large/wide screens instead of aligning left

2 participants