Skip to content

fix(core): forward pass-through props on seven BaseProps components - #5563

Merged
cixzhang merged 1 commit into
mainfrom
fix-baseprops-passthrough
Aug 26, 2026
Merged

cixzhang merged 1 commit into
mainfrom
fix-baseprops-passthrough

Conversation

@cixzhang

@cixzhang cixzhang commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

Seven remaining components declare BaseProps but dropped props they did not explicitly destructure. Those props type-checked yet never reached the DOM.

This is the third and final change for #5254:

  1. #5288 by @lexs landed first for List and Markdown.
  2. #5493 by @gonzoblasco landed second for TreeList.
  3. This PR now covers only MetadataListItem, NavHeadingMenu, Timestamp, Token, TopNavMegaMenu, TopNavMenu, and TypeaheadItem.

Fixes #5254.

What

  • Forward neutral aria-*, id, tabIndex, event-handler, and data-* props to the intended DOM element.
  • Keep styling merged through mergeProps, contract-owned attributes after the rest spread, and conditional attributes absent when the component does not own them.
  • Compose caller handlers first with component behavior for both top-nav desktop triggers (onClick, onMouseEnter, onMouseLeave), both drawer triggers (onClick), NavHeadingMenu keyboard handling, and TokenLink mouse-up delegation.
  • Keep MetadataListItem props on the wrapper <div> when stacked and the <dt> when inline.
  • Keep the existing TypeaheadItem item.element early return as a documented hole: a caller-owned ReactNode is returned untouched rather than inventing cloneElement semantics.

Testing

  • Seven focused component suites: 241 passed.
  • Revert verification against current origin/main: all eight implementation files were confirmed reverted; 27 new tests failed and 214 existing tests passed, so every added regression test detects this PR.
  • @astryxdesign/core typecheck: passed.
  • Pre-commit lint/format and repository checks: passed.

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

vercel Bot commented Aug 26, 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 26, 2026 6:50pm

Request Review

@github-actions

github-actions Bot commented Aug 26, 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.

Modified Components

