[Component Audit] DialogHeader: preserve renderable slot content by cixzhang · Pull Request #7454 · facebook/astryx · GitHub
Skip to content

[Component Audit] DialogHeader: preserve renderable slot content - #7454

Merged
cixzhang merged 1 commit into
mainfrom
night-watch-component-audit/DialogHeader/2026-10-13
Oct 13, 2026
Merged

cixzhang merged 1 commit into
mainfrom
night-watch-component-audit/DialogHeader/2026-10-13

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

User impact

People can pass any ReactNode to DialogHeader's startContent and endContent slots, but the valid node 0 did not obey either slot contract. Start content appeared as a bare flex item outside its wrapper and theme target; end content disappeared when no close button rendered.

Problem and solution fit

Both slot wrappers used JavaScript truthiness to decide whether content existed. React renders numeric zero, so the start guard leaked it as a bare child while the end guard dropped it when no close action created the wrapper. The fix uses the shared React-slot predicate already used across Astryx, consistently for subtitle and both content slots.

Expected behavior and authority

Global review routing used triggers public-api,behavior against base 0675971ec1db8b53241bf7de4dcf7491ef463ea6 and head aa5bba123ac739c694cfbfe7c3f6b1e5dd3624ed. None of the routed global claims governs React content-slot presence; direct module FR9 and FR10 settle this delta.

Smallest restoration

  • Use the shared isRenderable predicate for subtitle, start content, and end content.
  • Preserve the existing skip behavior for null, undefined, booleans, and empty strings while allowing numeric zero.
  • Add mutation-sensitive coverage for numeric zero and for every empty scalar value across both public slots. No public API, visual representation, default, documentation, or interaction model changes.

Evidence

  • Reproduction before the change: the focused regression failed because start content lacked its wrapper and end content had no wrapper or rendered value for 0.
  • Result after the change: both wrappers render and each contains the numeric zero; empty scalar values still add no wrapper.
  • Representative unchanged path: all 531 focused Dialog, DialogHeader, imperative-dialog, a11y-jsdom, and theming-target tests pass.
  • Regression test or other mutation-sensitive proof: restoring either truthiness guard makes the numeric-zero assertion fail; replacing isRenderable with a nullish check makes the empty-scalar matrix fail.

Component audit score

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm vitest run packages/core/src/Dialog/Dialog.test.tsx packages/core/src/Dialog/DialogHeader.test.tsx packages/core/src/Dialog/useImperativeDialog.test.tsx packages/core/src/Dialog/__tests__/Dialog.a11y.test.tsx packages/core/src/theme/themingTargets.test.ts
  • cd packages/core && pnpm typecheck
  • pnpm build
  • pnpm storybook:build
  • pnpm lint:strict
  • pnpm check:knowledge
  • pnpm check:changesets
  • pnpm check:sync

There is no visual delta. Exact-head accessibility, RTL, and visual regression workflows remain required before merge.

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

@astracat-bot

astracat-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 13, 2026, 10:56 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 13, 2026
@cixzhang
cixzhang force-pushed the night-watch-component-audit/DialogHeader/2026-10-13 branch from 4039d35 to aa5bba1 Compare October 13, 2026 10:56
@github-actions

Copy link
Copy Markdown
Contributor

@cixzhang
cixzhang merged commit 675b29d into main Oct 13, 2026
53 checks passed
@cixzhang
cixzhang deleted the night-watch-component-audit/DialogHeader/2026-10-13 branch October 13, 2026 11:15

This branch was successfully deployed

1 active deployment
Preview — aa5bba12 Deployed Oct 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