fix(docsite): seed Grid/Stack family Properties previews with playground defaults - #5912
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsGrid (@astryxdesign/core) · View in Storybook
Stack (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, the six previews now render correctly. One thing before merge: the tests duplicate the new fixture values instead of reading the docs. I reverted all six playground configs and every changed test still passed (36/36), so the empty-preview bug can return undetected. Could you assert the extracted playground configs, especially both wrappers, in data-extraction.test.ts?
[Reviewed by Robohands]
…und defaults Grid, Stack, HStack, VStack, GridSpan, and StackItem all rendered an empty Properties-tab preview: the parent components had no playground children, and the two sub-components (GridSpan, StackItem) render nothing meaningful without the parent context they participate in. Grid/Stack/HStack/VStack get playground.defaults.children (a few Card elements). GridSpan and StackItem get their own playground overriding the inherited one, using playground.wrapper to render them inside a real Grid/HStack so the span/fill behavior is actually visible instead of an isolated, context-less box. Verified against the real docsite dev server (pnpm generate && next dev), not just the source: all six Properties-tab pages now render real, non-empty previews. Fixes facebook#5892, facebook#5893, facebook#5894, facebook#5898, facebook#5899, facebook#5900
…istry The existing tests exercised the playground mechanism (buildInitialState, resolveValue) with hand-typed fixture values matching the new configs, not the actual persisted .doc.mjs playground fields. Reverting the six playground configs left every changed test passing, so the empty-preview bug could return undetected. Adds assertions against componentRegistry (built fresh from the actual .doc.mjs source via `pnpm generate`) for all six components, covering both wrappers (GridSpan into Grid, StackItem into HStack). Verified these catch a revert: reverted the three doc.mjs files, regenerated, confirmed all six new tests fail, then restored the real changes and confirmed they pass again.
71f63af to
4972ccd
Compare
|
Good catch, confirmed the exact gap: my tests exercised the playground mechanism with hand-typed fixture values, not the actual persisted Verified these actually catch a revert before pushing: reverted the three |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this now protects the real generated registry: removing any of the six preview configs fails the new tests, and all six Properties previews render correctly.
[Reviewed by Robohands]
…und defaults (#5912) * fix(docsite): seed Grid/Stack family Properties previews with playground defaults Grid, Stack, HStack, VStack, GridSpan, and StackItem all rendered an empty Properties-tab preview: the parent components had no playground children, and the two sub-components (GridSpan, StackItem) render nothing meaningful without the parent context they participate in. Grid/Stack/HStack/VStack get playground.defaults.children (a few Card elements). GridSpan and StackItem get their own playground overriding the inherited one, using playground.wrapper to render them inside a real Grid/HStack so the span/fill behavior is actually visible instead of an isolated, context-less box. Verified against the real docsite dev server (pnpm generate && next dev), not just the source: all six Properties-tab pages now render real, non-empty previews. Fixes #5892, #5893, #5894, #5898, #5899, #5900 * chore(changeset): add patch changeset for Grid/Stack Properties preview fix * test(docsite): assert Grid/Stack playground configs from the real registry The existing tests exercised the playground mechanism (buildInitialState, resolveValue) with hand-typed fixture values matching the new configs, not the actual persisted .doc.mjs playground fields. Reverting the six playground configs left every changed test passing, so the empty-preview bug could return undetected. Adds assertions against componentRegistry (built fresh from the actual .doc.mjs source via `pnpm generate`) for all six components, covering both wrappers (GridSpan into Grid, StackItem into HStack). Verified these catch a revert: reverted the three doc.mjs files, regenerated, confirmed all six new tests fail, then restored the real changes and confirmed they pass again.
Problem
Six components in the Grid/Stack layout family rendered an empty Properties-tab preview:
playground.defaults, so the preview had no children.Each is an atomic, independently closable slice of #2008, filed by the nightly vibe-test bot as #5892, #5893, #5894, #5898, #5899, #5900.
Fix
Followed the established pattern from prior merged fixes of this exact class (#4138, #2815, #3183, #3175):
playground.defaults.children, a fewCardelements, matching the convention inCard.doc.mjs/OverflowList.doc.mjs.playground(overriding the one it would otherwise inherit from its parent doc) usingplayground.wrapperto render it inside a realGrid/HStack, so the span/fill behavior is actually visible.Testing
component-preview-state.test.ts(Grid, Stack, HStack, VStack, matching the exact style of the existing OverflowList/DropdownMenu tests) andcomponent-detail-resolve-elements.test.ts(GridSpan, StackItem, verifying theirplayground.wrapperconfig resolves to a real component).apps/docsitetest suite: 443 passing (17 pre-existing failures unrelated to this change, confirmed identical on a clean baseline).tsc --noEmit: 27 pre-existing errors, identical count with and without this diff.pnpm generate && next dev), not just the source or unit tests: navigated to all six Properties-tab pages and visually confirmed each renders a real, non-empty preview (Grid shows three cards in a 3-column layout, Stack/HStack/VStack each show three cards in their respective direction, GridSpan shows "Spans 2 columns" inside a real Grid, StackItem shows a full-width "Fills the row" card inside a real HStack). No screenshots attached; my environment for this session doesn't have a straightforward way to export the browser tool's captures as attachable image files, so this is a direct description of what was checked rather than a substitute for it.Fixes #5892, #5893, #5894, #5898, #5899, #5900