Skip to content

feat(core): ListInput moves to Core - #13762

Open
ernestt wants to merge 3 commits into
mainfrom
feat/listinput-core
Open

ernestt wants to merge 3 commits into
mainfrom
feat/listinput-core

Conversation

@ernestt

@ernestt ernestt commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ListInput to Core: #13758, #13759, and #13760 merged; two pull requests remain. Review and merge them in this order. #13762 is based on #13761, and only #13761 targets main, so #13762 gets CI once it is retargeted.

  1. fix(ListInput): a change announces and moves focus only once the owner applies it #13758 (merged): a change announces and moves focus only once the owner applies it
  2. fix(ListInput): records without an itemName take a translated noun #13759 (merged): records without an itemName take a translated noun
  3. fix(ListInput): the English empty state adds no plural ending or article to the noun #13760 (merged): the English empty state adds no plural ending or article to the noun
  4. fix(ListInput): base props reach the group, and styling only named parts #13761: base props reach the group, and styling only named parts
  5. feat(core): ListInput moves to Core #13762: ListInput moves to Core ← this pull request

User need

A form that collects a short list of records, such as guests, travelers, tag options, or budget lines, needs fields that repeat per record, with add, remove, and reorder. ListInput does that job, but only in Lab, which is canary-only with no stability promise, so a stable app either takes a canary dependency for one component or builds the repeating fields by hand. The four pull requests below this one clear the component's open audit blockers. This one moves ListInput to Core.

