docs(ChatComposerTokenElement): add playground token fixture (#5886) - #5906
Conversation
…k#5886) The Properties tab preview showed "Interactive preview needs required props that cannot be generated automatically. Missing: token." because the doc had no playground.defaults entry for the required `token` prop, and the generic preview cannot synthesize a ChatComposerToken. Add a minimal badge-style token fixture to playground.defaults, matching the pattern used by other docs with required object props (e.g. Citation, NavMenu, Dialog). buildInitialState() seeds state.token from this default, so getMissingRequiredProps() no longer reports it and the token chip renders. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Hi @Rijul202! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟡 Changes recommended
It adds a new docsite-facing default for a previously broken preview path but does not include the focused docsite test coverage called for in the linked issue’s acceptance criteria.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes the docsite “missing required props” placeholder for ChatComposerTokenElement by providing a concrete playground.defaults.token fixture, enabling the Properties tab interactive preview to render a token chip immediately.
Changes:
- Add
playground.defaults.tokentoChatComposerTokenElementcomponent docs to satisfy the requiredtoken: ChatComposerTokenprop.
File summaries
| File | Description |
|---|---|
| packages/core/src/Chat/ChatComposerTokenElement.doc.mjs | Seeds a minimal badge-style token in playground.defaults so the docsite interactive preview can render without missing-props errors. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| playground: { | ||
| defaults: { | ||
| token: {value: '@astryx', label: '@astryx', variant: 'blue'}, | ||
| }, | ||
| }, |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, I checked the docsite and looks good!
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsChat (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
…5906) The Properties tab preview showed "Interactive preview needs required props that cannot be generated automatically. Missing: token." because the doc had no playground.defaults entry for the required `token` prop, and the generic preview cannot synthesize a ChatComposerToken. Add a minimal badge-style token fixture to playground.defaults, matching the pattern used by other docs with required object props (e.g. Citation, NavMenu, Dialog). buildInitialState() seeds state.token from this default, so getMissingRequiredProps() no longer reports it and the token chip renders. Co-authored-by: Rijul202 <rijulyadav208@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Closes #5886.
Problem
On the
ChatComposerTokenElementProperties tab, the preview renders:The doc has a required
tokenprop of typeChatComposerTokenbut noplayground.defaultsentry for it, and the generic preview cannot synthesize that object automatically.Fix
Add a minimal badge-style
tokenfixture toplayground.defaults:This follows the same pattern as other docs whose required props are objects — e.g.
Citation(source),NavMenu(children),Dialog(children). The badge shape ({value, label, variant?}) matchesChatComposerTokenas used elsewhere in the package (e.g.ChatComposerInput.test.tsx, which usesvariant: 'blue').Why it works
In
apps/docsite/src/components/component-detail/interactiveState.ts,buildInitialState()seeds state fromplayground.defaultsbefore computing missing props, andgetMissingRequiredProps()only reports required props wherestate[name] === undefined. With the default present,state.tokenis defined, sotokenis no longer reported missing and the token chip renders.Docs-only change (single
.doc.mjs), no public API or runtime change.