fix(docsite): seed OverflowList properties-tab preview with items#3183
Conversation
Closes facebook#2872. OverflowList's children prop is required, so the properties-tab preview rendered an empty list. Add playground.defaults.children (a few Button items) so the interactive preview shows a real, meaningful list. Adds a preview-state test asserting the children resolve and no required props are reported missing.
|
Someone is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Nice! There's a merge conflict. |
cixzhang
left a comment
There was a problem hiding this comment.
I authorized the preview so we can take a look. We could maybe provide some width to the overflow list's container, and maybe add a default for the overflowRenderer in the playground as well since it only shows one item by default right now. Thanks for working on this!
|
Thanks for authorizing the preview! Two things, one with a constraint:
Given that, I think the cleaner way to show overflow properly (constrained width + a real
Happy to do either/both. (Heads-up: I can't launch a browser in my environment, so I'd lean on your authorized preview to confirm the visual once I push.) |
… row Addresses facebook#3183 review (cixzhang): the properties-tab preview only showed one item because OverflowList measured its own collapsed width. Set behavior: 'observeParent' in the playground defaults so it measures the full-width preview container and renders the whole row.
|
Pushed option (a): added On the |
|
The merge conflicts prevent build. If you're able to rebase I can help reauthorize the preview. |
# Conflicts: # apps/docsite/src/__tests__/component-preview-state.test.ts
|
Rebased/merged Recap of what's here: seeded |
|
I think this is okay for now. Thank you for fixing the preview! |
| export type XLEExample = {category: string; label: string; expr: string}; | ||
|
|
||
| export const XLE_EXAMPLES: XLEExample[] = [ | ||
| {category: "Pages", label: "Analytics dashboard", expr: "A[cp6 @topNav=TN @sideNav=SN] > L > LC > V[g6] > (H[j=between a=center] > Hd\"Analytics\"[level=2] + (H[g2] > B\"Export\" + B.primary\"New report\")) + (G[c4 g4] > (C[p6] > V[g1] > Tx.lg\"\\$42k\" + Tx[t=supporting]\"Revenue\")*4) + (G[c{min:340} g4] > C{card-callout} + C{card-callout}) + (C[p0] > T[striped] > (TR>THC\"Order\"+THC\"Customer\"+THC\"Status\"+THC\"Total\") + (TR>TC\"#10$\"+TC\"Acme Inc\"+(TC>Bd.success\"Paid\")+TC\"\\$120\")*5)"}, |
There was a problem hiding this comment.
Mostly formatting. Unrelated but okay.
Summary
Closes #2872.
OverflowList'schildrenprop is required, so the docsite properties-tab preview rendered an empty list ("can't render standalone"). Addplayground.defaults.children(a few Button items) so the interactive preview shows a real, meaningful list.packages/core/src/OverflowList/OverflowList.doc.mjs— addedplayground.defaults.children.Testing
buildInitialStateresolves the seeded children into 3 elements andgetMissingRequiredPropsis empty.component-preview-state.test.ts— 9/9 pass.Changeset
Included (
@astryxdesign/corepatch, docs).