Skip to content

fix(core): forward pass-through props on six more BaseProps components - #5656

Open
harjothkhara wants to merge 1 commit into
facebook:mainfrom
harjothkhara:oss-find/astryx-2026-08-28
Open

fix(core): forward pass-through props on six more BaseProps components#5656
harjothkhara wants to merge 1 commit into
facebook:mainfrom
harjothkhara:oss-find/astryx-2026-08-28

Conversation

@harjothkhara

Copy link
Copy Markdown
Contributor

Summary

Six components declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. This forwards them, following the exact pattern of the three earlier batches for this class (#5288, #5493, #5563).

Case

#5254 found ten components with this shape against the 0.4.5 tarball; #5563 closed it as the final batch. Sweeping current main (1b706d5d2) the same way — every packages/core/src component whose props interface extends BaseProps, checked for a rest element in its destructure — finds seven more that were not in #5254's list:

Fix

Each component forwards the rest object to the element its ref targets, spread so contract-owned attributes (role, computed aria-labelledby/aria-describedby, the roving tabIndex) cannot be clobbered. Where the component already owns a handler for the same event, the caller's handler is composed in front with composeEventHandlers, per the existing convention:

  • RadioList composes onFocus with its tooltip-anchor focus handling
  • TimeInput composes onFocus, onBlur, and onKeyDown with its formatting and arrow-key stepping handlers, so a caller handler runs first and stepping still works (asserted in the tests)

Scope

Testing

  • 15 new focused tests across the six suites (attribute forwarding, handler forwarding, and contract-preservation guards).
  • Red proof: with the tests added and the component fixes reverted, 13 fail and all 209 pre-existing tests in those suites pass — every meaningful new test detects this PR. The other 2 new tests are contract guards that pass by design before and after.
  • Green: the six suites pass 222/222 after the fix.
  • Full repo vitest run (pnpm -F @astryxdesign/core test): 12890 passed with this change vs 12875 at base — the only delta is the 15 new tests. 31 failures appear in both runs identically (Dialog/Toast motion, packages/build vite layers, CLI doc tests); the same 7 files pass 170/170 when run standalone at base, so they are full-suite-only and pre-existing, not from this change.
  • @astryxdesign/core typecheck: passing.
  • node scripts/check-changesets.mjs: 74 changesets valid.
  • No doc.mjs/story changes: the typed surface is unchanged — this makes the existing types truthful (same as fix(core): forward pass-through props on seven BaseProps components #5563).

Changeset: .changeset/baseprops-passthrough-batch-four.md (@astryxdesign/core: patch).

Refs #5254 (the original report for this class; its list predates these six)

Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and
TopNavMegaMenuItem declared extends BaseProps but destructured a closed
set of props with no rest spread, so aria-*, id, data-*, and event
handlers type-checked and silently never reached the DOM. Forward the
rest object to the element each ref targets, composing consumer handlers
in front of component-owned ones with composeEventHandlers (RadioList
onFocus; TimeInput onFocus/onBlur/onKeyDown). Same class and same fix
shape as the facebook#5254 batches (facebook#5288, facebook#5493, facebook#5563); these six were not in
that issue's tarball-derived list. PowerSearch shares the shape and is
deliberately left out - its forwarding target is an API decision.
@vercel

vercel Bot commented Aug 28, 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 28, 2026 4:56pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 28, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Aug 28, 2026
github-actions Bot added a commit that referenced this pull request Aug 28, 2026
@github-actions

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.

Modified Components

Layout (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1483 -
Complexity N/A Very High (84) -
MetadataList (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 368 -
Complexity N/A Very High (35) -
NavMenu (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 307 -
Complexity N/A High (24) -
RadioList (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 442 -
Complexity N/A Very High (44) -
TimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 493 -
Complexity N/A Very High (82) -
TopNav (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 2168 -
Complexity N/A Very High (150) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

RadioList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

1274 added · 0 removed. View the report

To accept these exact frames: /accept-visual 33191978957/1 <reason>

Added — After
Added — After visual regression frame

Added — After
Added — After visual regression frame

Added — After
Added — After visual regression frame


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

@harjothkhara
harjothkhara marked this pull request as ready for review August 29, 2026 02:36
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. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant