Skip to content

feat(NumberInput, Pagination): entryErrorBehavior on NumberInput - #11492

Merged
nynexman4464 merged 3 commits into
mainfrom
nynexman4464/feat/entry-error-behavior-number
Nov 13, 2026
Merged

nynexman4464 merged 3 commits into
mainfrom
nynexman4464/feat/entry-error-behavior-number

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

User need

A form that sets defaultEntryErrorBehavior on its FormLayout, or passes one entryErrorBehavior to every field, cannot pass it to NumberInput: the prop does not exist there, so the call fails to type-check and the form needs a special case for its number fields. AST-117 gives the same option to all four members that reject entries. NumberInput already shows its rejections only at Enter or blur, because a typed number is complete only when the person commits it, so the option changes nothing a person sees in a NumberInput. Builders still need it so one form-wide choice reaches every member without a special case.

Problem and solution fit

  • NumberInput takes entryErrorBehavior?: 'complete' | 'blur-or-enter'. Both values keep its current timing: the message, aria-invalid, the invalid styling, the announcement, and the onEntryErrorChange report appear together at Enter or blur, never while a person types. An edit that makes the text valid or empty clears them at once.
  • The field keeps the prop off its <input> and reads no FormLayout default, because no value can change what it does.
  • Pagination's page box passes entryErrorBehavior="complete", as AST-117 FR7 asks of compositions.
  • EntryErrorBehavior is also exported from the NumberInput entry point.
  • The records close the last NumberInput gap lines and the "TBD (gap)" verification rows.

This pull request sits on #11485, which adds the option to DateInput, DateTimeInput, TimeInput, and FormLayout.

