From 05315e3a8873d41cda4cc10be4e03f0783032e58 Mon Sep 17 00:00:00 2001 From: g-but <41178744+g-but@users.noreply.github.com> Date: Thu, 21 May 2026 04:50:21 +0200 Subject: [PATCH] =?UTF-8?q?fix(mobile):=20empty-state=20add=20CTAs=20were?= =?UTF-8?q?=2016px=20tall=20=E2=80=94=20extend=20ui-btn-add=20with=20min-h?= =?UTF-8?q?-11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Live audit at iPhone width caught the next broken-but-tolerated UX trap: the primary CTA in the habits empty state ("Add first habit"), the commitments empty state ("Add commitment"), and four sibling spots (milestones, log activity, new autopilot job, etc.) were 16px tall — far below the WCAG 2.5.5 / iOS HIG 44px minimum. A new mobile user landing on /today with zero habits literally had a 16-pixel tap target to add their first one. Root cause: six places copy-pasted the same `flex items-center gap-1.5 text-xs text-text-tertiary hover:text-status-positive transition-colors` string when the codebase already had `ui-btn-add` for this shape. They diverged on hover color (status-positive green vs accent-text yellow), which was a real semantic intent: achievement-flavored "create something good" vs generic "add a thing." Fix: • ui-btn-add now has `min-h-11 sm:min-h-0` — mobile gets a real 44px tap target, desktop keeps the tight one-line look since hover is reliable there. Same trick as ui-btn-ready-primary. • New ui-btn-add-success sibling carries the green hover for habits, commitments, milestones, goal activity, and project prompts. • Migrated all six bare-pattern sites to the new class. Verified live at 390×844 (iPhone 14): "Add first habit" and "Add commitment" went from 16 → 44px tap height. tsc + eslint clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/globals.css | 11 +++++++++-- src/components/goals/goal-milestone-helpers.tsx | 2 +- src/components/projects/ProjectOverviewTab.tsx | 2 +- src/components/projects/ProjectPromptsTab.tsx | 2 +- src/components/today/AddCommitmentButton.tsx | 2 +- src/components/today/AddHabitForm.tsx | 6 +----- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 5bec713b7..baef81560 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -663,9 +663,16 @@ .ui-tab-badge-active { @apply bg-status-positive-subtle text-status-positive; } - /* Text + icon "add" link button */ + /* Text + icon "add" link button. + min-h-11 (44px) on mobile gives a real WCAG 2.5.5 tap target; + sm:min-h-0 collapses to natural line height on desktop where hover is reliable. */ .ui-btn-add { - @apply flex items-center gap-1.5 text-xs text-text-muted transition-colors hover:text-accent-text; + @apply flex items-center gap-1.5 min-h-11 sm:min-h-0 text-xs text-text-muted transition-colors hover:text-accent-text; + } + /* Same shape, but achievement-flavored sites (habits, commitments, milestones, goals) + hover green to read as "create something good" rather than generic accent. */ + .ui-btn-add-success { + @apply flex items-center gap-1.5 min-h-11 sm:min-h-0 text-xs text-text-tertiary transition-colors hover:text-status-positive; } /* Full-width accent submit button (modal forms) */ .ui-btn-submit { diff --git a/src/components/goals/goal-milestone-helpers.tsx b/src/components/goals/goal-milestone-helpers.tsx index 51dda327c..3926617e5 100644 --- a/src/components/goals/goal-milestone-helpers.tsx +++ b/src/components/goals/goal-milestone-helpers.tsx @@ -39,7 +39,7 @@ export function AddMilestoneInline({ return ( diff --git a/src/components/projects/ProjectOverviewTab.tsx b/src/components/projects/ProjectOverviewTab.tsx index 13828a758..8d3d91d35 100644 --- a/src/components/projects/ProjectOverviewTab.tsx +++ b/src/components/projects/ProjectOverviewTab.tsx @@ -313,7 +313,7 @@ export function OverviewTab({ ) : !data.readonly && ( diff --git a/src/components/projects/ProjectPromptsTab.tsx b/src/components/projects/ProjectPromptsTab.tsx index 92d3345b0..68d92a14d 100644 --- a/src/components/projects/ProjectPromptsTab.tsx +++ b/src/components/projects/ProjectPromptsTab.tsx @@ -92,7 +92,7 @@ function NewJobForm({ return ( diff --git a/src/components/today/AddCommitmentButton.tsx b/src/components/today/AddCommitmentButton.tsx index c26daa178..56083ae7d 100644 --- a/src/components/today/AddCommitmentButton.tsx +++ b/src/components/today/AddCommitmentButton.tsx @@ -40,7 +40,7 @@ export function AddCommitmentButton() { return ( diff --git a/src/components/today/AddHabitForm.tsx b/src/components/today/AddHabitForm.tsx index dc511972a..a9b9d0fb0 100644 --- a/src/components/today/AddHabitForm.tsx +++ b/src/components/today/AddHabitForm.tsx @@ -86,11 +86,7 @@ export function AddHabitForm({ return (