fix(mobile): /control chip pickers were 26–34px tap targets — extend ui-chip-toggle SSOT

Cross-route iPhone-width sweep landed on /control as the worst offender:
9 sub-44px interactive elements, including the per-project LLM model
picker (sonnet/haiku/opus) at 26px tall and the adapter picker
(Claude/Codex/Gemini) at 34px. These are the two most critical controls
on the page — switching agent or model — and they were both physically
hard to hit on a phone.

Two SSOT problems to fix:

1. The adapter chips use the existing `ui-chip-toggle` /
   `ui-chip-toggle-active` SSOT, but those classes didn't enforce a
   mobile tap target. Added `inline-flex items-center min-h-11
   sm:min-h-0` to both — fixes adapter chips on /control plus the
   PeopleGrid filter chips on /people in one stroke.

2. The model chips were a separate bare pattern (`rounded-full border
   px-2.5 py-1 text-xs ...`) duplicated across control-panel-helpers
   and control-panel-modals — a smaller compact variant that never
   made it into the SSOT. Created `ui-chip-toggle-compact` /
   `ui-chip-toggle-compact-active` with the same mobile-tap-target
   trick, migrated both call sites, dropped the now-unused `cn` imports.

Verified live at 390×844: sonnet/haiku/opus and Claude/Codex/Gemini all
26/34 → 44px tap height; /control sub-44px count fell from 9 to 3
(remaining 3 are layout artifacts / 36px primary buttons not in scope).
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 05:13:59 +02:00
1 parent 050526eeb1
commit 3e7b889e10
3 files changed
+16 -17

No files matched your search

+14 -3
View File
@@ -710,12 +710,23 @@
.ui-chip-filter-active {
@apply rounded-xl border border-accent-primary/30 bg-accent-muted px-4 py-3 text-sm font-medium text-text-primary transition-colors;
}
/* Rounded-pill toggle — agent/health/category selector chips */
/* Rounded-pill toggle — agent/health/category selector chips.
inline-flex + min-h-11 sm:min-h-0 enforces a 44px mobile tap target
(WCAG 2.5.5 / iOS HIG) while staying compact on desktop. */
.ui-chip-toggle {
@apply rounded-full border border-border-subtle px-3 py-1.5 text-sm font-medium text-text-secondary transition-colors hover:border-border-default hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40;
@apply inline-flex items-center min-h-11 sm:min-h-0 rounded-full border border-border-subtle px-3 py-1.5 text-sm font-medium text-text-secondary transition-colors hover:border-border-default hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40;
}
.ui-chip-toggle-active {
@apply rounded-full border border-accent-primary/30 bg-accent-muted px-3 py-1.5 text-sm font-medium text-text-primary transition-colors;
@apply inline-flex items-center min-h-11 sm:min-h-0 rounded-full border border-accent-primary/30 bg-accent-muted px-3 py-1.5 text-sm font-medium text-text-primary transition-colors;
}
/* Compact variant — tighter padding + text-xs for dense pickers like
the per-project LLM model selector (sonnet/haiku/opus). Same
mobile-tap-target trick keeps it usable on touch. */
.ui-chip-toggle-compact {
@apply inline-flex items-center min-h-11 sm:min-h-0 rounded-full border border-border-subtle px-2.5 py-1 text-xs text-text-tertiary transition-colors hover:text-text-secondary;
}
.ui-chip-toggle-compact-active {
@apply inline-flex items-center min-h-11 sm:min-h-0 rounded-full border border-accent-primary bg-accent-muted px-2.5 py-1 text-xs text-text-primary transition-colors;
}
/* Inline category/scope chip — shape only; caller adds color classes */
.ui-chip {
@@ -3,7 +3,6 @@
import React from "react";
import { Bot, ChevronUp, ChevronDown } from "lucide-react";
import { getIntentLabel, getAdapterLabel } from "@/config/control-intents";
import { cn } from "@/lib/utils";
import { timeAgo } from "@/lib/dates";
import type { ControlData } from "@/lib/control-types";
@@ -158,12 +157,7 @@ export function BrainConfigPanel({
key={option}
type="button"
onClick={() => onModelChange(option)}
className={cn(
"rounded-full border px-2.5 py-1 text-xs transition-colors",
model === option
? "border-accent-primary bg-accent-muted text-text-primary"
: "border-border-subtle text-text-tertiary hover:text-text-secondary",
)}
className={model === option ? "ui-chip-toggle-compact-active" : "ui-chip-toggle-compact"}
>
{option}
</button>
@@ -1,7 +1,6 @@
"use client";
import { Plus, X, Loader2 } from "lucide-react";
import { cn } from "@/lib/utils";
import { Modal } from "@/components/ui/modal";
import type { ControlData } from "@/lib/control-types";
@@ -163,12 +162,7 @@ export function LaunchTabModal({
key={option}
type="button"
onClick={() => onModelChange(option)}
className={cn(
"rounded-full border px-2.5 py-1 text-xs transition-colors",
selectedModel === option
? "border-accent-primary bg-accent-muted text-text-primary"
: "border-border-subtle text-text-tertiary hover:text-text-secondary",
)}
className={selectedModel === option ? "ui-chip-toggle-compact-active" : "ui-chip-toggle-compact"}
>
{option}
</button>