MetadataList (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 366 -
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 305 -
Complexity N/A High (24) -
Timestamp (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 681 -
Complexity N/A Very High (80) -
Token (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 457 -
Complexity N/A High (22) -
TopNav (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 2163 -
Complexity N/A Very High (150) -
Typeahead (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1189 -
Complexity N/A Very High (165) -

Bundle Size Summary

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

Accessibility Audit

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

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

Visual Regression

Status: Skipped — 256 shots exceeds the 240-shot budget (6 components touched) — too broad to review shot by shot here. The daily release gate covers this change against the full baseline.


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

github-actions Bot added a commit that referenced this pull request Aug 26, 2026
github-actions Bot added a commit that referenced this pull request Aug 26, 2026
Complete the BaseProps forwarding fix after List, Markdown, and TreeList landed separately. Preserve component-owned attribute precedence and compose caller handlers before built-in behavior.
@cixzhang
cixzhang force-pushed the fix-baseprops-passthrough branch from af004c6 to 84f3a17 Compare August 26, 2026 18:46
@cixzhang cixzhang changed the title fix(core): forward pass-through props on ten components that declare BaseProps and drop them fix(core): forward pass-through props on seven BaseProps components Aug 26, 2026
@gonzoblasco

Copy link
Copy Markdown
Contributor

Solid work - the pass-through + composeEventHandlers pattern matches the List/TreeList work cleanly, and the revert verification is a nice touch.

One thing worth flagging on the PR analysis report: the two serious a11y violations it surfaced (color contrast, WCAG 1.4.3) on Timestamp and Token are not regressions from this change. This PR only forwards props and reorders attributes - it does not touch any color values. So whatever contrast failures exist on those two components are pre-existing in the base component/theme, not introduced here, and should not block this merge or be attributed to it. They are a separate, worthwhile audit of the theme layer (the color variants and disabled states are the first places I would look).

The Timestamp handling is the sharpest part: keeping the component's own spelled-out relative label when the caller also passes aria-label is the right call - "2 hours ago" reads better than a static caller string, and letting the caller clobber it would regress that.

github-actions Bot added a commit that referenced this pull request Aug 26, 2026
@cixzhang
cixzhang merged commit d1807b8 into main Aug 26, 2026
21 checks passed
@github-actions
github-actions Bot deleted the fix-baseprops-passthrough branch August 27, 2026 09:11
harjothkhara added a commit to harjothkhara/astryx that referenced this pull request Sep 3, 2026
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 meta#5254 batches (meta#5288, meta#5493, meta#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.
harjothkhara added a commit to harjothkhara/astryx that referenced this pull request Sep 3, 2026
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 meta#5254 batches (meta#5288, meta#5493, meta#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.
harjothkhara added a commit to harjothkhara/astryx that referenced this pull request Sep 3, 2026
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 meta#5254 batches (meta#5288, meta#5493, meta#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.
harjothkhara added a commit to harjothkhara/astryx that referenced this pull request Sep 3, 2026
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 that owns each component's contract, spread
first so owned attributes win. Where the component owns the same event,
handlers compose component-first with composeEventHandlers so owned
behavior (focus normalization, arrow stepping, blur reconciliation) is
uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on
both its typed and native-picker paths). A caller id is honored via
id ?? generatedId per the Selector precedent, and caller aria-labelledby
and aria-describedby compose additively with the owned ids. Same class
and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six
were not in that issue's tarball-derived list. PowerSearch and
MultiSelector share the shape and are deliberately left out - their
forwarding is an API decision and a Selector-precedent follow-up.

Co-Authored-By: Claude Fable 5 <[email protected]>
harjothkhara added a commit to harjothkhara/astryx that referenced this pull request Sep 3, 2026
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 that owns each component's contract, spread
first so owned attributes win. Where the component owns the same event,
handlers compose component-first with composeEventHandlers so owned
behavior (focus normalization, arrow stepping, blur reconciliation) is
uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on
both its typed and native-picker paths). A caller id is honored via
id ?? generatedId per the Selector precedent, and caller aria-labelledby
and aria-describedby compose additively with the owned ids. Same class
and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six
were not in that issue's tarball-derived list. PowerSearch and
MultiSelector share the shape and are deliberately left out - their
forwarding is an API decision and a Selector-precedent follow-up.

Co-Authored-By: Claude Fable 5 <[email protected]>
harjothkhara added a commit to harjothkhara/astryx that referenced this pull request Sep 3, 2026
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 that owns each component's contract, spread
first so owned attributes win. Where the component owns the same event,
handlers compose component-first with composeEventHandlers so owned
behavior (focus normalization, arrow stepping, blur reconciliation) is
uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on
both its typed and native-picker paths). A caller id is honored via
id ?? generatedId per the Selector precedent, and caller aria-labelledby
and aria-describedby compose additively with the owned ids. Same class
and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six
were not in that issue's tarball-derived list. PowerSearch and
MultiSelector share the shape and are deliberately left out - their
forwarding is an API decision and a Selector-precedent follow-up.

Co-Authored-By: Claude Fable 5 <[email protected]>
harjothkhara added a commit to harjothkhara/astryx that referenced this pull request Sep 3, 2026
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 that owns each component's contract, spread
first so owned attributes win. Where the component owns the same event,
handlers compose component-first with composeEventHandlers so owned
behavior (focus normalization, arrow stepping, blur reconciliation) is
uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on
both its typed and native-picker paths). A caller id is honored via
id ?? generatedId per the Selector precedent, and caller aria-labelledby
and aria-describedby compose additively with the owned ids. Same class
and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six
were not in that issue's tarball-derived list. PowerSearch and
MultiSelector share the shape and are deliberately left out - their
forwarding is an API decision and a Selector-precedent follow-up.

Co-Authored-By: Claude Fable 5 <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 84f3a176 Deployed Aug 26, 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.

[Bug] Ten components declare extends BaseProps but drop every prop they don't destructure

2 participants