Problem and solution fit

  • The move. ListInput and its types ListInputProps, ListInputChange, ListInputColumn, ListInputRenderContext, and ListInputValueContext move from packages/lab/src/ListInput/ to packages/core/src/ListInput/, exported from @astryxdesign/core/ListInput and the package root, with the props, defaults, and behavior fix(ListInput): base props reach the group, and styling only named parts #13761 gives it. Git reads the source, its tests, its doc, its Chromium spec, and the four blocks as renames.
  • One commit, rebased onto the new fix(ListInput): base props reach the group, and styling only named parts #13761. fix(ListInput): a change announces and moves focus only once the owner applies it #13758's later focus fixes are now on main, so the moved file carries them and this pull request no longer repeats them. The record's FR5 and its verification row keep the wording those fixes need. Conflicts, all from main: the moved ListInput.tsx keeps fix(ListInput): a start reorder handle's finger target is at least an end handle's #13757's start-handle changes and test(ListInput): the clipping-host case stops when the field root has no box to clip #13878's comment, and imports isFocusDetached from its own module; the moved Chromium spec keeps test(ListInput): the first-record mouse-drop case holds the animation clock across the release #13778's, test(ListInput): the finger-target cases run for both reveal behaviours #13841's, and test(ListInput): the clipping-host case stops when the field root has no box to clip #13878's cases, with the Core story ids; and the CLI's "close" search goldens count 55 matches.
  • Supporting changes, each needed for the move to be complete:
    • Imports become Core-relative, and strings go through Core's component translator with registered English.
    • The Field styling rule, Core's shared useFieldInputStyling, comes from its own module, Field/fieldParts, in place of the internal @astryxdesign/core/internal/selectable-card entry fix(ListInput): base props reach the group, and styling only named parts #13761 imports from Lab. The shared input-fields FR10 suite runs on ListInput (ListInput.fr10.test.tsx), which fieldInputFamily.test.tsx requires of every Core component that renders Field.
    • Core's strict lint applies: the local id joiner gives way to Core's joinAriaIDs, the record-row map's ref is named rowsRef, and test helpers drop two unneeded assertions and return their promise from an async function.
    • Core's guards apply: a host-data-attribute fixture covers ListInput; the doc's status types spell 'error' | 'warning' | 'success', which InputStatus hides; ListInput is listed as a component that sets Item's private --_item-inset-inline, the inset core List's reorder handle reaches into; and reduced motion comes from Core's shared reader, useReducesMotion, in place of ListInput's own media query.
    • That reader also follows a theme's reducedMotion: 'always', so under such a theme the add and remove motion is instant, as every Core component's motion is (design:reduced-motion DR1, DR2a). It is the one behavior change in this pull request.
    • The Lab entry re-exports the Core component and its types, with no @deprecated marker and no removal date: no owner decision deprecates them yet (the record's OQ1). A test checks that each is the Core one.
    • ListInput leaves the Lab promotion manifest, which lists only Lab components, so the theming-target guard now checks it as a Core component.
    • The stories move to Core/ListInput; the Chromium specs and the RTL audit entry take the new story id and name. The four blocks move to the CLI's component blocks and import from @astryxdesign/core/ListInput; the sandbox's route list gains their pages. The ShadCN route moves to components/list-input and keeps components/lab/list-input as an alias. The probe theme covers the list-input target. The translation-screenshot script takes the two new story ids.
    • Translator notes drop "lab", the swizzle proof's sample is a Core one, the motion lab's row drops "(lab)", the pinch spec routes ListInput's Core path, the CLI's "close" search goldens count ListInput, and comments in List's reorder modules no longer call ListInput a Lab component.
    • design:ordered-collection-reordering lists the Core path beside the Lab ones.
    • The new component:ListInput record, a [feat] Core Changeset, and a CLI Changeset for the blocks.

Current specification

  • component:ListInput (new, authority: draft) records the contract this pull request ships: FR1–FR12 and AR1–AR4, each resting on the documented props and tests and on current records: family:input-fields FR10, spec:AST-103 FR1, FR2, and FR5 (the reorderable object, present means enabled, one control per row), spec:AST-085 FR1, FR2, and FR4 (focusable disabled controls), spec:AST-086 FR9, and architecture:internationalization INV1a. It has one open question, OQ1: whether the Lab re-exports are deprecated, and when they are removed. It needs an engineering owner's /approve-spec, which also moves it to current; owners lists the schema's approval owners, so please confirm or change it.
  • design:ordered-collection-reordering changes only its path list; it needs a design owner's approval.
  • spec:AST-017 FR23 and FR27: a promotion needs owner approval and a [feat] Changeset.
  • spec:AST-103: ListInput takes reorderable={createReorderable()}, and a move goes to the object's onReorder, never to onChange (FR1, FR2).
  • Every row of the API delta is decided by the draft record, so the rows go to an owner until it is approved (architecture:public-component-api INV25).

Public delta and caller burden

  • New in Core: ListInput, ListInputProps, ListInputChange, ListInputColumn, ListInputRenderContext, ListInputValueContext, and the ./ListInput subpath.
  • Props: label, description, value, onChange, getItemKey, createItem, columns, itemName, status, getItemStatus, getFieldStatus, reorderable, isDisabled, isLoading, maxItems, isLabelHidden, isOptional, isRequired, a ref to the group, and container* and control* styling. Defaults are unchanged.
  • Theme target: list-input, reflecting state (loading, disabled) and reorderable, as in Lab.
  • For Lab callers: nothing breaks. @astryxdesign/lab re-exports the Core component and its types.
// Keeps working: the Lab entry re-exports the Core component
import {ListInput} from '@astryxdesign/lab';

// The stable import
import {ListInput, createReorderable} from '@astryxdesign/core';

const reorderable = useMemo(() => createReorderable({onReorder}), [onReorder]);
<ListInput label="Guests" itemName="guest" value={guests} onChange={setGuests}
  getItemKey={guest => guest.id} createItem={newGuest} columns={columns}
  reorderable={reorderable} />

Left for the owner:

  • OQ1: whether to deprecate the Lab re-exports, and when to remove them. Until an owner decides, they stay plain re-exports.
  • @astryxdesign/core/internal/reorder still exports useListReorderScope, ListReorderScope, and isReorderHandle, which only Lab's ListInput imported. Lab's TransferList imports the same entry and is moving to Core in parallel, so this pull request leaves the entry's exports alone; whichever move is last can remove what no Lab component imports.
  • SelectableCardGroup's move (feat(core): SelectableCardGroup moves to Core #13734) keeps the internal @astryxdesign/core/internal/selectable-card entry, with useFieldInputStyling as its only export, so it and this stack land in either order. Once both land, no Lab component imports that entry; whichever lands last can remove it.
  • fix(ListInput): a start reorder handle's finger target is at least an end handle's #13757, a draft, edits Lab's ListInput.tsx, which this pull request moves to Core. Whichever lands second carries its change to the file's new place.

Design and alternatives

  • The Changeset is [feat], as spec:AST-017 FR23 and FR27 ask of a promotion; the DiffViewer, SelectableCardGroup, and CommentPin moves do the same.
  • The record's OQ1 follows the same moves: their Lab entries are plain re-exports, and deprecation waits for an owner.

Evidence

Real-browser screenshots: the Lab/ListInput stories at the base of this pull request against the Core/ListInput stories at its head, each from a static Storybook build served locally, in headless Chromium at 2× scale with reduced motion, scoped to #storybook-root.

State Before (Lab) After (Core)
Tag options before after
Reorder mode, after Enter on a handle before after
Dark before after
Right to left before after
Empty mailing list before after
320 px wide before after

All 16 captured states are pixel-identical before and after (0 differing pixels). The others: tag-options-gothic-dark, tag-options-y2k, tag-options-forced-colors, tag-options-coarse-pointer, tag-options-keyboard-focus, disabled, loading, validation-statuses, reorder-handle-options, expense-allocations. In every state the group's role, astryx-list-input class, data-state, data-reorderable, aria-busy, record count, and focused element match.

  • On this head's Core build, fix(ListInput): a change announces and moves focus only once the owner applies it #13758's behavior holds: a refused removal announces nothing and typing keeps focus; a later removal announces and focuses the next Remove when it applies; two removals the owner saves later are each announced when their save lands, and focus ends on the remaining record's Remove; two removals applied at once leave focus on the Remove of the record now in the removed place; a list in an iframe keeps focus that the user moved within the iframe; an add that a sorting owner puts first is announced as "Added person 1." and focuses its field; and when the owner puts a blank record in place of the last one removed, the removal is announced and focus goes to Add. On the first head's Core build, the empty state read "No email address added yet", the default noun was a catalog string under the pseudo locale, and a focused reorder handle kept focus while the list was busy and moved again after it; this head does not change those paths.
  • Unit: ListInput's tests in Core, the shared FR10 suite, fieldInputFamily.test.tsx coverage, the Lab re-export test, the host-data-attribute and theming-target guards, and the internal reorder entry's tests.

Scope

Components: ListInput

  • 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.

Writing rubric results

docs/specs/components/ListInput/ListInput.spec.md (new):

  • R1 narration: none; every row states what ListInput does.
  • R2 research: none.
  • R3 evidence: basis cells cite records, the documented promise, and current source and tests; verification cells name tests. No pull request, issue, or commit.
  • R4 rejected alternatives: none in the record.
  • R5 change references: none.
  • R6 open questions: OQ1 is unanswered; it lists no options.
  • R7 project status: none, apart from the template's "Released default preserved: not yet released in Core" line.

docs/design/ordered-collection-reordering.md (path list only): R1–R7 none; the change adds packages/core/src/ListInput/** to its paths.

Testing

Local gates on this branch over #13761 (head c6e2007, on main 0d0c173; rebased again after #13760 merged, with no conflicts, then onto #13761's reworded commit, which changes only its message, so the tree is the one these gates ran on):

  • pnpm preflight --browser --base fix/listinput-field-prop-targets on this branch's first head: review:pre (0 findings), build, typecheck, ESLint and Prettier on the changed files, check:repo, check:knowledge, and check:changesets passed. Vitest found seven failures, which this head fixes: docPropLiterals.test.ts (the status types now spell 'error' | 'warning' | 'success'), reducedMotionReaders.test.ts (ListInput reads reduced motion through Core's shared reader), derivedVarRegistry.test.ts (ListInput is listed as a component that sets Item's --_item-inset-inline), a11y-pr-contracts.test.mjs (the pinch spec now routes ListInput's Core path), and the CLI's three "close" search goldens (53 matches with ListInput in Core). A story-tree check failed only on a local probe story, which is not in the branch.
  • One failure is not this change's: List/__tests__/ListReorder.test.tsx "leaves no stacking or background on a row grabbed again during its drop glide and released in place" fails in this environment when the whole file runs, on main's List code too (fix(ListInput): a change announces and moves focus only once the owner applies it #13758's head), and passes when it runs alone. Main has since fixed that test (test(List): the re-grab-during-glide case holds the motion clock still #13755), so CI's merge with main includes the fix.
  • On this head: pnpm build, then Core's and Lab's tsc --noEmit: clean. ListInput's tests in Core and Lab with Core's __tests__, internal, utils, List, Field family, theming-target, derived-variable, reduced-motion, and doc-literal guards (113 files, 2,821 tests) pass. The node tests under packages/cli, internal, .github, and scripts pass (1,895 files, 30,205 tests). pnpm check:repo, pnpm check:knowledge, and pnpm check:changesets: clean. pnpm review:pre --base fix/listinput-field-prop-targets: 0 findings.
  • Chromium: the 210 accessibility-contract specs the change selects ran on the first head (206 passed, 4 skipped). On this head's Storybook build, ListInputReorder.a11y.chromium.spec.ts and ReorderGripPinchZoom.a11y.chromium.spec.ts pass (20 passed). A fresh capture of the 16 story states at the rebased heads is pixel-identical between fix(ListInput): base props reach the group, and styling only named parts #13761 and this pull request.
  • The full Chromium interaction suite (pnpm test:interaction --project chromium) on the first head: 1,968 passed, 54 skipped, 7 failed. The same 7 fail the same way on fix(ListInput): a change announces and moves focus only once the owner applies it #13758's head, whose only change is in Lab's ListInput, and on this head: one DropdownMenu test, three animated-layout edge-reveal tests, one SegmentedControl test, one Toast test, and one Lab PageControl test. None of them renders ListInput. This environment runs the system's Chromium 155 in place of the browser build Playwright pins; CI's run decides.
  • ASTRYX_STRICT_LINT=1 eslint on the changed files: 0 errors. Core's strict rules first flagged the Array<T> id joiner, the rowRefs name, two test helpers that returned a promise from a non-async function, two unneeded test assertions, a test owner that sorted with localeCompare (raw Intl), and an Array<T> test type; all are fixed.
  • pnpm visual:probe-theme, node scripts/sync-exports.js, and UPDATE_SHADCN_ROUTE_LOCK=1 node apps/docsite/scripts/generate-data.mjs regenerated the probe theme, the exports, and the route lock.

@vercel

vercel Bot commented Nov 24, 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 Dec 3, 2026 2:09pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 24, 2026
@astracat-bot

astracat-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Dec 3, 2026, 2:33 PM UTC

@ernestt

ernestt commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Restacked at 2c036ec for the review rounds on the pull requests below it; this one has no review yet.

@ernestt

ernestt commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Restacked at 6244a7a for the reviews on the pull requests below it; this one has no review yet.

@ernestt

ernestt commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Updated at f3e40d4: a second commit on top of 6244a7a gives Core's ListInput #13758's latest focus fix. The guard reads the list's own document and calls isFocusDetached, and when two removals apply at once and the planned record also left, focus goes to the record now in the removed place. The same three tests run in Core. component:ListInput FR5 and its verification row say so. #13759, #13760, and #13761 keep their reviewed heads.

922 targeted tests pass, Core's and Lab's typecheck is clean, strict lint has 0 errors, pnpm review:pre has 0 findings, and pnpm check:knowledge is clean. On the Core build in Chromium, the iframe and two-at-once probes pass, and so do the two reorder specs (16 tests).

@ernestt

ernestt commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Updated at b73a830: a third commit on top of f3e40d4 takes #13758's latest round into Core's copy. The iframe case moves focus inside act, so no act() warning is logged. The guard's comment now says it keeps focus that the user moved elsewhere in the list's own document. The description no longer says more than that about iframes. component:ListInput FR5 already limits the guard to focus in the list's own document, so it is unchanged. #13759, #13760, and #13761 keep their reviewed heads.

ListInput's tests in Core and Lab pass (53, with no act() warnings), strict lint has 0 errors, and pnpm review:pre has 0 findings.

@ernestt

ernestt commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the new #13761 (2385091). The content is unchanged apart from the rebase. #13758's later focus fixes are now on main, so the moved file carries them, and this pull request is one commit again. The conflicts all came from main:

On this head (67ec891): build, Core's and Lab's typecheck, 2,821 UI tests and 30,023 node tests, strict lint (0 errors), pnpm check:repo, pnpm check:knowledge, and pnpm check:changesets are all clean. pnpm review:pre has 0 findings. The reorder browser specs pass (20 tests), and a fresh capture of the 16 story states is pixel-identical to #13761's head.

@ernestt

ernestt commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the new #13761 (a04fc85). The content is unchanged apart from the rebase: this pull request's own diff is the same patch (identical git patch-id), with no conflicts.

On this head (7c66d73): build and Core's and Lab's typecheck are clean. 2,821 UI tests and 30,157 node tests pass. Strict lint has 0 errors. pnpm check:repo, pnpm check:knowledge, and pnpm check:changesets are clean, and pnpm review:pre has 0 findings. The reorder browser specs pass (20 tests), and a fresh capture of the 16 story states is pixel-identical to #13761's head.

@ernestt

ernestt commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the new #13761 (63e48d1). The content is unchanged apart from the rebase: this pull request's own diff is the same patch (identical git patch-id), with no conflicts.

On this head (3a4b87f): build and Core's and Lab's typecheck are clean. 2,821 UI tests and 30,205 node tests pass. Strict lint has 0 errors. pnpm check:repo, pnpm check:knowledge, and pnpm check:changesets are clean, and pnpm review:pre has 0 findings. The reorder browser specs pass (20 tests), and a fresh capture of the 16 story states is pixel-identical to #13761's head.

ListInput composes Field, but it put a caller's ref, id, data and ARIA
attributes, and handlers on the Field box, an unlabelled wrapper around
the labelled role="group" element, and its type took root xstyle,
className, and style.

As in CheckboxList, RadioList, and the other inputs that follow the
input-fields family's FR10, base props and ref now reach the group,
which joins a caller's aria-labelledby and aria-describedby to its own.
The type takes no root styling: containerXstyle, containerClassName, and
containerStyle style the Field box, except inside an InputGroup and in a
horizontal-labels FormLayout, where they are ignored with a development
warning; controlXstyle, controlClassName, and controlStyle style the
group. An untyped caller's root styling is dropped with a development
warning.
ListInput, its types, and its four blocks move from Lab to Core:
@astryxdesign/core/ListInput, the package root, and Core's component
blocks. The Lab entry re-exports the Core component and its types.

In Core, ListInput takes Field's shared styling rule and the component
translator, and imports its modules by relative path. Its stories move
to Core/ListInput, and its draft record joins the component records.
@ernestt
ernestt force-pushed the feat/listinput-core branch from 3a4b87f to c6e2007 Compare December 3, 2026 01:04
@ernestt
ernestt force-pushed the fix/listinput-field-prop-targets branch from 63e48d1 to 2e20a52 Compare December 3, 2026 01:04
@cixzhang
cixzhang changed the base branch from fix/listinput-field-prop-targets to main December 3, 2026 13:55
Main carries #13761 in Lab's ListInput, which this branch already moved to
Core. The Core files keep this branch's code, and the Core test file keeps
#13761's five prop-target tests, which the move had dropped.
@github-actions github-actions Bot added needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 3b3e9f4

Storybook · Sandbox · built from this PR's head

Current run: Heavy CI deferred: runs when review passes and before merge. Lint, typecheck and any path-filtered checks ran on this push.


Generated by PR Enrichment workflow | View current CI run

This branch was successfully deployed

1 active deployment
Preview — 3b3e9f40 Deployed Dec 3, 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. needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants