docs: add example blocks for 46 components with no viewable code (#2759)#3481
Open
AKnassa wants to merge 2 commits into
Open
docs: add example blocks for 46 components with no viewable code (#2759)#3481AKnassa wants to merge 2 commits into
AKnassa wants to merge 2 commits into
Conversation
…ebook#2759) Every component with a showcase now has at least one example block (type: 'block', no isShowcase) so its docsite page shows viewable, copyable code in the Examples section. Excluded: Blockquote (covered by facebook#3385) and Lightbox (covered by facebook#3301).
Use headingHref over deprecated href in TopNavHeading; correct componentsUsed cross-links in 14 block docs; differentiate MobileNavToggle, Resizable, and CommandPaletteFooter examples from their showcases; match TopNavItem preview ratio to its showcase.
|
@AKnassa is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds a copyable code example to 46 component pages on the docsite that previously showed only a hero visual and an empty Examples section.
Fixes the bulk of #2759.
Why
Every component page has a showcase (the hero at the top), but the Examples section is built separately from example blocks — and 46 components had none, so there was no code to view or copy anywhere on their page.
What changed
.tsx+.doc.mjspair,type: 'block', noisShowcase) for each of the 46 components, placed next to each component's existing showcase and following the established pattern (e.g.Avatar/AvatarWithImage).headingHref),componentsUsedcross-links match what each example really renders, and examples demonstrate something beyond their showcase where it matters (MobileNavToggle custom trigger, Resizable collapsible + snap points, CommandPaletteFooter default keyboard hints).Scope notes
How to see it
Run
pnpm devinapps/docsite, then open any affected page, e.g./components/ButtonGroup,/components/Resizable, or/components/MobileNavToggle— each now has an Examples section with viewable, copyable code. Onmain, those sections are empty.Verified: docsite data generation, 210/210 docsite tests,
tsc --noEmit, and a full production build all pass.https://claude.ai/code/session_018TamXn2FajoSU6gXqts7hk