Current specification

  • spec:AST-117 FR1 (each member takes entryErrorBehavior; the type is exported as EntryErrorBehavior), FR2, FR3, FR4, FR7 (Pagination's page input keeps 'complete'), DEC-5.
  • component:NumberInput FR14: "A typed number is complete only at commit, so under either value the field marks and announces no rejection while the person types, and Enter or blur reveals the draft's current rejection".
  • component:FormLayout FR7; family:input-fields FR14.
  • Naming follows architecture:public-component-api INV2 and INV3 (AST-117 DEC-3).

No behavior change for people: with or without the prop, under either value, and inside a FormLayout with either default, NumberInput and Pagination behave as on the base.

Public delta and caller burden

<FormLayout defaultEntryErrorBehavior="blur-or-enter">
  <DateInput label="Start" value={start} onChange={setStart} />
  <NumberInput
    label="Seats"
    value={seats}
    onChange={setSeats}
    entryErrorBehavior="blur-or-enter" // now type-checks; same timing as before
  />
</FormLayout>
  • Added: NumberInputProps.entryErrorBehavior?: EntryErrorBehavior; the EntryErrorBehavior type from @astryxdesign/core/NumberInput.
  • Default: the documented default is the nearest FormLayout's defaultEntryErrorBehavior, else 'complete'; both behave the same in NumberInput. Additive (spec:AST-017 FR5).
  • Caller decisions: none new. The prop exists so a form can pass one value everywhere.
  • No theming, accessibility, or compatibility change.

Design and alternatives

  • NumberInput does not call the shared resolution hook (Field/useEntryErrorBehavior). Its result would be unused, because both values take the same path. The family record's Shared owner section says that NumberInput resolves nothing, and NumberInput FR14 says the field reads no FormLayout default. If a later change makes the values differ, the field calls the hook then.
  • Pagination passes 'complete' even though it cannot change the page box today, so the composition rule in AST-117 FR7 holds in the code, not only in the outcome.
  • Rejected: leaving NumberInput without the prop. AST-117 FR1 names all four members, and a form-wide value would need a special case.

Evidence

  • Five configurations, each committed by Enter and by blur: no prop, 'complete', 'blur-or-enter', a blur-or-enter FormLayout default, and a complete field prop under that default. In all ten cases, typing 1a keystroke by keystroke shows no aria-invalid, no invalid style, no message, an empty alert, and no onEntryErrorChange call. The commit then shows all of them at once, reports {kind: 'unreadable', text: '1a'} once, and announces once. Emptying the text clears at once and reports null.
  • 150 in a 10–100 field clamps to 100 at Enter and reveals nothing, under both values.
  • The prop does not reach the input element.
  • Pagination's page box inside FormLayout defaultEntryErrorBehavior="blur-or-enter": 2.5 shows nothing while typed, Enter marks it invalid, and 2 clears it.
  • Mutation checks: dropping the prop from NumberInput's destructuring sends it to the DOM, and "keeps the prop off the input" fails. Removing entryErrorBehavior="complete" from Pagination fails no test. That mutant is equivalent: NumberInput has no path on which the value changes anything.

Scope

Components: NumberInput, Pagination

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

Head abe8891117 on #11485's head 5b3078b36a. Node 24.22.1, pnpm 11.10.0. Every run below is at that head.

$ pnpm exec vitest run --project ui packages/core/src/{NumberInput,Pagination,FormLayout,Field,DateInput,DateTimeInput,TimeInput,PowerSearch} packages/core/src/Table/plugins/filtering --maxWorkers=48
 Test Files  70 passed (70)
      Tests  2736 passed (2736)

$ pnpm exec vitest run --project ui --project node packages/core --maxWorkers=48
 Test Files  852 passed (852)
      Tests  23120 passed (23120)

$ pnpm exec tsc --noEmit -p packages/core
(0 errors)

$ ASTRYX_STRICT_LINT=1 pnpm exec eslint <5 changed .ts/.tsx files>
0 errors, 1 warning: NumberInput.tsx 'BaseProps' is defined but never used (an unused import already on the base; not touched here)

$ pnpm exec prettier --check <11 changed files>
All matched files use Prettier code style!

$ pnpm check:knowledge
Knowledge templates and records are aligned.

$ pnpm check:changesets
✓ check:changesets — 153 changeset(s) valid (0.x: [breaking] -> minor, [experimental] and other categories -> patch); main declares 0.7.16 (patch plan)

$ node scripts/release/changeset-coverage.mjs pr --base 5b3078b36a --head HEAD --released v0.7.15
✓ Changeset coverage — ships to @astryxdesign/core, each named; released CLI JSON ids checked against v0.7.15

$ node internal/eslint-plugin-astryx/no-comment-provenance.baseline.mjs --check
no-comment-provenance baseline is up to date.

$ node scripts/pre-review.mjs --base 5b3078b36a --head HEAD
Authored lines: 189 (guideline 2000; lockfiles, snapshots, and generated files excluded)
Merge into 5b3078b36a: clean
Findings in this change (0):
  none

$ pnpm review:pre    # whole stack against origin/main
Authored lines: 1482
Merge into origin/main: clean
Findings in this change (0):
  none

$ pnpm storybook:build
$ pnpm exec playwright test --config playwright.config.ts --project=chromium packages/core/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts packages/core/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts
  15 passed (19.9s)
$ pnpm exec playwright test --config playwright.interaction.config.ts --project=chromium packages/core/src/Pagination/__tests__/PaginationTextSize.interaction.browser.spec.ts
  5 passed (4.9s)

No interaction spec is added or renamed, so .github/scripts/playwright-legs.test.mjs is unaffected. Pagination has no accessibility audit spec.

Self-review against the repository's review rules:

  • Spec authority: each delta cites a current claim. The NumberInput prop and type follow AST-117 FR1 and NumberInput FR14, and the Pagination prop follows AST-117 FR7 and DEC-5. The record edits are in this pull request.
  • API delta: one added prop and one re-exported type, both settled by AST-117 FR1. They are scoped to NumberInput, which the title names, so no row is a tag-along. Pagination's API is unchanged.
  • Behavior: no observable change. Each claim above is proven by the tests listed under Evidence.
  • Changeset: it states the user impact (none a person sees) and the API addition. Every sentence matches the code and tests.
  • Records: each edited sentence matches the code:
    • NumberInput FR14 ("reads no FormLayout default"): the prop is destructured and unused.
    • The family Shared owner bullet ("resolves nothing").
    • FormLayout FR7 ("NumberInput behaves the same under both values").
    • The removed gap lines, which are now closed.
    • The verification rows, which name the suites above.
    • The NumberInput concept row's stability, moved from Proposed to Stable.
  • Comments: one new source comment, two sentences of 12 and 10 words. It gives the reason the field reads neither the prop nor a form default, and does not restate code.
  • Effects, data attributes, shared modules, external links, deprecations: none added.
  • Public boundary: the residue terms and URL scan over the diff, commit message, and this description find nothing.
  • Description numbers: every count in Testing comes from runs at abe8891117.

Writing rubric results

Records touched: spec:AST-117, family:input-fields, component:NumberInput, component:FormLayout.

  • R1 narration: none. The edited sentences state what the field does.
  • R2 research: none.
  • R3 evidence: NumberInput FR14's basis read "proposal" and now reads "source and tests". The "TBD (gap)" rows for NumberInput FR14 and family FR14 now name their suites.
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none.
  • R7 project status: the remaining NumberInput gap lines are removed: AST-117's FR1/FR2 gap, NumberInput's Implementation gap and Current-state impact bullet, the family Implementation gap bullet, and FormLayout FR7's gap sentence. NumberInput's concept row moves from "Proposed" to "Stable".

…vior and a form default

DateInput, DateTimeInput, and TimeInput take `entryErrorBehavior`
('complete' | 'blur-or-enter'), and FormLayout carries
`defaultEntryErrorBehavior` on its layout context. A field resolves its
own prop, else the nearest FormLayout default, else 'complete'.

Under 'blur-or-enter', typing and native time edits reveal no rejection of
the field's own; Enter or blur reveals the entry's current rejection with
every signal together and one announcement, and the onEntryErrorChange
report moves to that commit. An edit that the field accepts or empties
clears at once. PowerSearch value editors and Table filter editors keep
'complete'.
NumberInput takes `entryErrorBehavior`, so a form can pass one value to
all of its date, time, and number fields. A typed number is complete only
at Enter or blur, so both values keep the field's current timing; the
field keeps the prop off its input and reads no FormLayout default.
Pagination's page box passes 'complete', as compositions keep their own
entry error timing.
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 13, 2026 8:14am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 13, 2026, 8:24 AM UTC

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 90b7e59

@nynexman4464
nynexman4464 changed the base branch from nynexman4464/feat/entry-error-behavior to main November 13, 2026 08:03
…ry-error-behavior-number

# Conflicts:
#	docs/families/input-fields.md
#	docs/specs/AST-117-validation-timing/spec.md
#	docs/specs/components/FormLayout/FormLayout.spec.md
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec f1d9731

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not finished on this head yet.

NumberInput now takes entryErrorBehavior and exports EntryErrorBehavior from its entry point, and Pagination's page box passes 'complete', as the entry error behavior spec asks; with or without the prop, under either value and inside a FormLayout, NumberInput keeps revealing its own rejections only at Enter or blur. Two small non-blocking notes are inline: the @output header list in NumberInput/index.ts, and a lone - state in the NumberInput record's FR14 verification row that the new cases do not type.

Claims and files checked

Claims

  • Changeset: NumberInput takes entryErrorBehavior so a form can pass one value to its date, time and number fields: verified (NumberInput.tsx:430; the date and time fields already take it).
  • Changeset and description: under both values, typing shows no message, aria-invalid, invalid styling, announcement or report, and Enter or blur shows them together, reports once and announces once: verified (the ten "NumberInput entryErrorBehavior" cases, NumberInput.rejectedEntry.test.tsx:848-930).
  • An edit that makes the text valid or empty clears the error at once and reports null: verified (same cases).
  • Setting the prop or a FormLayout default changes nothing a person sees: verified (the same cases also pass on the base; the NumberInput and Pagination visual frames are unchanged in CI).
  • Pagination's page box passes 'complete', so a FormLayout around it changes nothing: verified (Pagination.tsx:775; the Pagination FormLayout case).
  • EntryErrorBehavior is exported from the NumberInput entry point: verified (index.ts:19; generated API delta).
  • The field keeps the prop off its input and reads no FormLayout default: verified (NumberInput.tsx:702; "keeps the prop off the input", which fails on the base).
  • On the base, passing the prop to NumberInput fails to type-check: verified from the prop types, which have no open index signature.
  • 150 in a 10 to 100 field clamps to 100 at Enter and reveals nothing under both values: verified (clamp cases).
  • Removing Pagination's 'complete' fails no test, an equivalent mutant: verified (the Pagination case passes on the base).
  • The records drop the last NumberInput gap lines and the verification rows name the suites: verified (diff of the four records).
  • Authored lines 189: verified.
  • Lint has 0 errors and one inherited warning, and Prettier, knowledge, changeset and type checks pass: verified at this head.
  • The description's test counts: stated for an earlier commit; the NumberInput, Pagination and FormLayout suites pass at this head (570 tests), and the full suite runs in CI.

Files

  • .changeset/entry-error-behavior-number.md: clear
  • docs/families/input-fields.md: clear
  • docs/specs/AST-117-validation-timing/spec.md: clear
  • docs/specs/components/FormLayout/FormLayout.spec.md: clear
  • docs/specs/components/NumberInput/NumberInput.spec.md: non-blocking note (FR14 verification row)
  • packages/core/src/NumberInput/NumberInput.doc.mjs: clear
  • packages/core/src/NumberInput/NumberInput.rejectedEntry.test.tsx: clear
  • packages/core/src/NumberInput/NumberInput.tsx: clear
  • packages/core/src/NumberInput/index.ts: non-blocking note (header list)
  • packages/core/src/Pagination/Pagination.test.tsx: clear
  • packages/core/src/Pagination/Pagination.tsx: clear

Automated review (maintainer link)

NumberInputStatus,
NumberInputStatusType,
NumberInputEntryError,
EntryErrorBehavior,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this line adds EntryErrorBehavior to the entry point, but the header's @output list (line 6) still ends at NumberInputEntryError, and the header's SYNC line asks to keep it in step. Add EntryErrorBehavior there.

| FR5, FR13, AR4 | `NumberInput.coarse-pointer.a11y.chromium.spec.ts` | Coarse/non-coarse pointers at 390 and 1280 px, LTR/RTL, non-default themed end padding | Visible coarse-pointer steppers, hidden fine-pointer steppers, wrong end padding, or lost direct/keyboard entry fail. | `audit:NumberInput/behavior` |
| FR5 | `NumberInput.test.tsx` "a held stepper" suite | Hold and release; pointer cancel; a bound; clicks; a finger press | A commit per repeat, a repeat after the release, or a step after the field turns disabled or read-only fails. | `audit:NumberInput/behavior` |
| FR14, AR2 | TBD (gap): `NumberInput.test.tsx` entry error behavior suites | `-`; `1a`; `150` in 10–100; each value; Enter and blur | A signal before commit under `'blur-or-enter'`, a lone signal, an unannounced revert, or a change under `'complete'` fails. | `audit:NumberInput/behavior` |
| FR14, AR2 | `NumberInput.rejectedEntry.test.tsx` "NumberInput entryErrorBehavior" cases; `Pagination.test.tsx` FormLayout case | `-`; `1a`; `150` in 10–100; each value; Enter and blur | A signal before commit under `'blur-or-enter'`, a lone signal, an unannounced revert, or a change under `'complete'` fails. | `audit:NumberInput/behavior` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this row now names the "NumberInput entryErrorBehavior" cases, but its states still include a lone -, which those cases never type (they type 1a and 150). Adding '-' to the five configurations, or naming the rejected-entry suite's lone-minus cases here, makes the row true as written.

@nynexman4464
nynexman4464 merged commit 8cf8ead into main Nov 13, 2026
74 checks passed
@github-actions
github-actions Bot deleted the nynexman4464/feat/entry-error-behavior-number branch November 14, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — f1d9731a Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant