Repository navigation
feat(NumberInput): hide compact steppers on coarse pointers - #8015
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Approval needs an engineering owner to provide or identify the governing spec for this addition: no current record decides whether NumberInput's hasNumberSteppers buttons should be hidden on every device whose primary pointer is coarse, at any viewport width and with no opt-out. Any engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and as an engineering owner you can record it yourself; a new commit invalidates it, so push the fixes below first. Two fixes are needed either way:
NumberInput.coarse-pointer.a11y.chromium.spec.ts:61fails the core typecheck (Property 'dir' does not exist on type 'HTMLElement | SVGElement'), which turns thetypecheckandbuildchecks red;element.setAttribute('dir', dir)avoids it.- The patch
[fix]Changeset does not fit an intentional change to documented behavior (AST-017 FR5 and FR33): with the buttons leaving the accessibility tree on coarse pointers and no opt-out, FR1 classifies it as[breaking], with migration notes, for a minor release.
[Automated review]
| }); | ||
| for (const direction of ['ltr', 'rtl']) { | ||
| await control.evaluate((element, dir) => { | ||
| element.dir = dir; |
There was a problem hiding this comment.
Playwright types element as HTMLElement | SVGElement here, so tsc reports TS2339 and the core typecheck (and the aggregate build) check fails. element.setAttribute('dir', dir) keeps the same behavior and type-checks.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] Hide NumberInput’s compact stepper buttons on coarse pointers while preserving direct entry, keyboard stepping, and themed end padding. |
There was a problem hiding this comment.
This intentionally changes the documented behavior of hasNumberSteppers, so AST-017 FR5 and FR33 say it is not a [fix]. With both buttons leaving the accessibility tree on coarse pointers and no opt-out, FR1 classifies it as [breaking] with migration notes for a minor release, once the direction is approved.
…S keyboard (#8183) ## User impact On an iPhone, tapping the clear button of a TextInput or NumberInput that is not focused empties the field and focuses it, but no keyboard comes up. The person has to tap the field again to type the replacement they cleared the field for. ## Problem and solution fit Since #5440, the clear button's pointer path focuses the field a frame later (`requestAnimationFrame`). iOS Safari raises its keyboard only for a focus made while handling the touch, so the later focus lands with no keyboard. #5440 deferred the focus to avoid a page jump to the top. `preventScroll`, which that change also added, is what prevents the jump; the deferral only broke the keyboard. This change keeps `preventScroll` and focuses inside the tap. ## Expected behavior and authority UIKit's clear button makes its field the first responder: in a UIKit app on iOS 26.2 the keyboard starts rising 75 ms after the lift. No current record says otherwise; #5440 is the regression history. Siblings: #8158 makes the same change in PanelSearchInput; #6425, #7690, #7910, #7940 (TextInput) and #5978, #8015 (NumberInput) touch the same files with other intents. ## Smallest restoration Two lines in each of TextInput and NumberInput: the pointer path calls `focus({preventScroll: true})` directly instead of in the next frame. The keyboard and assistive-technology path (`detail === 0`) is unchanged, as is the clear button's `preventDefault` on pointerdown, which keeps a focused field focused. DateInput, TimeInput, DateTimeInput and FileInput have the same pattern; their lanes own them. ## Evidence Mobile Safari, iOS 26.2 (simulator), page scrolled 254 px, field unfocused with a value, one tap on its clear button: | | keyboard | page scroll | | --- | --- | --- | | TextInput before | none (viewport stays 714) | stays 254 | | TextInput after | up (viewport 714 → 377) | stays 254 | | NumberInput before | none | stays 254 | | NumberInput after | number pad (714 → 404) | 254 → 266: Safari reveals the field the pad would cover |  - Regression tests: the pointer path focuses synchronously, with `preventScroll`, and without `requestAnimationFrame`. This replaces the test that pinned the deferral. ## Scope - [x] One defect is restored. - [x] Separable contradictory or unsettled tagalongs were removed or split. - [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label. - [x] Public text and artifacts contain no internal Meta context. ## Testing - `pnpm vitest run` on TextInput, NumberInput and Field: 15 files, 600 tests. - Core typecheck, eslint and prettier on touched files, `check:changesets`. - Mobile Safari on the iOS 26.2 simulator (iPhone 17 Pro): the four runs above, with visual viewport, focus and scroll events read from the page.
… platform (#8274) ## Exact decision needed What "compact" means when a component picks a presentation by screen size, and whether it differs by platform. ## Existing authority searched - `spec:AST-012` FR1–FR2: width points (`md` is 768) and a closed `when` vocabulary with no height field. - `architecture:public-component-api` INV14 and change coupling: components keep no parallel hardcoded breakpoint table. - `component:Selector` FR4: `adaptive` uses the sheet on "compact coarse-pointer screens", with no number. - `design:mobile-typography` DR3 uses `(width < 1024px) and (pointer: coarse)` for text sizing, a separate concern this PR leaves alone. - No current record defines compact. Code uses `(max-width: 768px) and (pointer: coarse)`. - Search terms: compact, 744, 768, height 500, size class, adaptive, coarse pointer, breakpoint. Overlapping open pull requests: #8062 (shared touch resolver and its compact query), #8052 (AST-094 resolver), #8015 (NumberInput steppers on coarse pointers; not a size test), #6817 (compact density, a different meaning), #8089, #8104, #8095 (phone presentations that consume the resolver). ## Decision - `spec:AST-012` FR9 / DEC-6: a screen is compact while its width is below the effective `md` point or its height is below 500, with the same numbers on every platform (CSS px on the web, pt on iOS, dp on Android); native does not map compact to platform size classes. The theme exports this one definition; the web touch presentation resolver, Selector's `adaptive` presentation, and `@astryxdesign/native` all use it. - `spec:AST-012` FR2: `when` gains `height`, accepting only `{below: 500}`. - `architecture:public-component-api` INV17: a component that chooses a presentation by screen size uses that definition and keeps no numbers of its own. - `spec:AST-082` FR18: `PortableTheme` carries the compact definition, so native reads the same numbers; FR11 and `spec:AST-093` FR3: a native choice between presentations by screen size uses it, not size classes, while the platform's own control still presents the surface. - Compact governs presentation choice only; a layout width a caller picks, such as AppShell's `mobileNav.breakpoint`, is not compact. - `component:Selector` records the `adaptive` edge change as pending and compatible under `spec:AST-017` FR1. ## Rejected alternatives - Mapping compact to each platform's size classes: the same screen would be compact on one platform and not another. ## Claim scope and non-goals The compact definition and the height condition only. Text sizing under `design:mobile-typography`, which surfaces adopt a touch presentation, and resolver code are outside this PR. ## Evidence and implementation relationship The touch presentation resolver contract lives only in the open `spec:AST-094` revision (#8052), which this PR does not edit; it must use FR9. Native adopts FR9 when it gains a compact resolver. Behavior delta when the code conforms: a coarse-pointer screen exactly 768 wide and at least 500 tall opens the popover, and a landscape phone wider than 768 but under 500 tall opens the bottom sheet. Code follow-up belongs to separate implementation PRs. INV16 is the caller-control invariant from #8273 (merged); this PR adds INV17. No implementation is included. ## Writing rubric results - R1 narration: none. - R2 research in the record: none. - R3 evidence naming a change: none; verification names edge states. - R4 rejected alternatives over one line or outside a decision: one, inside DEC-6, one line. - R5 pull request or issue references remaining: none added. - R6 ruled open questions still listing options: none. ## Scope - [x] This PR contains specification records only. - [x] It records observable behavior and preserves equivalent internal implementations. - [x] Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract. - [x] Verification states the evidence layer and failure signal without prescribing CI job/workflow topology. - [x] It records one intentional durable decision, not a rescue for a separable tagalong. - [x] The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision. - [x] Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them. - [x] Public text and artifacts contain no internal Meta context. ## Validation - `pnpm check:knowledge` (CI lint) - Prettier - `git diff --check`
|
/approve-spec d60ec74 Approved: NumberInput hides its compact increment/decrement buttons whenever the primary pointer is coarse, at every viewport width, with no opt-out. Fine-pointer steppers remain unchanged, and direct numeric entry and keyboard stepping remain supported. This is the intended NumberInput touch-device contract. The browser-test typing error is fixed on this head; the core typecheck and all 318 focused NumberInput tests pass locally. |
There was a problem hiding this comment.
Changes are needed before approval: the coarse-pointer hide now has an engineering owner's exact-head approval, but it still disagrees with two current specs.
component:NumberInput, now current onmain, still says in FR5 and AR4 thathasNumberSteppersbuttons render on every pointer, so please bring inmainand record the approved coarse-pointer behavior there, with the writing-rubric results in the description.- The Changeset should be a
minor[breaking]entry with migration notes rather than a patch[fix](AST-017 FR5, FR1 and FR7), because touch users lose the steppers with no prop to keep them, and it can merge only oncemaindeclares the minor.
New commits invalidate the current approval, so an engineering owner, you included, records /approve-spec <full head SHA> again on the final head.
[Automated review]
| // enter a value directly; keyboard stepping remains available. | ||
| display: { | ||
| default: 'flex', | ||
| '@media (pointer: coarse)': 'none', |
There was a problem hiding this comment.
component:NumberInput is now current on main, and its FR5 says that with hasNumberSteppers the buttons "render at the end of the control", with no pointer condition (AR4 calls them "Pointer-only aids"). Please record the approved coarse-pointer hide there (FR5, AR4, the Steppers design row and the verification entries), in this pull request or a linked spec pull request, so the record and this rule agree before the final head is approved.
|
Owner classification: this is non-breaking. NumberInput retains its numeric-value and callback contracts, validation, direct entry, and keyboard stepping; the compact steppers are presentation aids that adapt to primary-pointer precision. Existing calls require no source or configuration migration. The intended coarse-pointer hiding is unchanged. The Changeset is being updated to patch / [feat], with this ruling recorded in the component contract. |
d60ec74 to
9627e06
Compare
|
/approve-spec 9627e06 Approved as a non-breaking presentation adaptation. NumberInput retains its public props and exports, numeric-value and callback contracts, validation, direct entry, and keyboard stepping. Existing calls require no source or configuration migration. Compact stepper aids adapt to primary-pointer precision; fine-pointer behavior is unchanged. I approve component:NumberInput FR5, AR4, DEC-1, the matching verification map, and the patch / [feat] classification on this exact head. |
There was a problem hiding this comment.
Changes are needed before approval: the coarse-pointer hide and the updated component:NumberInput record have an engineering owner's approval on this head, but the release label still disagrees with spec:AST-017. Removing the documented stepper buttons for every coarse-pointer user, with no prop to keep them, is not an appearance-only change under FR3, so FR1 classifies it as breaking, and FR6 says owner approval does not change that. Please make the Changeset a minor [breaking] entry that names the old usage, the new behavior and the migration (FR7, FR8), align the record's Compatibility class and Migration decision with it, and merge once main declares the minor (FR31); a new commit needs /approve-spec <full head SHA> again on the final head, which you can record yourself as an engineering owner.
[Automated review]
| @@ -0,0 +1,9 @@ | |||
| --- | |||
| '@astryxdesign/core': patch | |||
There was a problem hiding this comment.
spec:AST-017 FR3 keeps an appearance change nonbreaking only while interaction and accessibility semantics keep working. On coarse pointers both stepper buttons, which the released docs promise, disappear with no prop to keep them, so FR1 classifies this as breaking. This entry needs minor with [breaking], the old usage, the new behavior and the migration (FR7, FR8), and can merge once main declares the minor (FR31).
| steppers, no clear, `size="md"`, `statusVariant="attached"` | ||
| - Compatibility class: records shipped behavior; no public prop, default, | ||
| export, or DOM change | ||
| - Compatibility class: non-breaking presentation adaptation; public prop |
There was a problem hiding this comment.
This compatibility class has to follow spec:AST-017, which this pull request does not amend: losing the documented stepper interaction on coarse pointers is breaking under FR3 and FR1, and FR6 rules out approval as the basis for a nonbreaking label. Please align this line, the Migration decision and the Contract-at-a-glance rows with the corrected Changeset.
|
/approve-spec f5518c9 I approve the AST-017 FR1/FR3 amendment and DEC-30 on this exact head: component-owned auxiliary numeric steppers may be hidden on coarse primary pointers as a non-breaking presentation adaptation only while the public API, numeric values and callbacks, validation, form values, accessible direct entry, field semantics/focusability, and keyboard stepping remain supported without caller source or configuration migration. Other API or essential-action removals are not covered. I also approve the aligned NumberInput contract and patch / [feat] classification. The writing-rubric results are in the PR description. Knowledge and release validation and all 212 focused policy/gate tests pass. |
There was a problem hiding this comment.
This looks ready to approve: hiding NumberInput's compact steppers on coarse primary pointers matches the component:NumberInput and spec:AST-017 changes an engineering owner approved on this head, and the patch [feat] Changeset meets every condition of the new FR3 rule. Real-browser checks show the steppers gone and the themed end padding restored on coarse pointers at 390 and 1280 px, with keyboard stepping and direct entry intact and fine-pointer rendering pixel-identical, and the new Chromium spec passes here while failing on the base. The one remaining step is letting the required CI finish on this head before merging.
[Automated review]
|
/approve-spec 088370a I reaffirm the previously approved AST-017 FR1/FR3 amendment and DEC-30 and the aligned NumberInput contract on this exact head after the main update. The numeric-stepper decision is unchanged: auxiliary compact steppers may be hidden on coarse primary pointers as a non-breaking patch / [feat] presentation adaptation only while public APIs, numeric values and callbacks, validation, submitted values, accessible direct entry, field semantics and focusability, and keyboard stepping remain supported without caller source or configuration migration. Fine-pointer steppers remain available. No other API or essential-action removal is approved. |
|
That The gate only accepts the exact current head, so post this instead: A new commit invalidates the command, so repeat it after any push. |
|
/approve-spec 088370a |
User impact
Hide NumberInput's small increment/decrement buttons when the primary pointer is coarse, regardless of viewport width. Restore the normal themed end padding when that column is hidden. Direct numeric entry, decimal/numeric keyboard hints, and arrow-key stepping remain available; fine-pointer controls are unchanged.
Visual authority
Owner-approved, non-breaking component-local presentation change: use
(pointer: coarse), not a width breakpoint orany-pointer.component:NumberInputFR5, AR4, DEC-1, its design row, and its verification map now record the intended coarse-pointer adaptation. Numeric values and callbacks, validation, direct entry, and keyboard stepping remain supported without caller source or configuration migration. The Changeset is patch /[feat]because this intentionally adapts presentation rather than restoring an earlier visual rule.The implementation preserves
family:input-fieldsgeometry and theme-token ownership,architecture:component-style-authoringINV1–INV3 (CSS-native StyleX presentation), anddesign:bidirectionalityDR3 (logical end padding). Global claim routing receipt preserves base/head, matched claims, triggers, and match reasons; the caller-rendered-trigger claims are out of scope because this component has no such surface.Before and after
Matched real-Chromium frames, Neutral theme, LTR, 390 × 600 CSS px, DPR 1, value 2. The retained evidence and sensor receipts are outside the implementation branch.
Coarse-pointer frames remove the buttons and restore 8px end padding. The fine-pointer pair is pixel-identical (0 changed pixels).
State matrix
Scope
Original verification (b817cee)
10930261) and this head (b817cee): two pre-existing Storybook title-shape expectations instory-tree.test.ts, and two directory-symlink cleanup errors in the CLIagent-docsandcomputer-agent-textsuites. They remain outside this change.pnpm build,pnpm storybook:build, andpnpm lint:strictpass (strict lint: 0 errors, 130 warnings).@astryxdesign/corepatch,[fix].Current-head verification
The branch is rebased onto current main. Core typecheck, all 326 focused NumberInput tests, knowledge-record validation, and repository/release-admission checks pass. The AST-017 amendment also passes 212 knowledge, Changeset, and spec-gate tests. The current Changeset is
@astryxdesign/corepatch /[feat]; the proposed numeric-stepper compatibility rule does not change the release plan or CI requirements.AST-017 policy amendment
This PR deliberately amends the release policy, not just the label on the implementation. AST-017 FR1/FR3 and DEC-30 define a narrow non-breaking adaptation for component-owned auxiliary numeric increment/decrement buttons on coarse primary pointers. The rule allows their documented buttons to leave the accessibility tree only when public APIs, accepted values, validation, submitted values, numeric callbacks, accessible direct entry, the field's role/name/value/focusability, and keyboard stepping remain supported without caller source or configuration migration. Non-coarse-pointer steppers remain available. It does not permit removal of public APIs, essential actions, or the accessible entry path, and changes no release plan or CI requirement.
NumberInput's compatibility section refers to this canonical rule. Its existing visibility/entry/stepping browser regression and fine-pointer control evidence demonstrate the corresponding component contracts. If this mixed policy/implementation PR must instead consume already-landed policy, the AST-017 amendment will be split into a spec-only PR targeting main and reviewed and merged first.
Writing rubric results
R1 narration: the AST-017 amendment and NumberInput compatibility text state the lasting rules in the present tense; no PR history is added to either record.
R2 research: no survey or one-off measurements are added to the records; browser evidence remains outside them.
R3 evidence: the new AST-017 verification row identifies the stable-package/browser comparison and its observable success and failure cases, not a PR or commit.
R4 rejected alternatives: one sentence each in the owning DEC-30 and component DEC-1; neither is an options survey.
R5 change references: no new PR or issue links appear in either standing record.
R6 open questions: none added; pointer-conditioned availability and the policy change are the requested direction.
Compatibility classification
No public prop name, type, export, numeric-value or callback contract, validation behavior, direct entry, or keyboard stepping changes. Existing NumberInput calls require no source or configuration migration. The compact visual stepper aids are hidden on coarse primary pointers; numeric input functionality and fine-pointer stepper behavior remain supported. This is an intentional direction, so the Changeset is patch /
[feat], not[fix]. No release version or CI requirement is changed or bypassed.