fix(mobile): bump focused-input font-size to 16px (kills iOS focus-zoom)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 5s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 9s
CI / Detect changes (pull_request) Successful in 10s
E2E Chat / detect-changes (pull_request) Successful in 9s
E2E API Smoke Test / detect-changes (pull_request) Successful in 10s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 10s
Harness Replays / detect-changes (pull_request) Successful in 13s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 18s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 11s
gate-check-v3 / gate-check (pull_request) Successful in 10s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 15s
sop-checklist / na-declarations (pull_request) N/A: (none)
qa-review / approved (pull_request) Failing after 10s
sop-checklist / all-items-acked (pull_request) Successful in 7s
security-review / approved (pull_request) Failing after 7s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 35s
sop-tier-check / tier-check (pull_request) Successful in 7s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 5s
Harness Replays / Harness Replays (pull_request) Successful in 4s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 4s
E2E Chat / E2E Chat (pull_request) Failing after 1m0s
CI / Platform (Go) (pull_request) Successful in 5m9s
CI / Python Lint & Test (pull_request) Successful in 6m9s
CI / Canvas (Next.js) (pull_request) Successful in 6m33s
CI / all-required (pull_request) Successful in 6m34s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 8m0s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
audit-force-merge / audit (pull_request) Successful in 9s

iOS Safari and PWAs auto-zoom the viewport when a focused input or
textarea has a computed font-size below 16px. Two mobile-canvas inputs
were below that bound, causing the layout to jump and look broken on
focus until the user pinched back:

  - MobileSpawn.tsx agent-name input (fontSize: 13.5) — #225
  - MobileChat.tsx composer textarea (fontSize: 14.5) — #224

Both bumped to 16px (the minimum that suppresses focus-zoom). This is
the same class of bug as desktop #1434, scoped here to the mobile
breakpoint.

Tests:
  - MobileSpawn.test: assert agent-name input renders at fontSize >= 16
  - MobileChat.test:  assert composer textarea renders at fontSize >= 16
Both parse the inline style.fontSize (jsdom has no layout engine, so
getComputedStyle reports the inline value verbatim).

Closes #224
Closes #225
This commit is contained in:
2026-05-18 14:34:58 -07:00
parent 03337955ca
commit 679d86a9be
4 changed files with 44 additions and 2 deletions
+6 -1
View File
@@ -756,7 +756,12 @@ export function MobileChat({
border: "none",
outline: "none",
background: "transparent",
fontSize: 14.5,
// iOS Safari/PWA zooms the viewport when a focused textarea
// has a computed font-size below 16px. 14.5 triggers that
// focus-zoom; the page looks broken until the user pinches
// back (#224, same class as desktop #1434 / sibling #225).
// 16px is the minimum that keeps focus from zooming.
fontSize: 16,
lineHeight: 1.4,
color: p.text,
padding: "6px 0",
+6 -1
View File
@@ -318,7 +318,12 @@ export function MobileSpawn({ dark, onClose }: { dark: boolean; onClose: () => v
border: `0.5px solid ${p.border}`,
borderRadius: 12,
fontFamily: MOBILE_FONT_MONO,
fontSize: 13.5,
// iOS Safari/PWA zooms the viewport when a focused input has
// a computed font-size below 16px; the layout jumps and the
// page looks broken until the user pinches back (#224 / #225,
// same class as desktop #1434). 16px is the minimum that
// suppresses that focus-zoom.
fontSize: 16,
color: p.text,
outline: "none",
boxSizing: "border-box",
@@ -263,6 +263,20 @@ describe("MobileChat — composer", () => {
const sendBtn = container.querySelector('[aria-label="Send"]') as HTMLButtonElement;
expect(sendBtn.disabled).toBe(true);
});
// Regression #224: the composer textarea must render with font-size
// ≥ 16px. iOS Safari and PWAs auto-zoom the viewport when a focused
// input has a computed font-size below 16px — the layout jumps and
// the page looks broken until the user pinches back. Same class as
// desktop #1434 / sibling MobileSpawn #225.
it("composer textarea renders at font-size 16px or greater (iOS focus-zoom regression #224)", () => {
const { container } = renderChat(mockAgentId);
const textarea = container.querySelector("textarea") as HTMLTextAreaElement;
expect(textarea).toBeTruthy();
const fs = Number.parseFloat(textarea.style.fontSize);
expect(Number.isFinite(fs)).toBe(true);
expect(fs).toBeGreaterThanOrEqual(16);
});
});
// ─── Tabs ─────────────────────────────────────────────────────────────────────
@@ -93,6 +93,24 @@ describe("MobileSpawn — render", () => {
expect(input).toBeTruthy();
});
// Regression #224 / #225: the agent-name input must render with a
// font-size ≥ 16px. iOS Safari and PWAs auto-zoom the viewport when a
// focused input has a computed font-size below 16px — the layout
// jumps and the page looks broken until the user pinches back.
it("renders the name input at font-size 16px or greater (iOS focus-zoom regression)", () => {
apiGetSpy.mockResolvedValue(mockTemplates);
render(<MobileSpawn dark={true} onClose={vi.fn()} />);
const input = document.querySelector(
'input[aria-label="Agent name"]',
) as HTMLInputElement | null;
expect(input).toBeTruthy();
// Parse the inline style font-size — jsdom doesn't run a layout
// engine, so getComputedStyle reports the inline value verbatim.
const fs = Number.parseFloat(input!.style.fontSize);
expect(Number.isFinite(fs)).toBe(true);
expect(fs).toBeGreaterThanOrEqual(16);
});
it("renders all 4 tier buttons", () => {
apiGetSpy.mockResolvedValue(mockTemplates);
render(<MobileSpawn dark={true} onClose={vi.fn()} />);