fix(goals): stats row uses 3-column grid on mobile too

Live audit at 414px on cockpitapp.vercel.app/goals: header + 3 stat
cards consumed ~400px of vertical space before the first actual goal
appeared, because grid-cols-1 stacked each StatCard full-width on
mobile. User saw one stat per ~140px scroll instead of all three at
a glance.

Drop grid-cols-1 sm:grid-cols-3 → grid-cols-3 (with tighter gap-2 on
mobile, gap-4 sm+). Short labels ("Active Goals" / "Avg Progress" /
"Total") and 1-2 digit values fit comfortably in ~130px-wide cards
at 414px; the sub line wraps to 2 lines at worst. Net: first goal
card is now ~250px above the fold instead of below.

No layout change for desktop (already 3 cols). Verified mobile via
live cloud screenshot post-deploy on next iteration.
This commit is contained in:
g-but committed 2026-05-31 04:31:32 +02:00
1 parent 8119c30c97
commit 3f062a8a57
1 file changed
+7 -1
+7 -1
View File
@@ -36,7 +36,13 @@ export default async function GoalsPage() {
subtitle="Where you're going — and how you're getting there"
right={<NewGoalButton goals={activeGoals} />}
>
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
{/* Stats row: 3 columns at every breakpoint. Previously grid-cols-1 on
mobile stacked the cards vertically, eating ~400px before the user
saw any actual goal — three single-stat cards each ~130px tall.
Live audit at 414px confirmed the density problem. Three columns at
mobile keep each card narrow but readable (short labels + 1-2 digit
values fit comfortably; sub text wraps at most 2 lines). */}
<div className="grid grid-cols-3 gap-2 sm:gap-4">
<StatCard
label="Active Goals"
value={String(stats.active)}