From 0a71e8ffa5aff2ac044dfed75783dbac8522b0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 12 Nov 2026 13:08:45 +0100 Subject: [PATCH] fix(ui): keep the last four small fields at 16 px on a phone The Coach memory editor, the managed profile's handover link, the cycle length fields and the command palette's search set a font size under 16 px on touch screens, so iOS zoomed the page when one took focus. They now read 16 px on a touch screen and keep their smaller size under a fine pointer, like the field primitives. With no field left over, the guard's list of known offenders goes. --- src/__tests__/pwa-mobile-shell-guard.test.ts | 23 +------------------ .../command-palette/command-palette.tsx | 2 +- src/components/cycle/cycle-settings.tsx | 2 +- .../access/managed-profile-handover.tsx | 2 +- .../settings/coach-memory-section.tsx | 1 - 5 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/__tests__/pwa-mobile-shell-guard.test.ts b/src/__tests__/pwa-mobile-shell-guard.test.ts index 89f6eebbb..463402abd 100644 --- a/src/__tests__/pwa-mobile-shell-guard.test.ts +++ b/src/__tests__/pwa-mobile-shell-guard.test.ts @@ -304,20 +304,6 @@ function smallFields( } describe("no field call site goes under 16 px on a touch screen", () => { - /** - * Call sites still under 16 px, fixed by a change of their own. An entry - * that stops matching fails, so the list only shrinks. - */ - const OPEN: Readonly> = { - "components/settings/coach-memory-section.tsx": - "/settings/coach memory editor", - "components/settings/access/managed-profile-handover.tsx": - "read-only handover link field", - "components/cycle/cycle-settings.tsx": "raw cycle-length number field", - "components/command-palette/command-palette.tsx": - "search field shrinks at `md:` without `pointer-fine:`", - }; - const scan = productionSources() .filter((rel) => rel.endsWith(".tsx")) .map((rel) => ({ rel, ...smallFields(rel, readSrc(rel)) })); @@ -349,13 +335,6 @@ describe("no field call site goes under 16 px on a touch screen", () => { }); it("no typed-into field sets a size under 16 px outside a fine pointer", () => { - const offenders = scan - .filter((file) => !(file.rel in OPEN)) - .flatMap((file) => file.small); - expect(offenders).toEqual([]); - }); - - it.each(Object.keys(OPEN))("%s is still open", (rel) => { - expect(scan.find((file) => file.rel === rel)?.small ?? []).not.toEqual([]); + expect(scan.flatMap((file) => file.small)).toEqual([]); }); }); diff --git a/src/components/command-palette/command-palette.tsx b/src/components/command-palette/command-palette.tsx index 5f47241d7..59a814f94 100644 --- a/src/components/command-palette/command-palette.tsx +++ b/src/components/command-palette/command-palette.tsx @@ -329,7 +329,7 @@ export function PaletteBody({ isMobile }: { isMobile: boolean }) { autoCorrect="off" spellCheck={false} enterKeyHint="go" - className="placeholder:text-muted-foreground h-14 min-w-0 flex-1 bg-transparent text-base outline-none md:text-sm" + className="placeholder:text-muted-foreground h-14 min-w-0 flex-1 bg-transparent text-base outline-none md:pointer-fine:text-sm" /> {isMobile ? (