Repository navigation
Measure links, text inputs and dialog buttons at 44px on a phone - #260
Merged
Merged
Conversation
A phone canvas never measured a link, a text-input, a modal's buttons or a toast's action, so a 32px field passed silently. text-input gains size lg (44) and modal and toast gain controlSize (the button size names); the mobile-touch-target census measures all four.
A short labelled link at height 44 rendered 26px wide and the phone census passed it, since its width was unknown. Verify round 1 fixes and docs.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 32 slice E (
docs/specs/PHASE-32-SPEC.md, FR-E1 to FR-E3, with the contracts pinned in the spec's R1 to R9 block and both verify rounds recorded after it).The problem
On a canvas declared
mobile, the 44px touch rule (mobile-touch-target) measured the four controls and the phone primitives only. Alink, atext-input, a modal's close button and actions, and a toast's action were measured at no floor at all, so a 32px field or a 24px "Undo" passed andcanvas_evaluatesaid READY. A text-input had no 44px size, and a modal or toast had no way to reach 44, so the docs sent every phone dialog tosheet.What changed
text-inputtakessize: "lg", 44px tall.smstays 32 andmd40. A multi-line field is stillrows× 20 + 12.modalandtoasttakecontrolSize. It uses the button size names and heights (xs24,sm32,md44,lg52). On a modal it sizes the close button (a square) and every action; on a toast, the action. The defaults are today's sizes (smon a modal,xson a toast), and any other value, including inherited names such asconstructor, falls back to them. WithoutcontrolSizea modal and a toast render byte-identical to before, on every type.sizeon a modal still means its width.mobile-touch-targeterror when it is below 44, with a suggestion naming the fix (height: 44,size: "lg",controlSize: "md"). Disabled targets count, as disabled buttons already did on a phone. A link or text-input beside a control means the control no longer owns its row. Web and desktop-app keep their 24px rule unchanged.sheet. A centred modal withcontrolSize: "md"is a valid phone dialog;sheetstays the choice for a panel that rises from the bottom. A link inside a sentence stays a text node'slinksrange, which is exempt.Decisions the spec text did not settle
heightis never narrower than tall, as a button already is. Before this, a link withheight: 44and a short label ("Edit") rendered about 26px wide and the rule passed it, because the link's width was unknown. It now rendersmin-widthequal to its height and centres its label when it sets no width. A link without a numericheightrenders exactly as before. A layout that gave a link a width smaller than its height moves.Verdicts that moved
test/unit/test-desktop-primitives.tslinkon a phone raises no touch finding.nav-itemstill is not measured there.No mobile realisation uses a link, text-input, modal or toast, so the mobile pattern gate and the Ridgeline run are unchanged and pass. On web and desktop-app a link with a numeric height under 24 and a narrower width now passes the 24px floor, since it renders 24 wide.
Not fixed here
fontSize, still measures itsheight, so it errors untilheight: 44is set. A text-input's fluid width ("10%") is not judged. The docs say so.height: 44inside a parent narrower than 44 overflows it, and nothing reports that.Tests
test/unit/test-phone-targets.ts: every FR-E1 to FR-E3 acceptance on a phone, each passing case with a failing twin, the fallbacks for invalidcontrolSize, the row rule, disabled targets, the exact suggestions, and web and desktop-app untouched.test/unit/test-overlays.ts: byte-identity against the pre-slice render on web, mobile and desktop-app, and the 44px markup atcontrolSize: "md".test/unit/test-desktop-primitives.ts:lg, and the link'smin-widthwith its twins.test/browser/test-overlays-render.ts: the modal's and toast's controls measured in Chrome at 32/24 and at 44.test/browser/test-desktop-primitives-render.ts: short links atheight: 44render 44 wide; a link without a height still hugs its label.