Skip to content

fix(core): add playground wrapper and defaults for LayoutPanel docsite preview - #5919

Open
Geervan wants to merge 5 commits into
facebook:mainfrom
Geervan:fix/layout-panel-doc-wrapper
Open

fix(core): add playground wrapper and defaults for LayoutPanel docsite preview#5919
Geervan wants to merge 5 commits into
facebook:mainfrom
Geervan:fix/layout-panel-doc-wrapper

Conversation

@Geervan

@Geervan Geervan commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #5897

Summary

Updates InteractivePreview.tsx to support wrapper.slotProp and configures LayoutPanel.doc.mjs with slotProp: 'start' so LayoutPanel is rendered inside Layout's start sidebar slot with a neighbor LayoutContent section.

Problem / Review Feedback

Previously, wrapper: { component: 'Layout' } passed LayoutPanel as generic children to <Layout>, which placed it in <Layout>'s content slot. Because LayoutPanel uses LayoutAreaContext to determine border position (area === 'start'), toggling hasDivider left both borders at 0px without a visible visual change.

Solution

  • Updated InteractivePreview.tsx to pass the previewed subcomponent directly into wrapper.slotProp when specified.
  • Configured LayoutPanel.doc.mjs with slotProp: 'start' and a neighbor LayoutContent in content.
  • Updated data-extraction.test.ts to assert slotProp: 'start'.
  • Added patch changeset file .changeset/layout-panel-playground-wrapper.md.

Verification

  • Toggling hasDivider ON in the live docsite preview draws the 1px right border between the panel and main content area.
  • Toggling hasDivider OFF removes the border line.
  • All 105 data-extraction vitest unit tests pass.

@vercel

vercel Bot commented Sep 2, 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 7:47pm UTC

Request Review

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

github-actions Bot commented Sep 2, 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

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

Bundle Size Summary

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

Accessibility Audit

Status: No accessibility violations detected.


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

@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 for restoring the visible preview. It still misrepresents hasDivider: this wrapper passes the panel as Layout’s children, so it receives content-slot context rather than start or end. On the exact preview, toggling hasDivider leaves both borders at 0px and produces identical pixels. Please place the previewed panel in a real panel slot and cover that behavior.

[Reviewed by Robohands]

@Geervan
Geervan force-pushed the fix/layout-panel-doc-wrapper branch from d5d1eea to 7ba3fbb Compare September 3, 2026 04:54
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Sep 3, 2026
@Geervan
Geervan force-pushed the fix/layout-panel-doc-wrapper branch from 7ba3fbb to 63ee5ce Compare September 3, 2026 04:57
github-actions Bot added a commit that referenced this pull request Sep 3, 2026

@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 for fixing the divider context. This head dropped LayoutPanel's playground defaults, wrapper config, and generated-entry regression from the prior head. The generated registry therefore gives LayoutPanel only Layout's inherited header/content/footer defaults and no wrapper, so the new slotProp path never runs; its Properties preview remains empty and hasDivider cannot be inspected. Can you restore the LayoutPanel playground config and regression assertion, now with slotProp: 'start' and representative content? If you'd rather talk it through with someone, we're in Discord.

[Reviewed by Robohands]

@Geervan
Geervan marked this pull request as draft September 3, 2026 18:07
@Geervan
Geervan marked this pull request as ready for review September 3, 2026 18:13
@Geervan

Geervan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

cant figure why deployment is failing, but the ci passes, so leaving this as is without any further changes, until requested

github-actions Bot added a commit that referenced this pull request Sep 3, 2026

@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 — the wrapper/defaults now behave correctly in the live preview. Production still fails because PlaygroundConfig.wrapper is hand-written again in generate-data.mjs; that second schema copy omitted slotProp, so the generated registry does not typecheck. Please make the generated registry reuse or derive the authoring type and add a focused render/build regression for slotProp; the current extraction assertion passes while this failure remains. If you'd rather talk it through with someone, we're in Discord.

[Reviewed by Robohands]

@github-actions
github-actions Bot requested a review from cixzhang September 3, 2026 19:43
@github-actions github-actions Bot removed the needs:design-review Affects visuals — Design should review label Sep 3, 2026
@Geervan

Geervan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the generated registry schema drift by deriving PlaygroundConfig and element descriptors from the CLI authoring types. Added regression coverage that requires generated playground configs to accept slotProp: 'start', so the generated registry/typecheck will fail if it is omitted again. Data extraction, core docs typecheck, and docsite TypeScript checks pass.

github-actions Bot added a commit that referenced this pull request Sep 3, 2026

@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 — LayoutPanel's Properties preview now stays visible and its divider works, while the generated registry shares the authoring type. Looks good.
[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] LayoutPanel Properties preview renders no working component

3 participants