Skip to content

fix(docsite): seed OverflowList properties-tab preview with items#3183

Open
durvesh1992 wants to merge 1 commit into
facebook:mainfrom
durvesh1992:fix/overflowlist-properties-preview
Open

fix(docsite): seed OverflowList properties-tab preview with items#3183
durvesh1992 wants to merge 1 commit into
facebook:mainfrom
durvesh1992:fix/overflowlist-properties-preview

Conversation

@durvesh1992

Copy link
Copy Markdown
Contributor

Summary

Closes #2872.

OverflowList's children prop is required, so the docsite properties-tab preview rendered an empty list ("can't render standalone"). Add playground.defaults.children (a few Button items) so the interactive preview shows a real, meaningful list.

packages/core/src/OverflowList/OverflowList.doc.mjs — added playground.defaults.children.

Testing

  • Added a preview-state test: buildInitialState resolves the seeded children into 3 elements and getMissingRequiredProps is empty. component-preview-state.test.ts — 9/9 pass.
  • Regenerated the docsite data and confirmed the playground children are present in the generated component registry.

Note: the properties-tab preview renders client-side, so I verified the fix at the data/logic level (same approach as the Icon/Skeleton preview fix in #3175). A quick visual check on the running docsite is welcome — I couldn't launch a browser in my environment.

Changeset

Included (@astryxdesign/core patch, docs).

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.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 26, 2026
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jun 26, 2026 10:08pm

Request Review

@cixzhang

Copy link
Copy Markdown
Contributor

Nice! There's a merge conflict.

@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.

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!

@durvesh1992

Copy link
Copy Markdown
Contributor Author

Thanks for authorizing the preview! Two things, one with a constraint:

  1. Width / only one item showing — the list is behavior: 'observeSelf' by default, and in the centered preview it measures ~its own content width and collapses. I can switch the playground default to behavior: 'observeParent' so it sizes to the preview container and shows the full row. (Quick one-line change.)

  2. Default overflowRenderer — here's the snag: playground.defaults values are serialized into the generated registry (they go through resolveValue/ElementDescriptors), so they can only be JSON-serializable. overflowRenderer is a (items) => ReactNode function, which can't be expressed there. So the auto-generated Properties preview can't really demonstrate the overflow "+N" affordance.

Given that, I think the cleaner way to show overflow properly (constrained width + a real overflowRenderer "+N" badge) is a dedicated showcase/example block for OverflowList, which is plain code and can include the function. Want me to:

  • (a) just add behavior: 'observeParent' here so the Properties preview at least shows the full list, and/or
  • (b) add a proper showcase block demonstrating overflow with an overflowRenderer?

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.)

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.

XDSOverflowList: properties tab shows no content (component can't render standalone)

2 participants