fix(money,habits): stats row uses 3-column grid on mobile too

Codebase sweep after the Goals (3f062a8) + Memory (1baa421) fixes
found two more instances of the exact same pattern:
- src/app/(app)/(private)/money/page.tsx — Monthly Burn / Unverified
- src/app/(app)/(private)/habits/page.tsx — Active Habits / Completions / Best Streak

Both PIN-gated so the audit couldn't catch them visually, but the
source pattern was identical: grid-cols-1 sm:grid-cols-3 with three
StatCards stacking full-width on mobile.

Same fix: grid-cols-3 gap-2 sm:gap-4 everywhere. Stat row collapses
to a compact horizontal triplet instead of eating ~400px of vertical
space before the first list of subscriptions / habit cards.

After this commit, codebase has zero remaining `grid-cols-1
sm:grid-cols-3` stat-row instances. Pattern is now duplicated 4× —
extracting <StatRow stats={[...]} /> is the natural next refactor
when (if) a 5th surface lands.
This commit is contained in:
g-but committed 2026-05-31 04:56:47 +02:00
1 parent 1baa42156e
commit 44e991a452
2 files changed
+8 -3

No files matched your search

+3 -2
View File
@@ -35,8 +35,9 @@ export default async function HabitsPage() {
subtitle={`${HABIT_HISTORY_DAYS}-day history — consistency compounds`}
right={<NewHabitButton />}
>
{/* Summary stats */}
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
{/* Summary stats — same density fix as Goals (3f062a8) + Memory
(1baa421) + Money (this commit's sibling): 3-col on mobile. */}
<div className="grid grid-cols-3 gap-2 sm:gap-4">
<StatCard label="Active Habits" value={String(active.length)} sub={`${habits.length} total`} />
<StatCard label={`Completions (${HABIT_HISTORY_DAYS}d)`} value={String(totalCompletions)} sub="across all habits" />
<StatCard label="Best Streak" value={bestStreak > 0 ? `${bestStreak}d` : "—"} sub="current longest" />
+5 -1
View File
@@ -98,7 +98,11 @@ export default async function MoneyPage() {
return (
<PageLayout title="Money" subtitle="Subscriptions, bills, and financial commitments" right={<NewSubscriptionButton />}>
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
{/* Same density fix as Goals (3f062a8) + Memory (1baa421): 3-col on
mobile instead of 1-col stack so the user sees all summary stats
at a glance before scrolling. Money values can be long (multi-
currency concat); StatCard handles wrapping. */}
<div className="grid grid-cols-3 gap-2 sm:gap-4">
<StatCard
label="Monthly Burn"
value={[