Skip to content

fix(ui): phone form controls render at 16px so iOS doesn't zoom on focus (#4526) - #4527

Open
jordanallenlewis wants to merge 4 commits into
Abilityai:devfrom
jordanallenlewis:fix/4526-phone-input-zoom
Open

jordanallenlewis wants to merge 4 commits into
Abilityai:devfrom
jordanallenlewis:fix/4526-phone-input-zoom

Conversation

@jordanallenlewis

@jordanallenlewis jordanallenlewis commented Nov 12, 2026 •

Copy link
Copy Markdown

Description

On a touch screen ((pointer: coarse), portrait or landscape), text inputs, selects and textareas render at 16px, so iOS Safari doesn't zoom the page when one is focused. Checkboxes, radios and sliders are left alone. A [class] copy of the select and textarea selectors lifts the rule over a single text-* utility. The desktop and a narrow desktop window (fine pointer) keep the dense sizes. The width bound is dropped on purpose: an iPhone in landscape is 667-932px wide and zooms the same way. A tablet with a coarse pointer gets 16px fields too.

The chat composer's ghost-text overlay (ChatInput.vue, used by ChatPanel and PublicChat) gets the same 16px under the same media query so the completion stays on the typed text. A text-xs textarea gets text-sm's 20px line-height at 16px text.

The other common fix, maximum-scale=1 in the viewport tag, also blocks pinch zoom on Android, which fails WCAG 1.4.4, so this doesn't use it.

Related Issue

Fixes #4526

Journey Impact

Journey Impact: none: font size of form fields on touch screens below 640px

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • e2e/phone-input-zoom.spec.js: on a touch screen in portrait (390x844) and landscape (844x390), Operations → Executions, Events and the Tasks tab have text fields and none is under 16px; on the desktop the dense fields stay under 16px. The agent-free cases are tagged @smoke so the CI job runs them.
  • Checked in Chromium emulation (isMobile, hasTouch, coarse pointer) against vite dev with a mocked API, not on a real device: the ghost overlay and the textarea both compute 16px / 24px at 390x844 and 844x390, and a text-xs textarea computes 16px / 20px. Mutation: with style.css restored from dev, all six phone cases fail. A real-device spot check (iPhone, portrait and landscape) would be welcome.
  • Frontend unit suite: 8220 passed. check:tokens and build pass.

jordanallenlewis and others added 3 commits November 12, 2026 14:39
iOS Safari zooms the page in when a focused field's text is under 16px and
leaves it zoomed after blur. Trinity's filters, search boxes and composers use
text-xs / text-sm, so on a phone most text fields zoomed the layout sideways
(4-5 such fields on Operations > Executions, Events and the Tasks tab).

Below sm on a touch screen, text inputs, selects and textareas render at
16px. The desktop keeps its dense sizes.

Tests: e2e on a 390px touch screen finds no text control under 16px on
Operations, Events and Tasks; on the desktop the dense controls stay.
@vybe

vybe commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for this one. A global rule is the right placement (a fieldClasses.js-only fix would miss the hand-rolled controls), and the selector scoping is clean. Two things keep it off today's merge train, validated at 9977248db:

  1. Chat composer ghost text misaligns on phones. src/frontend/src/components/chat/ChatInput.vue:134 and :514-516 pin the autocomplete overlay to 14px to match the textarea exactly. With this rule the textarea (:144) renders at 16px below 640px on a coarse pointer while the overlay stays at 14px, so the ghost completion drifts off the typed text in both ChatPanel and PublicChat. The overlay needs the same 16px under the same media query, checked on a real device.
  2. Phone landscape still zooms. (max-width: 639px) excludes an iPhone in landscape (667-932px wide). Keying on (pointer: coarse) alone would cover it; if there is a reason to keep the width bound, say so in the PR body.

Smaller, same push if you can:

  • e2e/phone-input-zoom.spec.js never runs in CI: the job runs playwright test --grep @smoke and neither title carries the tag (the @interactive at line 8 is in a comment). The agent-free cases can take @smoke.
  • The seven text-xs textareas become 16px text on a 16px line-height; worth a look while you are on a phone.

Setting status-needs-fix; your next push clears it and it rides the next train once fixed.

@vybe vybe added the status-needs-fix PR has an unaddressed review/validation finding; cleared by the author's next push (#2815) label Nov 19, 2026
…om spec in CI (Abilityai#4526)

- Key the 16px form-control rule on (pointer: coarse) alone so an iPhone in
  landscape (667-932px wide) doesn't zoom on focus either.
- Give the chat composer's ghost-text overlay the same 16px under the same
  media query, so the completion stays on the typed text.
- Give a text-xs textarea text-sm's 20px line-height at 16px text.
- Tag the agent-free cases of e2e/phone-input-zoom.spec.js @smoke so CI runs
  them, and add landscape.
@jordanallenlewis

Copy link
Copy Markdown
Author

Pushed f2993cd1d, all four points:

  1. Ghost text. ChatInput.vue now sets the .ghost-overlay to 16px under @media (pointer: coarse), the same query as the textarea rule, so both ChatPanel and PublicChat match. Computed overlay and textarea are both 16px / 24px at 390x844 and 844x390.
  2. Landscape. The rule is keyed on (pointer: coarse) alone; the PR body says why and notes tablets get 16px too.
  3. CI. The Operations, Events and desktop cases carry @smoke in the title (the Tasks case needs an agent, so it stays untagged), and the spec now runs portrait and landscape. With style.css restored from dev, all six phone cases fail.
  4. text-xs textareas. They computed 16px text on a 16px line-height; textarea.text-xs now gets 20px (text-sm's). Looks fine at both sizes.

Checked in Chromium emulation (isMobile, hasTouch, coarse pointer) against vite dev with a mocked API; frontend unit suite 8220 passed, check:tokens and build pass. This was not checked on a real device, so a spot check on an iPhone would be welcome.

I didn't merge dev into the branch this time: the fork's push guard rejects the other authors' commits a merge brings in. I ran the checks on the branch merged with current dev.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status-needs-fix PR has an unaddressed review/validation finding; cleared by the author's next push (#2815)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants