Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsNumberInput (@astryxdesign/core) · View in Storybook
Component Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: No visual change across 2 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Approval is waiting on an engineering owner to provide or identify the governing rule for where focus goes when a NumberInput stepper is pressed: no current Astryx record settles it, and this change makes touch, pen and no-pointer presses step the value without focusing the field while a mouse click still focuses it, alongside open #8015, which hides the steppers on coarse pointers instead. An engineering owner records that decision by commenting /approve-spec ae296ad0c19b0466ab28ac4cb23606bc677ffd53 on this pull request, and the author may do so as an engineering owner. The implementation itself matches its description for touch, pen, mouse and editing presses. Once the rule is settled, the changeset needs one fix: it mentions only a finger or a pen, but clicks with no pointer press (screen-reader activation, a programmatic click()) also stop focusing the field, so either name that path there or narrow the guard to touch and pen.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] NumberInput: a finger or a pen on a number stepper steps the value without focusing the field, so on a phone the on-screen keyboard no longer slides up over the page with every tap. A field that is already being edited stays focused, and a mouse click still focuses the field, so the arrow keys and the wheel keep stepping. |
There was a problem hiding this comment.
This names a finger or a pen, but the guard in NumberInput.tsx (pointerType === 'mouse' && event.detail > 0) also stops focusing the field for clicks with no pointer press or detail 0, such as screen-reader activation or a programmatic click(). If that path stays after the owner's decision, name it here; otherwise narrow the guard to touch and pen.
There was a problem hiding this comment.
Named in d982db5: the changeset now covers a finger, a pen, and an activation with no pointer (a screen reader, a programmatic click()), as the guard and the no-pointer unit test do.
ae296ad to
d982db5
Compare
There was a problem hiding this comment.
Approval is waiting on an engineering owner to settle where focus goes when a NumberInput stepper is pressed: no current Astryx record covers it, and this change makes touch, pen and no-pointer presses (screen-reader activation, a programmatic click()) step the value without focusing the field while a mouse click still focuses it, alongside open #8015, which hides the steppers on coarse pointers instead. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The implementation, its tests and the Changeset match the described behavior, and the earlier Changeset gap about the no-pointer path is fixed, so nothing else is needed if the rule is approved as implemented; if the owner limits it to touch and pen, the guard, the no-pointer unit test and the Changeset need to follow.
[Automated review]
A tap on a number stepper called focus() on the field, and on a phone a focus during a tap brings up the on-screen keyboard: every tap on + slid the decimal pad over the page (iOS 26.2 Safari, measured). UIStepper never becomes first responder. A finger, a pen or assistive technology now steps the value and leaves focus where it was; an editing field stays focused (the press is still default-prevented); a mouse click still focuses the field so the arrow keys and the wheel keep stepping.
d982db5 to
55d4531
Compare
There was a problem hiding this comment.
Approval is waiting on an engineering owner to settle where focus goes when a NumberInput stepper is pressed: no current Astryx record covers it, and this change makes touch, pen and no-pointer presses (screen-reader activation, a programmatic click()) step the value without focusing the field while a mouse click still focuses it, alongside open #8015, which hides the steppers on coarse pointers instead. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The implementation, its tests and the Changeset match the described behavior at this head, so nothing else is needed if the rule is approved as implemented; if the owner limits it to touch and pen, the guard, the no-pointer unit test and the Changeset need to follow.
[Automated review]
ci.yml takes main's: main discovers every *.a11y.chromium.spec.ts (meta#8367), so the NumberInput stepper-focus spec needs no step of its own.
There was a problem hiding this comment.
Approval is waiting on an engineering owner to settle where focus goes when a NumberInput stepper is pressed: no current Astryx record covers it, and this change makes touch, pen and no-pointer presses (screen-reader activation, a programmatic click()) step the value without focusing the field while a mouse click still focuses it, alongside open #8015, which hides the steppers on coarse pointers instead. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The implementation, its tests and the Changeset match the described behavior at this head, including the new double-tap mousedown guard, so nothing else is needed if the rule is approved as implemented; if the owner limits it to touch and pen, the guard, the no-pointer unit test and the Changeset need to follow.
[Automated review]
…cused) Conflict: meta#8173 puts the stepper's pointerdown and mousedown guards on each button; here they live on the column, so the mousedown guard joins the column's pointerdown handler and also covers a double tap in its reach.
… mouse press `component:NumberInput` FR5 states where focus goes when a stepper is pressed: the steppers never take focus themselves; a mouse press moves focus to the input, and a touch, pen, or pointerless press leaves focus where it is, so an input being edited stays focused and a tap raises no on-screen keyboard, as UIStepper does on iOS. The verification map names the four press kinds.
…on a stepper press)
There was a problem hiding this comment.
Approval is waiting on an engineering owner to approve this intentional update to component:NumberInput FR5: today the steppers "keep focus on the input when pressed", and this PR rewrites FR5 so a touch, pen or pointerless press (screen-reader activation, a programmatic click()) steps the value and leaves focus where it is, while a mouse press still focuses the field. That decision also has to settle the pen path on desktop, the screen-reader activation that no longer lands on the field with nothing announcing the new value, and how this relates to open #8015, which hides the steppers on coarse pointers instead. An engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Once it is settled, two small fixes remain:
- Retag the Changeset, since AST-017 FR5 says a change that intentionally replaces a documented contract is not a
[fix]:[feat]if no consumer has to adapt, otherwise[breaking]. - Add
__tests__/NumberInput.stepper-focus.a11y.chromium.spec.tsto the record'sverified_byand to the FR4/FR5 verification row.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] NumberInput: a finger or a pen on a number stepper, and an activation with no pointer (a screen reader, a programmatic `click()`), steps the value without focusing the field, so on a phone the on-screen keyboard no longer slides up over the page with every tap. A field that is already being edited stays focused, and a mouse click still focuses the field, so the arrow keys and the wheel keep stepping. |
There was a problem hiding this comment.
This change intentionally replaces component:NumberInput FR5 ("keep focus on the input when pressed"), and AST-017 FR5 says such a proposal "is not a fix, except an accessibility behavior fix under FR53". Once an engineering owner rules on FR5, retag under AST-017 FR7: [feat] when no consumer scenario has to adapt, [breaking] in the planned minor when one does (FR1).
There was a problem hiding this comment.
Retagged [feat] (patch) in 877accf, since FR5 is a documented contract this changes (spec:AST-017 FR5). The description names the one consumer scenario that could make it [breaking] instead: an onFocus that fired on a stepper press no longer fires for a finger, or for a pen or a pointerless press under a coarse pointer. The record's owner decides that with FR5.
| | FR1, AR1 | `NumberInput.test.tsx` spinbutton-attribute suite; `NumberInput.a11y.chromium.spec.ts` | Bounded, unbounded, formatted | A missing role or ARIA value fails. | `audit:NumberInput/accessibility` | | ||
| | FR2, AR2 | `numberParser.test.ts`; `numberParser.docblock.test.ts`; `NumberInput.test.tsx` invalid-feedback suite | Locales, grouping, invalid text | A misparse, a commit of a guess, or a missing announcement fails. | `audit:NumberInput/behavior` | | ||
| | FR3, ORD1 | `numberInputCommit.test.ts`; `NumberInput.test.tsx` validation, commit-policy, clamping, keyboard-clearing suites | Blur, Enter, empty, clamp, inverted range | A per-keystroke `onChange`, an unclamped commit, or a wrong clear fails. | `audit:NumberInput/behavior` | | ||
| | FR4, FR5, ORD2, AR4, PR1 | `NumberInput.test.tsx` stepping and steppers suites; wheel-listener cases | Keys, wheel, steppers; bounds; empty; precision; mouse, touch, pen, and pointerless presses | A step off the grid, past a bound, or with modifiers fails, as does a mouse press that leaves the input unfocused or a touch, pen, or pointerless press that moves focus. Evidence gap: no test steps from an emptied draft over a value. | `audit:NumberInput/behavior` | |
There was a problem hiding this comment.
Proposed FR5 depends on touch and pen synthesis, which architecture:interaction-modality verifies only in a real browser. Add __tests__/NumberInput.stepper-focus.a11y.chromium.spec.ts to this row and to verified_by, so the record points at its browser proof.
There was a problem hiding this comment.
Done in 2bc7c38: the record's verified_by and the FR4/FR5 verification row name NumberInput.stepper-focus.a11y.chromium.spec.ts, which now also proves a pointerless press under a fine and a coarse primary pointer.
The record's verified_by and the FR4/FR5 verification row name `NumberInput.stepper-focus.a11y.chromium.spec.ts`, which proves the touch and mouse presses in a real browser.
…nput where the primary pointer is fine Where the primary pointer is fine no on-screen keyboard comes up, so a pen press (a desktop tablet's) and an activation with no pointer (a desktop screen reader's, a programmatic `click()`) move focus to the input as a mouse click does: the arrow keys and the wheel keep stepping, and a screen reader reads the new value. A finger never moves focus, and where the primary pointer is coarse neither does a pen or an activation with no pointer. The record's FR5 and its verification row say so, the Changeset is a `[feat]` (a documented contract changes, `spec:AST-017` FR5), and the Chromium spec proves the pointerless case under both pointers.
There was a problem hiding this comment.
Approval is waiting on an engineering owner to approve this intentional update to component:NumberInput FR5: today the steppers "keep focus on the input when pressed", and this PR makes a touch press, and a pen or pointerless press on a coarse pointer, step the value without focusing the field, which also means a phone screen-reader activation no longer lands on the field, onFocus and onBlur stop firing around those presses (deciding [feat] against [breaking]), and the rule overlaps open #8015. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Independently, one fix is needed: the pointer type stored on pointerdown survives a press that never clicks (a mouse press dragged off, a cancelled touch), so the next pointerless click on a fine pointer skips focusing the field; treat a click with event.detail === 0 as pointerless, or clear the stored type on pointercancel, and add a unit test for that sequence.
[Automated review]
| ) => { | ||
| // The stepper never takes focus: an editing field stays focused. | ||
| event.preventDefault(); | ||
| stepperPointerTypeRef.current = event.pointerType; |
There was a problem hiding this comment.
A press that never becomes a click on this stepper (a mouse press dragged off before release, or a touch the browser cancels for a scroll) leaves this type behind, and the next click with no pointer press reads it. On a fine pointer a stale 'mouse' or 'touch' then skips the focus() at line 948, although proposed FR5 (and main) focus the field for a pointerless press there. Treating a click with event.detail === 0 as pointerless in pressStepper, or clearing the ref on pointercancel, fixes it; a unit test that fires pointerDown and then a bare click covers it.
NumberInput.spec.md takes meta#8173's record (FR5 by press kind and pointer, its verification row and verified_by) with this PR's hold amendment re-applied (FR4, the Behavior row, the verification row and verified_by). NumberInput.test.tsx takes meta#8173's focus tests: its touch tap stands for this PR's untracked touch click, and its fine- and coarse-pointer cases replace the pointerless no-focus test FR5 no longer states.
…n a half does With meta#8173's FR5, a pen press and an activation with no pointer focus the field where the primary pointer is fine, as a mouse click does. A press on the column itself (its border) now follows the same rule through one helper (focusAfterPress) instead of focusing for a mouse only; a click no pointer sent there moves no focus, since only a pointer presses the column. The pen tap test follows FR5 under a fine pointer, and a coarse-pointer pen tap steps without focus.
|
Posted by Cindy's agent on her behalf: closed and reopened only to restart this PR's CI on the current workflow after tonight's queue-wide cancel; nothing in the PR changed. |
|
Closing as superseded by #8015: NumberInput's steppers are now hidden under a coarse primary pointer, so a finger's stepper tap no longer happens on phones. |
Review only this PR's change: vjeux/astryx@d07518f...877accf
User need
On a phone, every tap on a NumberInput's + or − focuses the text field, so the number pad slides up over the page and the value that just changed: the visible height drops from 714 to 404 px in iOS Safari.
What led to it: Astryx's touch-presentation work (
spec:AST-094) matches its components to native iOS controls on phones. Comparing NumberInput with UIKit's stepper on the iOS simulator showed the gap: a native stepper never takes focus.Design and alternatives
Open for the owner: should a desktop pen focus like a mouse? Should a screen reader's press focus on a desktop but not on a phone (whether iOS VoiceOver reports a pointer is unmeasured)? Open #8015 hides the steppers on phones instead; this PR works with either.
Current specification
component:NumberInputFR5 ("focus stays on the input"), amended here;architecture:interaction-modalityINV2 leaves the choice to the component.Public delta and caller burden
No API change.
onFocusno longer fires for a finger's stepper press:[feat](patch), or[breaking]if the owner counts that as supported (spec:AST-017FR1).Testing
On a phone, open Storybook's NumberInput "With number steppers" story:
On a desktop, click +: the value goes up and the field takes focus, so the arrow keys step it. Unit tests and a Chromium test cover each input; the new ones fail on
main.Evidence
Recorded on the iOS 26.2 simulator and the Android emulator.
Size (the PR size report's measure, gzip): NumberInput 55.6 → 56.1 KB, CSS unchanged.
Scope
Writing rubric results
R1 narration, R2 research, R4 rejected alternatives, R5 change references, R6 open questions: none in the amended rows. R3 evidence: FR5 cites
spec:AST-085FR1–FR2, UIStepper never taking focus, and current tests.