fix(mobile): empty-state add CTAs were 16px tall — extend ui-btn-add with min-h-11

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) <noreply@anthropic.com>
This commit is contained in:
g-butandClaude Opus 4.7 committed 2026-05-21 04:50:21 +02:00
1 parent 4cfed1973c
commit 05315e3a88
6 files changed
+14 -11

No files matched your search

+9 -2
View File
@@ -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 {
@@ -39,7 +39,7 @@ export function AddMilestoneInline({
return (
<button
onClick={() => setOpen(true)}
className="flex items-center gap-1.5 text-xs text-text-tertiary hover:text-status-positive transition-colors mt-1"
className="ui-btn-add-success mt-1"
>
<Plus className="h-3 w-3" /> Add milestone
</button>
@@ -313,7 +313,7 @@ export function OverviewTab({
) : !data.readonly && (
<button
onClick={() => setLoggingActivity(true)}
className="flex items-center gap-1.5 text-xs text-text-tertiary hover:text-status-positive transition-colors mt-2"
className="ui-btn-add-success mt-2"
>
<Plus className="h-3.5 w-3.5" /> Log activity
</button>
@@ -92,7 +92,7 @@ function NewJobForm({
return (
<button
onClick={() => setOpen(true)}
className="flex items-center gap-1.5 text-xs text-text-tertiary hover:text-status-positive transition-colors"
className="ui-btn-add-success"
>
<Plus className="h-3.5 w-3.5" /> New autopilot job for this project
</button>
+1 -1
View File
@@ -40,7 +40,7 @@ export function AddCommitmentButton() {
return (
<button
onClick={() => setOpen(true)}
className="flex items-center gap-1.5 text-xs text-text-tertiary hover:text-status-positive transition-colors mt-2"
className="ui-btn-add-success mt-2"
>
<Plus className="h-3.5 w-3.5" /> Add commitment
</button>
+1 -5
View File
@@ -86,11 +86,7 @@ export function AddHabitForm({
return (
<button
onClick={() => setOpen(true)}
className={
emptyState
? "flex items-center gap-1.5 text-xs text-text-muted hover:text-status-positive transition-colors"
: "flex items-center gap-1.5 text-xs text-text-tertiary hover:text-status-positive transition-colors mt-1"
}
className={emptyState ? "ui-btn-add-success" : "ui-btn-add-success mt-1"}
>
<Plus className="h-3.5 w-3.5" />
{emptyState ? "Add first habit" : "Add habit"}