fix(ui): meet 44px touch-target floor on shared mobile primitives

The desktop/mobile consistency review found primary mobile controls
rendering below the ~44px comfortable touch floor. Address the genuinely
shared primitives in one pass:

- Add a --tap-min: 44px token (documented anchor for the floor).
- tokens.css: text inputs, selects, and submit buttons grow to --tap-min
  under the 640px breakpoint (fixes the 36px auth/login form controls).
  Scoped to form controls + type=submit so dense icon buttons aren't
  inflated.
- SegmentedControl: .seg options reach the floor on mobile (it doubles as
  the catalog sort toggle and the Library tab switcher).
- Chip: expand .chip-remove's tappable area to --tap-min via a centered
  pseudo-element so the 16px glyph stays compact and tag rows don't grow.

Pure-CSS responsive change — jsdom can't evaluate @media or layout, so the
test pins the stylesheet contract (each shared primitive bumps to --tap-min
inside the mobile breakpoint), guarding against the bump being dropped.

The per-route .icon-btn (copy-pasted across seven files) is left for a
separate refactor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-06-25 07:34:21 +02:00
parent dee53fa212
commit 194adf1339
7 changed files with 134 additions and 3 deletions

View File

@@ -125,4 +125,24 @@
background: var(--danger-soft-bg);
color: var(--danger);
}
/* On touch the 16px glyph is far below the tap floor. Rather than grow
the chip (which would inflate every tag row), overlay an invisible,
centered hit area sized to --tap-min — the glyph stays compact while
the tappable region reaches a comfortable size. */
@media (max-width: 640px) {
.chip-remove {
position: relative;
}
.chip-remove::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
min-width: var(--tap-min);
min-height: var(--tap-min);
}
}
</style>

View File

@@ -126,4 +126,13 @@
color: var(--text);
box-shadow: var(--shadow-sm);
}
/* This control doubles as the primary sort toggle (catalog) and the
Library tab switcher on mobile, so its options must meet the touch
floor on phones. */
@media (max-width: 640px) {
.seg {
min-height: var(--tap-min);
}
}
</style>