Repository navigation
fix(ui): allow pinch-zoom and stop iOS zooming into fields - #332
Conversation
Two zoom defects, one audience: a reader on a phone who needs the text bigger (#322). The standalone shell carried two `name="viewport"` metas. The second won, and it pinned `maximum-scale=1.0, user-scalable=0` — so pinch did nothing on a page whose whole content is a map and an address. They are now one tag, keeping the `viewport-fit=cover` the second one added. Every field was 13px, through `fieldChrome` and the two search fields, so iOS Safari scaled the whole page in on focus. Embedded, that zoom lands on the host's page and nothing of ours can undo it. The fields now floor at 16px below `md` and keep 13px above, which is why the breakpoint is a viewport read rather than one of the container signals: the zoom is the screen's behaviour, not a property of the box a host gave us. Three fields needed reaching individually. cmdk's `CommandInput` and the geocoder fallback carry their own classes. The geocoder's real input takes `font: inherit` from a container sized by `themes.ts`'s `unit`, which is the control's whole spacing scale — so the wrapper overrides the input alone, with `!important`, since the library's sheet meets ours at equal specificity. Measured in Chromium at 390px and 1024px: every text field reads 16px then 13px, and the radios stay 13px, which zoom nothing. `src/styles/mobile-zoom.test.ts` parses every `.tsx` for a focusable text field and holds the floor across all of them, so the next field added cannot quietly reintroduce the bug. Its two stated blind spots are a third-party control styling its own input, and Schedule-X's `.sx__date-input` at 14px — inert only while `globals.css` hides the header it sits in. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mufcf8vRpc7rXQGtHSnn99
The field size is visible to a host, so `CHANGELOG.md` carries it: 16px below 768px, 13px above, no CSP or parameter change. `src/components/AGENTS.md`'s responsive table gains the row, because the breakpoint is a viewport read in a file whose whole argument is that most decisions must not be. The zoom is the screen's behaviour, so the viewport is the right signal here rather than accepted residue. `src/styles/mobile-zoom.test.ts` makes ten specs that inventory `src/` through the shared walk, and three that parse — the counts in `docs/testing.md`, `source-ast.ts` and `source-tree.test.ts` are stated, so they go stale silently. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mufcf8vRpc7rXQGtHSnn99
… prose From the /simplify and /code-review pass over the branch. **The spec could pass on a comment.** Both files it reads back discuss the very classes it matches, so `readSource` let prose satisfy the assertion. Measured: with `text-[16px]` moved into `Select.tsx`'s comment and taken out of the recipe, the old read stayed green. `readSourceWithoutComments` exists for exactly this and now carries both reads. **`toBeGreaterThanOrEqual(6)` bit in one direction only**, against eight real fields, so two could vanish unnoticed. It is a closed inventory now, the shape the other nine `src/` walkers use. Watched red both ways: an unlisted `<input>` added to `fallbacks.tsx`, and a listed one removed. **One comment stated a wrong reason**, which the code-comments rule singles out as worse than no comment. `!` on the geocoder override is not about equal specificity — measured in Chromium, `.wrapper input` (0,1,1) already beats the library's single-class `font: inherit`. It is there because that rule is emitted at runtime under a hashed class, so no source-level reading of it holds. `NON_TEXT_TYPES` drops from ten entries to the two the tree exercises, the AST reads resolve `getText` through the source file rather than through `setParentNodes`, and the comment blocks on `index.html`, `fieldChrome` and `MapSearch` lose the sentences that restate the diff or say the same thing a second place already says. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mufcf8vRpc7rXQGtHSnn99
The ticket's own verification is `grep -n "user-scalable" index.html` returning nothing. The comment quoted both attribute names, so the grep hit prose and a reviewer running the check would read it as the fix not landing. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mufcf8vRpc7rXQGtHSnn99
From the adversarial review of the branch. The floor was keyed to viewport width, and iOS focus zoom is not: it fires on any iPhone whenever the focused field computes under 16px. Every iPhone since the 13 mini is at least 780px wide in landscape, so `md:text-sm` won there and #322 was still live on the surface it was filed about. Measured in Chromium with device emulation, 14 fields per case: | case | before | after | | -------------------------- | ------ | ----- | | 390x844 touch | 16px | 16px | | 932x430 touch (landscape) | 13px | 16px | | 1024x800 mouse | 13px | 13px | | 390x800 mouse | 16px | 16px | So `md:pointer-fine:text-sm` — the 13px scale needs a wide screen AND a fine pointer. That is the hardware question `src/components/AGENTS.md` already answers with `useCoarsePointer()` for `tel:`, asked in CSS. The acceptance criterion still holds literally: below `md` every field is 16px, mouse or not. The geocoder wrapper gains the matching second arm, since CSS has no `or`. Three further corrections the review found: - The `!` on the geocoder override is gone. Measured: `.wrapper input` (0,1,1) already beats the library's single-class `font: inherit`, so neither the old "equal specificity" reason nor the replacement one held. - `showPicker()` does not focus its input — the spec's algorithm has no focus step — so the calendar field's 16px is insurance for the day something can focus it, and now says so. - `RadixSelect.Value` gains `truncate` and its chevron `shrink-0`. A long CMS-authored option label pushed the chevron out of the trigger, which 16px fields reach sooner than 13px ones did. The spec gains two assertions, both watched failing: no field takes the 13px scale back on width alone, and no caller hands a field atom a `text-*` through `className` — tailwind-merge resolves that against the floor and keeps the conditional half, giving 12px on a phone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mufcf8vRpc7rXQGtHSnn99
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | fc34ebf | Oct 25 2026, 09:30 PM |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
CHANGELOG.md was the only conflict: both sides appended a Fixed entry and a link reference at the same position. Kept both, #329 first to hold the section's descending order. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YSji2Rg7xCVgqHownjnZzu
Deploying sahajatlas with
|
| Latest commit: |
fc34ebf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5f23cc39.sahajatlas.pages.dev |
| Branch Preview URL: | https://claude-fix-322-pinch-zoom-fi.sahajatlas.pages.dev |
|
Merged #329 reworks 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of #322: one viewport meta, one floor, the call sites that carry it. Keying the floor to the pointer rather than width alone is the right correction, and the landscape row of the measurement table earns it.
Two things do not hold. The joined RadixSelect.Value change ships nothing — Radix drops className on that component — so the overflow its comment describes is still live and the Summary claims a behaviour the branch does not have. And the floor pair is hand-written at five call sites plus a two-arm wrapper, with a 195-line AST spec standing over the copies; that total is worth one question before it sets.
Contracts: index.html is the iframe embed's own document, so the meta change is host-visible, and CHANGELOG.md carries the field sizes. No CSP, parameter or Permissions-Policy surface moves, so docs/embedding.md needs nothing.
Findings
- should-fix —
Select.tsx:93:classNameonRadixSelect.Valueis discarded; the joined truncate is a no-op. - consider —
Select.tsx:23: five copies of the floor, policed by a spec. One@utilitycollapses both. - consider —
MapSearch.tsx:140: the geocoder is the one field the body never measures.
What was checked
#322 against the diff. @radix-ui/[email protected] dist: SelectValue destructures className/style and forwards neither; git grep of <input|textarea|select|CommandInput> in non-spec src/**/*.tsx returns 9, minus RadioGroup's type="radio" — the spec's inventory of 8 is complete. The seven @utility blocks in globals.css. docs/embedding.md iframe, root-font-size and Permissions-Policy sections.
Not checked: the ## Preview links were not opened and no browser ran — this checkout has no node_modules, so every computed-style claim is the body's own.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`RadixSelect.Value` destructures `className` and `style` out of its props and forwards neither to its `Primitive.span`, so the `truncate` the trigger's comment described was never applied. Measured in Ladle at 390px, with the class on the Value: a long multi-word label wrapped to three lines (72px) in a 40px trigger, and a long single-token one pushed the chevron 110px past the trigger's right edge. The wrapper takes it instead, with `min-w-0` because a flex item's `min-width: auto` refuses to shrink below its text — both labels now clip to one line with the chevron inside. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Bxo878ifUvhrf1CHJmodem
The floor pair was hand-written at four call sites plus `fieldChrome`, with a two-arm wrapper for the geocoder's own input because a class pair has no way to say "narrow OR coarse". One `@utility field-size` is that complement in a single rule, so the wrapper is `[&_input]:field-size` and the spec no longer polices copies that agree. The body rejected this on the grounds that no `@utility` here carries a responsive variant. Measured instead: `@apply text-[16px] md:pointer-fine:text-sm` inside `@utility` emits `font-size: 16px` plus a `(width >= 768px) and (pointer: fine)` override, under an outer `[&_input]:` variant too, and `pnpm build` confines both to `.sy-atlas`. Computed sizes in Ladle across 19 fields of the four field atoms: 16px at 390x844 touch and at 932x430 touch, 13px at 1024x800 with a mouse, and `[&_input]:field-size` reads the same. `pnpm size` is unchanged at 310.7/312.5 KiB. A custom utility emits ahead of the core `text-*` scale, so a caller's `text-xs` outranks the floor rather than merging with it — the same silent defect from the other direction, and the spec still refuses it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Bxo878ifUvhrf1CHJmodem
The select trigger's ellipsis is visible on a host's page, and the #322 entry already owns the field sizing it follows from. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Bxo878ifUvhrf1CHJmodem
|
All three review threads adopted. Branch already contained
Lean gate green (1767). Security review: no findings. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#332 and this branch each added one spec that inventories `src/` and one that reads a single repo file. Each side bumped the shared counts by one, so git merged both edits and left every count one short. CHANGELOG: both `### Fixed` entries and both link references kept — the 16px zoom floor and the drawer scroll are unrelated host-visible fixes. docs/testing.md and the three docblocks: counts re-derived from the merged tree rather than taken from either side — eleven inventories, three of them parsing, fourteen walkers, eight raw-text readers. scripts/select-unit-specs.test.ts: the widest per-edit selection reaches 17, one adopter of `repo-source.ts` from each side, against a ceiling of 16. The spec's own comment names the answer — time the hook and ratchet, never drop a spec — so the ceiling is 18. Timed here at ~3.6s against the 12s budget, and `i18n.ts`'s 12 specs at ~3.5s, which is why the comment now claims width is not time instead of quoting one machine's seconds. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012oxdkGx61u6EaQ13SgYhSX
Summary
index.htmlcarried two viewport metas; the second won and pinned scaling. Now one tag.@utility field-sizecarries that, where five hand-written class pairs did.Change outline
Behaviour — when a field is 16px, and when it is 13px
The floor is keyed to the pointer, not to width alone. Focus zoom is the engine's behaviour, and an iPhone is 932px wide in landscape — a
md:-only floor handed it the 13px scale back and zoomed exactly as before (measured, table below).One rule rather than a class pair is what collapses that last line. A pair had to spell the complement of "wide AND fine" as two arms —
max-md:andpointer-coarse:— because CSS has noor; a utility holding its own nested@mediais that complement already, and composes under an outer variant.Behaviour — a long option label in the select trigger
SelectValuedestructuresclassNameandstyleout of its props and forwards neither to itsPrimitive.span(@radix-ui/[email protected]), so the ellipsis the trigger's comment described was never applied. Measured in Ladle at 390px, with the class on the Value:A spaced label shrinks to its longest word, so it wrapped; an unspaced one could not shrink at all, so it pushed the chevron out. The wrapper fixes both.
Contract — what the standalone shell tells the browser
index.html <head> one meta, where there were two - maximum-scale=1.0, user-scalable=0 # the later tag won, so these were in force viewport-fit=cover, width=device-width, initial-scale=1.0viewport-fit=coveris carried over from the tag that used to win, and is inert either way — nothing in the tree readsenv(safe-area-inset-*).Behaviour — the new inventory spec
src/styles/mobile-zoom.test.tsparses every.tsxfor a focusable text field and holds three properties, each watched failing first:The floor's own definition is now asserted once, in CSS, rather than per call site — so the spec shrank as the mechanism did.
Preview
App preview on this PR's own Workers alias, so each link follows the branch rather than one commit.
classNameof ours reaches, so this is where the wrapper override shows.⚠ The component playground has no linkable preview from here.
Workers Builds: sahajatlas-designwent green for this branch, but Cloudflare posts only a dashboard URL for it — no branch-alias address — and deriving the slug is a guess about a host we do not own. Its own check run has the dashboard link.Test results
test:run(149 files, 1767 passed)mobile-zoom.test.ts9 passed, each changed assertion watched red first —field-sizetaken off theCommandInput,md:pointer-fine:text-smtaken out of the utility, and the geocoder's arm removedpnpm build(assert:css1185 rules confined, 764var()resolved,assert:mapsclean);pnpm size✓ — standalone 310.7/318 KiB, embed 312.5/318 KiB, unchanged by the refactorComputed font sizes, Chromium with device emulation. The four field atoms were measured through Ladle on this branch's build, 19 fields; the geocoder's own input on the deployed preview at
/search.The geocoder's 14px on a mouse is the library's own size, which is correct — the override is only there to lift it off the zoom threshold where focus zoom can fire.
[&_input]:field-sizemeasured identically to a barefield-sizein every case, which is what says the composed class generated rather than silently doing nothing.The acceptance criteria hold:
grep -n "user-scalable" index.htmlreturns nothing, and on the ticket's route at 390×844 no focusable field is under 16px.Manual verification
Everything above was measured in Chromium, which does not implement the behaviour this fixes. A real iOS Safari pass is the one thing that settles it:
[data-vaul-drawer] { touch-action: none }(src/styles/vaul.css) may swallow a pinch that starts inside the panel, and nothing in this branch measured it. If it does, that is a separate ticket..Inputisoverflow: hidden; text-overflow: ellipsis. English fits; a longer CMS locale string that fitted at 14px may now ellipsize.Notes for reviewer
On
user-scalable: iOS Safari has ignoreduser-scalable=noandmaximum-scalefor user zoom since iOS 10, so removing them changes Android Chrome's behaviour, not iPhone pinch. The duplicate-meta defect was real regardless, and the field floor is what fixes iOS.One hazard the utility moves rather than removes. A caller's
text-*throughclassNameis still refused by the spec, for a new reason: tailwind-merge does not knowfield-sizeis a font size, so it keeps both classes, and Tailwind emits every registered@utilityahead of the coretext-*scale — so the caller wins at equal specificity instead of merging. Wrong either way, and the assertion is unchanged; the comment onfieldChromenow states the real mechanism.Findings raised in review and dismissed, with reasons
.sy-atlas input, textarea, selectrule inglobals.cssinstead of a recipe plus five call sites. Genuinely deeper, and rejected: at (0,1,1) it would outrank every field's owntext-*, inverting the baselinehost-reset.cssholds at (0,1,0) precisely so a component keeps winning — andpostcss-scope-widget.mjsrecords a measured injury from that exact selector shape, scoped Preflight's.sy-atlas inputbeating the geocoder's own rule and putting the search icon over the placeholder. It would also close both of the spec's stated blind spots, so it is worth revisiting deliberately rather than as a side effect of this ticket.Widget.translate.test.tsdeliberately refuses to importsource-ast.ts, because that reaches thesrc/walk and would mark it a walker (test(build): the private spec readersreadRepoSourcesupersedes #289). Collapsing all three needs a new module plus a change to the walker register, which is infrastructure work this ticket should not carry.MapSearch.tsxandfallbacks.tsx, coupled in prose by the latter's docblock). The obvious home pulls@mapbox/search-js-reactintofallbacks.tsx's graph, which is the loading path that exists not to mount the geocoder, andpnpm sizebudgets that graph.field-sizetakes the part that was worth sharing; the rest is box chrome.text-[16px]drops--text-sm--letter-spacing(0.36px) below the crossing, sincetext-smsets tracking and an arbitrary size does not. Left as is: tracking normally tightens as size grows, so inheritingnormalat 16px is defensible, and hardcoding 0.36px at a size it was not chosen for is worse.Seven claims this branch corrected after review
Round one:
md:text-smwon there and the ticket's own defect survived on the surface it was filed about.md:pointer-fine:is the fix, and the landscape row of the table above is the evidence.!importanton the geocoder override is gone. Measured:.wrapper input(0,1,1) already beats the library's single-classfont: inherit, so neither the original "equal specificity" reason nor its replacement held.showPicker()does not focus its input — the spec's algorithm has no focus step — so the calendar field's 16px is insurance for the day something can focus it, and the comment says that instead.text-[16px]moved intoSelect.tsx's comment and taken out of the recipe, the old read stayed green. Both reads are comment-stripped now.Round two:
truncateshipped no CSS. Radix'sSelectValuediscardsclassName, so the Summary claimed a behaviour the branch did not have. A wrapper carries it now, and the table above has the two label shapes it fixes.@utilityhere carries a responsive variant" was the wrong reason to decline one.bg-panel-hoverresolves a variant inside@utilityalready — a state one, not a responsive one, so the letter of the claim held and its force did not. Measured instead of argued: the responsive pair emits correctly, composes under[&_input]:, confines to.sy-atlas, and reads 16/16/13 across 19 fields. It is adopted.Closes #322
🤖 Generated with Claude Code
https://claude.ai/code/session_01Bxo878ifUvhrf1CHJmodem