Skip to content

feat(lab): add TransferListSelector - #4773

Merged
ernestt merged 6 commits into
docs/complex-selector-examples-forward-portfrom
codex/transfer-list-lab
Aug 7, 2026
Merged

ernestt merged 6 commits into
docs/complex-selector-examples-forward-portfrom
codex/transfer-list-lab

Conversation

@ernestt

@ernestt ernestt commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Dependency

Temporarily stacked on #4769, which owns every generic ComplexSelector API used here: controlled visibility, trigger variants, leading icons, popup alignment, and exact selector sizing. After #4769 merges, this PR can be retargeted to main without changing its Lab diff.

Scope

Every file in this PR is under packages/lab/**. The action glyphs are bundled with the Lab component, so this PR does not modify the root lockfile, Core, Storybook, or another package.

Summary

  • Add TransferListSelector to Lab as the recommended popover-based field for moving and ordering options.
  • Keep TransferList as an unframed controlled primitive for advanced custom compositions.
  • Support immediate commits by default, with optional staged Apply/Cancel behavior.
  • Add independent transfer/reorder constraints, keyboard and vertical-only pointer reordering, grouped options, bulk actions, search, and responsive single-scroll narrow layouts.
  • Add API documentation, composition tests, and interaction tests.

Screenshot

TransferListSelector open in the advanced table column settings example

API arbitration and decision

Decision

Ship a standalone TransferListSelector built on ComplexSelector, while retaining TransferList as its lower-level content primitive.

This gives the common workflow one supported API that owns the external field label, trigger, popover, focus lifecycle, responsive container, and commit semantics. Advanced surfaces can still compose TransferList directly inside ComplexSelector when they need saved views, presets, custom headers, or custom footer actions.

Alternatives considered

  1. Examples inside ComplexSelector only — not selected. Every consumer would need to reimplement draft synchronization, Apply/Cancel behavior, dismiss semantics, trigger summaries, responsive scroll ownership, and accessibility wiring. Those repeated state machines are substantial enough to justify a Lab abstraction.
  2. A standalone transfer list with its own container system — not selected. Rebuilding a second selector shell would duplicate ComplexSelector behavior and create competing APIs for trigger, positioning, focus restoration, and async commits.
  3. TransferListSelector composed from ComplexSelector + TransferList — selected. It centralizes the common workflow while preserving explicit composition for genuinely custom surfaces.

API shape

  • TransferListSelector is the recommended entry point; TransferList is the advanced composition primitive.
  • value always represents the applied ordered selection and onChange is the single commit callback.
  • commitBehavior="immediate" is the default and renders no footer. commitBehavior="staged" owns an internal draft; Apply commits a changed draft, while Cancel, Escape, and light dismiss discard it.
  • Commit timing does not select a different container. Both behaviors use the same responsive selector popover; alternate shells compose TransferList directly instead of adding a container enum.
  • isTransferDisabled and isReorderDisabled remain independent per-option constraints.
  • Explicit prop allowlists keep ComplexSelector internals and future props from leaking into the Lab API.
  • The name TransferListSelector distinguishes the complete field-plus-popover control from the unframed TransferList content primitive.

Validation

  • 38 focused Vitest tests across TransferList, TransferListSelector, and advanced composition
  • ESLint and Prettier checks for all changed Lab source, tests, and docs
  • Lab production build, including generated CSS and package-output checks
  • Frozen-lockfile install verification
  • Changeset, export synchronization, SYNC-comment, and package-boundary checks

Existing repository check

The Lab-wide source typecheck still reports four unchanged missing declaration files for existing .doc.mjs imports (ChatReasoning, CodeEditor, LogStream, and Stepper). The Lab production build and all changed-file checks pass.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 6, 2026
@vercel

vercel Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 7, 2026 6:37pm

Request Review

@github-actions github-actions Bot added the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

New Components

TransferList (@astryxdesign/lab) · View in Storybook
Metric Value
Bundle Size (ESM) N/A
Bundle Size (CJS) 484B
Lines of Code 1439
Source Files 4
Complexity Very High (195)
Exports TransferList, type, type, TransferListSelector, type, type, transferListVars
Props Count N/A
Has Tests Yes
Has Stories Yes

Modified Components

ComplexSelector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 468 -
Complexity N/A Very High (55) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 1.2KB
@astryxdesign/lab N/A 3.8KB 1.6KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Aug 7, 2026
@ernestt
ernestt force-pushed the codex/transfer-list-lab branch from 40c1ff6 to e602ce7 Compare August 7, 2026 17:06
@ernestt
ernestt force-pushed the codex/transfer-list-lab branch from e602ce7 to 22298cb Compare August 7, 2026 18:25
@ernestt
ernestt requested a review from josephfarina as a code owner August 7, 2026 18:25
@ernestt
ernestt changed the base branch from main to docs/complex-selector-examples-forward-port August 7, 2026 18:26
@ernestt
ernestt requested a review from ejhammond as a code owner August 7, 2026 18:26
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Aug 7, 2026
@ernestt
ernestt merged commit ecde9b3 into docs/complex-selector-examples-forward-port Aug 7, 2026
4 checks passed
ernestt added a commit that referenced this pull request Aug 8, 2026
* feat(lab): prototype TransferList

* feat(lab): document advanced TransferList compositions

* fix(storybook): remove TransferList section padding

* feat(lab): align TransferList drag behavior

* feat(lab): add TransferListSelector shell

* refactor(lab): keep TransferListSelector self-contained
@github-actions
github-actions Bot deleted the codex/transfer-list-lab branch August 8, 2026 06:25
ernestt added a commit that referenced this pull request Aug 10, 2026
* feat(lab): add TransferListSelector (#4773)

* feat(lab): prototype TransferList

* feat(lab): document advanced TransferList compositions

* fix(storybook): remove TransferList section padding

* feat(lab): align TransferList drag behavior

* feat(lab): add TransferListSelector shell

* refactor(lab): keep TransferListSelector self-contained

* docs(storybook): add TransferListSelector examples (#4869)

* fix(lab): decouple TransferListSelector from Core expansion

This branch was successfully deployed

1 active deployment
Preview — 0d512d18 Deployed Aug 7, 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