Skip to content

docs: seed playground previews for LayoutFooter and DropdownMenuRadioGroup (#5895, #5888) - #5975

Open
Rijul202 wants to merge 1 commit into
facebook:mainfrom
Rijul202:docs-layoutfooter-radiogroup-preview
Open

docs: seed playground previews for LayoutFooter and DropdownMenuRadioGroup (#5895, #5888)#5975
Rijul202 wants to merge 1 commit into
facebook:mainfrom
Rijul202:docs-layoutfooter-radiogroup-preview

Conversation

@Rijul202

@Rijul202 Rijul202 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Two sub-component docs render an empty properties-tab preview because they ship no example content. This seeds playground fixtures so each preview renders a working component on first load — the same approach used for the already-fixed LayoutHeader, DropdownMenuItem, and Grid/Stack family.

LayoutFooter (closes #5895)

  • Wraps the footer in a Layout parent (playground.wrapper) and seeds representative footer content + hasDivider, mirroring the sibling LayoutHeader fixture.
  • Preview now shows a visible footer on first load; the hasDivider/height controls produce an observable update.

DropdownMenuRadioGroup (closes #5888)

  • Seeds the required label, an initial selected value, and three DropdownMenuRadioItem children.
  • Preview now shows selectable radio choices on first load; the value control visibly moves the selection. Renders standalone, matching the DropdownMenuItem fixture pattern (no menu scaffold required).

Tests

Added focused coverage mirroring the existing suites:

  • component-preview-state.test.tsbuildInitialState seeds children/value and getMissingRequiredProps is satisfied for both.
  • data-extraction.test.ts — both docs declare the expected playground.defaults/wrapper.
  • component-detail-resolve-elements.test.ts — the radio-item child descriptors resolve to real elements.

Both slices are atomic, independently closable pieces of #2008. Additive only — no public API or design change.

…Group (facebook#5895, facebook#5888)

Both sub-components render an empty properties-tab stage because their docs
provide no example content. Seed playground fixtures so each preview renders a
working component on first load:

- LayoutFooter: wrap in a Layout parent and seed representative footer content
  plus hasDivider, mirroring the sibling LayoutHeader fixture.
- DropdownMenuRadioGroup: seed the required label, an initial selected value,
  and three radio-item children so the group shows selectable choices and the
  value control visibly moves the selection.

Add focused preview-state, data-extraction, and element-resolution coverage
for both.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8JP8cTVc9c8r6FqemWnVW
Copilot AI lite review requested due to automatic review settings September 3, 2026 17:34
@vercel

vercel Bot commented Sep 3, 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 Sep 3, 2026 5:39pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 3, 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 Sep 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The added playground fixtures match existing established patterns and the accompanying tests cover the intended non-empty preview behavior paths.

Pull request overview

🟢 No review blockers found — doc-only seeding of playground fixtures plus focused docsite test coverage.
Triage: docs/preview fix · non-breaking · low blast radius → fast path · checks: verified wrapper/defaults shape vs existing fixtures (LayoutHeader/DropdownMenuItem) and verified docsite preview runtime behavior paths (resolveValue/buildInitialState/wrapper rendering)

Two previously-empty sub-component “Properties” previews now render meaningful initial content by adding playground fixtures to their .doc.mjs entries, with accompanying docsite tests to prevent regressions.

Changes:

  • Add playground.defaults + playground.wrapper to LayoutFooter so it renders visibly on first load inside a Layout.
  • Add playground.defaults to DropdownMenuRadioGroup (label/value + DropdownMenuRadioItem children) so it renders selectable options on first load.
  • Add targeted docsite tests covering extraction, initial preview state seeding, and ElementDescriptor resolution for the new radio-item children.
File summaries
File Description
packages/core/src/Layout/LayoutFooter.doc.mjs Adds playground defaults and a Layout wrapper so the footer preview isn’t empty.
packages/core/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs Seeds label/value and radio-item children so the radio group preview renders usable content.
apps/docsite/src/tests/data-extraction.test.ts Asserts the new playground defaults/wrapper are present in extracted registry data.
apps/docsite/src/tests/component-preview-state.test.ts Verifies buildInitialState seeds the expected preview state for both components.
apps/docsite/src/tests/component-detail-resolve-elements.test.ts Ensures DropdownMenuRadioItem child descriptors resolve into React elements.
.changeset/layoutfooter-radiogroup-properties-preview.md Adds a patch changeset documenting the doc-metadata update in @astryxdesign/core.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LayoutFooter is good. The radio-group half overlaps #5976; this version renders menuitemradio rows outside DropdownMenu, so keyboard navigation is absent and every item has tabindex=-1. Could we keep this PR to LayoutFooter and let the scaffolded radio fix converge in #5976?

[Reviewed by Robohands]

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.

[Bug] LayoutFooter Properties preview renders no working component [Bug] DropdownMenuRadioGroup Properties preview renders no working component

3 participants