Repository navigation
fix(core): clamp touch hit areas to TextInput, NumberInput, and Selector frames - #12078
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC |
|---|---|---|
| AppShell | 100.6 kB (+104 B) · 14.9 kB CSS (0) | — |
| CheckboxListItem | 81.7 kB (+95 B) · 12.5 kB CSS (0) | — |
| MobileNav | 78.9 kB (+94 B) · 11.8 kB CSS (0) | — |
105 more components
| Component | Size | LoC |
|---|---|---|
| Carousel | 77.4 kB (+92 B) · 12.1 kB CSS (0) | — |
| DateInput | 204.5 kB (+92 B) · 18.5 kB CSS (0) | — |
| Switch | 110.8 kB (+91 B) · 10.4 kB CSS (0) | — |
| lab/DialogHeroHeader | 91.8 kB (+88 B) · 372 B CSS (0) | — |
| Markdown | 208.0 kB (+86 B) · 23.4 kB CSS (0) | — |
| richtext/RichTextEditor | 310.0 kB (+84 B) · 2.7 kB CSS (0) | — |
| AlertDialog | 131.1 kB (+83 B) · 16.2 kB CSS (0) | — |
| Button | 67.3 kB (+83 B) · 11.1 kB CSS (0) | — |
| Calendar | 78.5 kB (+83 B) · 11.8 kB CSS (0) | — |
| ButtonGroup | 44.6 kB (+82 B) · 3.7 kB CSS (0) | — |
| ListItem | 80.8 kB (+82 B) · 12.5 kB CSS (0) | — |
| lab/CommentComposer | 182.5 kB (+82 B) · 1.9 kB CSS (0) | — |
| TableSelectionToolbar | 77.8 kB (+81 B) · 14.5 kB CSS (0) | — |
| Thumbnail | 71.7 kB (+81 B) · 12.7 kB CSS (0) | — |
| CheckboxInput | 70.7 kB (+79 B) · 10.6 kB CSS (0) | — |
| Pagination | 149.5 kB (+79 B) · 19.7 kB CSS (0) | — |
| TableCell | 106.0 kB (+79 B) · 20.1 kB CSS (0) | — |
| FileInput | 76.3 kB (+78 B) · 12.1 kB CSS (0) | — |
| IconButton | 67.4 kB (+78 B) · 11.1 kB CSS (0) | — |
| MobileNavToggle | 67.6 kB (+78 B) · 11.1 kB CSS (0) | — |
| RadioList | 62.2 kB (+78 B) · 7.6 kB CSS (0) | — |
| ChatDictationButton | 67.9 kB (+77 B) · 11.2 kB CSS (0) | — |
| SideNavItem | 79.4 kB (+77 B) · 12.3 kB CSS (0) | — |
| TextArea | 93.7 kB (+77 B) · 9.8 kB CSS (0) | — |
| lab/PageControl | 78.8 kB (+77 B) · 709 B CSS (0) | — |
| richtext/RichTextView | 287.2 kB (+76 B) · 2.4 kB CSS (0) | — |
| DialogHeader | 70.6 kB (+75 B) · 12.8 kB CSS (0) | — |
| SideNavHeading | 85.0 kB (+75 B) · 12.5 kB CSS (0) | — |
| CodeBlock | 83.4 kB (+73 B) · 12.9 kB CSS (0) | — |
| Field | 60.7 kB (+73 B) · 7.6 kB CSS (0) | — |
| Popover | 101.4 kB (+73 B) · 15.5 kB CSS (0) | — |
| lab/DiffViewer | 95.5 kB (+73 B) · 2.1 kB CSS (0) | — |
| FieldLabel | 56.6 kB (+72 B) · 6.1 kB CSS (0) | — |
| RadioListItem | 77.8 kB (+72 B) · 11.1 kB CSS (0) | — |
| SideNav | 123.7 kB (+72 B) · 12.5 kB CSS (0) | — |
| TableHeaderCell | 105.8 kB (+72 B) · 20.0 kB CSS (0) | — |
| lab/ChatReactionBar | 125.3 kB (+72 B) · 1.1 kB CSS (0) | — |
| lab/TourStep | 96.2 kB (+72 B) · 691 B CSS (0) | — |
| ToggleButton | 94.6 kB (+71 B) · 11.3 kB CSS (0) | — |
| lab/TabBarMoreList | 103.8 kB (+71 B) · 1.8 kB CSS (0) | — |
| ContextMenu | 104.7 kB (+70 B) · 19.6 kB CSS (0) | — |
| InputGroup | 62.3 kB (+70 B) · 8.2 kB CSS (0) | — |
| Table | 123.8 kB (+70 B) · 21.1 kB CSS (0) | — |
| TimeInput | 178.9 kB (+70 B) · 17.5 kB CSS (0) | — |
| TopNavHeading | 84.7 kB (+70 B) · 12.4 kB CSS (0) | — |
| lab/SelectableCardGroup | 70.4 kB (+70 B) · 162 B CSS (0) | — |
| BaseTypeahead | 80.8 kB (+69 B) · 12.1 kB CSS (0) | — |
| MoreMenu | 110.6 kB (+68 B) · 19.8 kB CSS (0) | — |
| Slider | 115.9 kB (+68 B) · 9.2 kB CSS (0) | — |
| lab/VideoPlayer | 233.3 kB (+68 B) · 2.0 kB CSS (0) | — |
| richtext/RichTextEditorToolbar | 311.4 kB (+68 B) · 454 B CSS (0) | — |
| PowerSearch | 314.4 kB (+67 B) · 26.9 kB CSS (0) | — |
| Toast | 106.9 kB (+67 B) · 11.4 kB CSS (0) | — |
| Tokenizer | 109.1 kB (+67 B) · 21.5 kB CSS (0) | — |
| TopNavMenu | 84.2 kB (+67 B) · 12.4 kB CSS (0) | — |
| lab/EmojiPicker | 119.8 kB (+67 B) · 751 B CSS (0) | — |
| ChatLayout | 90.9 kB (+66 B) · 11.7 kB CSS (0) | — |
| DropdownMenu | 110.3 kB (+66 B) · 19.8 kB CSS (0) | — |
| Lightbox | 150.8 kB (+66 B) · 12.3 kB CSS (0) | — |
| Stepper | 69.1 kB (+66 B) · 11.3 kB CSS (0) | — |
| ToggleButtonGroup | 41.9 kB (+66 B) · 3.7 kB CSS (0) | — |
| TopNav | 80.7 kB (+66 B) · 12.1 kB CSS (0) | — |
| lab/TransferListSelector | 147.1 kB (+66 B) · 1.4 kB CSS (0) | — |
| Banner | 69.4 kB (+65 B) · 11.6 kB CSS (0) | — |
| ChatComposerInput | 84.7 kB (+65 B) · 12.5 kB CSS (0) | — |
| ChatComposerTokenElement | 84.7 kB (+65 B) · 12.5 kB CSS (0) | — |
| lab/Comments | 384.4 kB (+65 B) · 2.5 kB CSS (0) | — |
| lab/ListInput | 96.4 kB (+65 B) · 922 B CSS (0) | — |
| BreadcrumbItem | 99.6 kB (+64 B) · 14.0 kB CSS (0) | — |
| lab/Schedule | 117.2 kB (+64 B) · 3.9 kB CSS (0) | — |
| lab/TransferList | 137.9 kB (+64 B) · 1.2 kB CSS (0) | — |
| ChatComposer | 87.1 kB (+63 B) · 13.4 kB CSS (0) | — |
| CheckboxList | 74.5 kB (+63 B) · 8.1 kB CSS (0) | — |
| SegmentedControlItem | 19.1 kB (+63 B) · 4.3 kB CSS (0) | — |
| TextInput | 100.1 kB (+63 B) · 12.4 kB CSS (0) | — |
| lab/CommentThread | 377.4 kB (+63 B) · 2.4 kB CSS (0) | — |
| ChatSendButton | 67.7 kB (+62 B) · 11.1 kB CSS (0) | — |
| DrawerHeader | 70.7 kB (+61 B) · 14.3 kB CSS (0) | — |
| SideNavCollapseButton | 68.2 kB (+61 B) · 11.2 kB CSS (0) | — |
| lab/AudioPlayer | 234.9 kB (+61 B) · 1.8 kB CSS (0) | — |
| NumberInput | 105.0 kB (+60 B) · 12.7 kB CSS (0) | — |
| lab/ChatEmojiPicker | 124.1 kB (+60 B) · 773 B CSS (0) | — |
| lab/MediaFullscreenButton | 225.1 kB (+60 B) · 1.5 kB CSS (0) | — |
| lab/MediaPlaybackRate | 225.1 kB (+60 B) · 1.5 kB CSS (0) | — |
| lab/MediaPlayButton | 225.1 kB (+60 B) · 1.5 kB CSS (0) | — |
| lab/MediaTime | 225.1 kB (+60 B) · 1.5 kB CSS (0) | — |
| ComplexSelector | 80.0 kB (+59 B) · 13.1 kB CSS (0) | — |
| lab/MediaCaptionsButton | 225.1 kB (+59 B) · 1.5 kB CSS (0) | — |
| lab/MediaSeekButton | 225.1 kB (+59 B) · 1.5 kB CSS (0) | — |
| lab/MediaTimeSlider | 225.1 kB (+59 B) · 1.5 kB CSS (0) | — |
| lab/MediaVolume | 225.1 kB (+59 B) · 1.5 kB CSS (0) | — |
| DateRangeInput | 102.3 kB (+58 B) · 13.8 kB CSS (0) | — |
| ChatLayoutScrollButton | 67.9 kB (+57 B) · 11.3 kB CSS (0) | — |
| MultiSelector | 105.0 kB (+56 B) · 18.5 kB CSS (0) | — |
| Selector | 116.5 kB (+56 B) · 19.3 kB CSS (0) | — |
| Typeahead | 90.9 kB (+55 B) · 14.0 kB CSS (0) | — |
| InfoTip | 51.6 kB (+54 B) · 5.7 kB CSS (0) | — |
| TabMenu | 81.2 kB (+52 B) · 12.3 kB CSS (0) | — |
| TopNavMegaMenu | 78.7 kB (+51 B) · 13.0 kB CSS (0) | — |
| DateTimeInput | 228.2 kB (+48 B) · 20.2 kB CSS (0) | — |
| OverflowList | 12.6 kB (+35 B) · 3.7 kB CSS (0) | — |
| lab/TabBar | 84.4 kB (+31 B) · 1.8 kB CSS (0) | — |
| SegmentedControl | 103.3 kB (+28 B) · 7.2 kB CSS (0) | — |
| Timestamp | 31.2 kB (+7 B) · 11.4 kB CSS (0) | — |
| lab/TabBarItem | 3.9 kB (0) · 1.8 kB CSS (0) | — |
Package size: @astryxdesign/core 7.84 MB packed (+295 B); no new dependencies.
Not run on this PR: add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested, for one wording fix: the hit-area change itself checks out against the repository's touch-target rule (a band stops at half the gap to a neighbouring target and never overlaps it), and both new tests fail before the change and pass after it.
- The title "fix(core): clamp touch hit areas to field frames" claims every field, but
FIELD_FRAME_SELECTORinpackages/core/src/utils/hitArea.tscovers only TextInput, NumberInput and Selector while TextArea, DateInput, TimeInput, DateRangeInput, Typeahead, Tokenizer, MultiSelector, ComplexSelector and PowerSearch draw the same control box under their own classes, so please retitle it to name the three fields (as the Changeset already does) or extend the list to the other fields with tests.
CI has not run on this head yet; it starts once a maintainer adds the ci:run label.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claims:
- Changeset: touch hit areas stay clear of TextInput, NumberInput and Selector control frames. Verified: the three stable classes sit on each field's drawn box (
TextInput.tsx:499,NumberInput.tsx:1381,Selector.tsx:2313), andhitArea.ts:298-300adds those boxes as neighbours. - A Button beside these fields could extend its band into the field's border and padding. Verified: the base gives a 6 px band across a 4 px gap (
hitArea.test.ts:348and:373fail on the base; Chromium touch probe). - The neighbour list measured the inner element, not the drawn frame. Verified: the base reads only interactive-selector matches.
- The frame bounds the neighbouring Button while the input and its clear button still separate. Verified:
hitArea.ts:430-442and the first new test. - Each read resolves the frame, so a cached input follows its current frame. Verified:
hitArea.ts:682-689and the second new test (6, then 2, then 6 px). - The touch-target rule limits growth to half the gap without overlap. Verified against the current touch-presentation spec, FR42.
- Two regression tests and a Core patch Changeset. Verified.
- No new API, attributes, observers or event retargeting. Verified: the API surface generator lists no change, and the diff adds no attribute, observer or listener.
- The fixture gets 6 px before and 2 px after. Verified by running the new tests on the base and the head.
- 70 tests pass across the two test files. Verified on the head.
- The build and strict lint pass. Partly verified: the Core, build-tool and theme builds pass, and strict ESLint and Prettier are clean on the changed files; the full build and repository-wide lint were not rerun.
- Chromium touch emulation measures a 2 px band and the field wins at its edge. Verified for TextInput, NumberInput and Selector at 390 px.
- WebKit results, the zero-gap and right-to-left cases, and the spec lookup and pre-review checks. Stated by the author, not rerun.
- Title: touch hit areas clamp to field frames. False: three of the field boxes are covered.
- Changeset: touch hit areas stay clear of TextInput, NumberInput and Selector control frames. Verified: the three stable classes sit on each field's drawn box (
- Files:
.changeset/fix-field-hit-area-boundaries.md: clear.packages/core/src/utils/hitArea.test.ts: clear.packages/core/src/utils/hitArea.ts: clear; its three-class list is what the title overstates.
b4df5f8 to
dd17947
Compare
There was a problem hiding this comment.
Approved pending CI. The hit-area change checks out against the repository's touch-target rule (a band stops at half the gap to a neighbouring target and never overlaps it), both new tests fail before the change and pass after it, and the new title fixes the one point from the last review. CI has not run on this head yet: a maintainer adds the ci:run label, which takes effect on the next push or a close and reopen.
Claims and files checked
Review mode: full; reason: other:retitled since the last review with the patch unchanged
- Claims:
- Title: touch hit areas are clamped to TextInput, NumberInput and Selector frames. Verified:
FIELD_FRAME_SELECTOR(hitArea.ts:298-300) lists exactly those classes, which sit on each field's drawn box (TextInput.tsx:499,NumberInput.tsx:1381,Selector.tsx:2313). - Changeset: touch hit areas stay clear of the three control frames. Verified, with the same evidence.
- A Button beside these fields could extend its band into the field's border and padding, so a touch on the field's edge reached the Button. Verified on the base: a 6 px band across a 4 px gap, and a touch 1 px inside each field's edge activates the neighbouring IconButton.
- The neighbour list measured the inner element, not the drawn frame. Verified: the base reads only interactive-selector matches.
- The frame bounds the neighbouring Button while inner targets still separate the input and its clear button. Verified:
hitArea.ts:679-691with the existing ancestor check, and the first new test. - Frames are resolved on each read, so a cached input follows its current frame. Verified: the second new test (6, then 2, then 6 px).
- The touch-target rule limits growth to half the gap, without overlap or a change to the drawn size. Verified against the current touch-presentation spec.
- Two regression tests and a Core patch Changeset, with no new API, attributes, observers or event retargeting. Verified: the API surface generator lists no change, and the diff adds no attribute, observer or listener.
- The unit fixture gets a 6 px band before and 2 px after. Verified: both new tests fail on the base and pass on the head.
- 70 tests pass across the two test files. Verified on the head, and on the head merged into main.
- The build and strict lint pass. Partly verified: the build-tool, Core and theme builds pass, and ESLint, Prettier and the Changeset check are clean on the changed files; the full root build and repository-wide lint were not rerun.
- Chromium touch emulation measures a 2 px band, the field wins at its edge, and a trusted edge touch still focuses the Button with its activation cancelled. Verified for TextInput and NumberInput; on Selector the same touch opens the Selector.
- WebKit results (horizontal, vertical and zero-gap boundaries, NumberInput, Selector, right-to-left, clear and chevron controls, fine pointer), the spec lookup and the pre-review check. Stated by the author, not rerun.
- Public text has no internal context. Verified.
- Title: touch hit areas are clamped to TextInput, NumberInput and Selector frames. Verified:
- Files:
.changeset/fix-field-hit-area-boundaries.md: clear.packages/core/src/utils/hitArea.ts: clear.packages/core/src/utils/hitArea.test.ts: clear.
There was a problem hiding this comment.
Approved pending CI. The hit-area change checks out against the repository's touch-target rule (a band stops at half the gap to a neighbouring target and never overlaps it): both new tests fail before the change and pass after it, and on this head a tap on the edge of a TextInput, NumberInput or Selector no longer activates the button beside it. CI has not run on this head yet: a maintainer adds the ci:run label so CI runs, and the label takes effect on the next push or a close and reopen.
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- Claims:
- Title: touch hit areas are clamped to TextInput, NumberInput and Selector frames. Verified:
FIELD_FRAME_SELECTOR(hitArea.ts:300-302) lists exactly those stable classes, which sit on each field's control box (TextInput.tsx:499,NumberInput.tsx:1383,Selector.tsx:2343). - Changeset: touch hit areas stay clear of the three control frames. Verified with the same evidence; the changeset check accepts it.
- With a coarse pointer, a Button beside these fields could extend its band into the field's border and padding, so a touch on the field's edge reached the Button. Verified on the base: a 6 px band across a 4 px gap, and a tap 1 px inside each field's edge activates the neighbouring button.
- The neighbour list measured the inner element, not the drawn frame. Verified: the base reads only interactive-selector matches.
- The frame bounds the neighbouring Button while inner targets still separate the input and its clear button. Verified:
hitArea.ts:716-728with the existing ancestor check (hitArea.ts:432-444), and the first new test. - Frames are resolved on each read, so a cached input follows its current frame after reparenting. Verified: the second new test (6, then 2, then 6 px).
- The touch-target rule limits growth to half the gap, without overlap or a change to the drawn size. Verified against the current touch-presentation spec.
- Two regression tests and a Core patch changeset, with no new API, attributes, observers or event retargeting. Verified: the API surface generator lists no change across the build tool, Core and the seven themes, and the diff adds no attribute, observer or listener.
- The unit fixture gets a 6 px band before the change and 2 px after it. Verified: both new tests fail on the base and pass on the head.
- Chromium touch emulation measures a 2 px band and the field wins hit-testing at its edge, while a trusted edge touch still focuses the Button with its activation cancelled. Verified on this head for TextInput and NumberInput; on Selector the same tap opens the Selector.
- WebKit results (horizontal, vertical and zero-gap boundaries, NumberInput, Selector, right-to-left, clear and chevron controls, fine pointer). Stated by the author, not rerun.
- 70 tests pass across the two test files. Verified on this head.
- The build and strict lint pass. Partly verified: the build-tool, Core and theme builds pass, and ESLint and Prettier are clean on the changed files; the full root build and repository-wide lint were not rerun.
- The spec lookup and the pre-review check pass. Stated by the author, not rerun.
- Public text contains no internal context. Verified.
- Title: touch hit areas are clamped to TextInput, NumberInput and Selector frames. Verified:
- Files:
.changeset/fix-field-hit-area-boundaries.md: clear.packages/core/src/utils/hitArea.ts: clear.packages/core/src/utils/hitArea.test.ts: clear.
|
/approve-spec 2e12403 |
|
🤖 (Posted by Cindy's agent.) Merged, thank you @korkt-kim! With a touch pointer, a Button beside a TextInput, NumberInput or Selector now stops its invisible hit area at half the gap to the field's drawn frame, so a touch on the field's edge reaches the field. It ships in the next release, with you credited. |
User impact
With a coarse primary pointer, a Button beside a TextInput, NumberInput, or Selector can extend its invisible hit area into the field's border and padding. A person touching the field edge can reach the Button instead of the field.
Refs #12028.
Problem and solution fit
The neighbor list measures the inner interactive element, not the field's drawn frame. That overstates the available gap and lets the Button's hit area extend too far toward the field.
Include the nearest field frame in each candidate read, alongside the existing inner targets. The frame bounds the neighboring Button, while the inner targets still separate controls such as an input and its clear button. Resolve ownership on each read so a cached input follows its current frame after reparenting.
Expected behavior and authority
AST-094 FR42 limits coarse-pointer expansion to half the gap to a neighboring target, without overlapping that target or changing the drawn control size.
Smallest restoration
Evidence
elementFromPointreturns the field at its edge. A trusted edge touch still targets and focuses Button rather than the input; Button activation is canceled. This change does not retarget that touch or restore input focus on that path.Scope
Components: shared hit-area utility; Button boundaries beside TextInput, NumberInput, and Selector.
Testing
pnpm exec vitest run packages/core/src/utils/hitArea.test.ts packages/core/src/Button/Button.hitArea.test.tsx --project ui— 70 tests passed across two files.pnpm build— passed.pnpm lint:strict— passed.pnpm specs:for --diff origin/main— passed.pnpm review:pre— no automated findings.