From 3e7b889e10c08df634e2a9c465449ceda404fc65 Mon Sep 17 00:00:00 2001 From: g-but <41178744+g-but@users.noreply.github.com> Date: Thu, 21 May 2026 05:13:59 +0200 Subject: [PATCH] =?UTF-8?q?fix(mobile):=20/control=20chip=20pickers=20were?= =?UTF-8?q?=2026=E2=80=9334px=20tap=20targets=20=E2=80=94=20extend=20ui-ch?= =?UTF-8?q?ip-toggle=20SSOT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/app/globals.css | 17 ++++++++++++++--- .../control/control-panel-helpers.tsx | 8 +------- src/components/control/control-panel-modals.tsx | 8 +------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 4fb534c4e..feaa0b505 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -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 { diff --git a/src/components/control/control-panel-helpers.tsx b/src/components/control/control-panel-helpers.tsx index dcb232ad4..4c4d29170 100644 --- a/src/components/control/control-panel-helpers.tsx +++ b/src/components/control/control-panel-helpers.tsx @@ -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} diff --git a/src/components/control/control-panel-modals.tsx b/src/components/control/control-panel-modals.tsx index cd3f42a52..61e919906 100644 --- a/src/components/control/control-panel-modals.tsx +++ b/src/components/control/control-panel-modals.tsx @@ -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}