feat(docs): add beta banner frontmatter property #4719
Closed
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.
Redesign banner system with flexible intents and colors
This PR replaces the beta-specific banner with a flexible banner system that supports multiple intents and optional color customization, based on feedback from @dsinghvi.
What was the motivation & context behind this PR?
Initial implementation only supported a hardcoded yellow warning banner for beta content. User requested a more flexible system that allows customizing the banner color and intent. This enables documentation pages to display various types of notifications (info, success, error, etc.) beyond just beta warnings.
Devin session: https://app.devin.ai/sessions/e7e83710f40c44ffa20b715874c67eeb
Requested by: Deep Singhvi (@dsinghvi)
Changes
FDR Schema (
frontmatter.yml)bannerproperty as union type:boolean | string | BannerConfigBannerConfigwithmessage,intent(enum), and optionalcoloroverridesBannerIntentenum: info, warning, success, error, note, launch, tip, checkBannerColorwith optional background, text, border propertiesbetaproperty as deprecated (kept for backward compatibility)Component Implementation (
BetaBanner.tsx)TopBannercomponent supporting all banner configurationsIntegration (
LayoutEvaluator.tsx)TopBannercomponentfrontmatter?.banner ?? frontmatter?.betaGenerated Files
EMPTY_FRONTMATTERconstant with new propertiesHow has this PR been tested?
pnpm test)Note: Separate docs PR (#1740) includes comprehensive usage examples and migration guidance.
Review Checklist
Critical items:
beta: trueandbeta: "message"usage still worksbannerandbetaare set (should usebanner)betaproperty prevents new usageLower priority:
BetaBanner.tsxexportsTopBanner- consider renaming file for clarity