Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 4, 2025

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)

  • Added banner property as union type: boolean | string | BannerConfig
  • Added BannerConfig with message, intent (enum), and optional color overrides
  • Added BannerIntent enum: info, warning, success, error, note, launch, tip, check
  • Added BannerColor with optional background, text, border properties
  • Marked beta property as deprecated (kept for backward compatibility)

Component Implementation (BetaBanner.tsx)

  • Created TopBanner component supporting all banner configurations
  • Parses union type with proper defaults (boolean → warning intent with default message)
  • Reuses Callout component styling patterns and icon set
  • Applies custom color overrides via inline styles when provided

Integration (LayoutEvaluator.tsx)

  • Updated to use new TopBanner component
  • Implements fallback: frontmatter?.banner ?? frontmatter?.beta
  • Renders banner before page content

Generated Files

  • Regenerated FDR SDK types for all new banner types
  • Updated EMPTY_FRONTMATTER constant with new properties

How has this PR been tested?

  • ✅ All lint checks pass (biome, stylelint, prettier)
  • ✅ Tests pass locally (pnpm test)
  • ✅ TypeScript compilation successful
  • ✅ Manual verification of fallback logic

Note: Separate docs PR (#1740) includes comprehensive usage examples and migration guidance.

Review Checklist

Critical items:

  • Verify backward compatibility: existing beta: true and beta: "message" usage still works
  • Test all 8 intent types render with correct icons and styling
  • Test custom color overrides in both light and dark modes (accessibility concern)
  • Verify fallback behavior when both banner and beta are set (should use banner)
  • Confirm deprecated marking on beta property prevents new usage

Lower priority:

  • File naming: BetaBanner.tsx exports TopBanner - consider renaming file for clarity
  • Documentation PR should be merged alongside this PR for consistency

Add support for displaying a yellow warning banner on pages to indicate beta/work-in-progress content. The beta frontmatter property accepts either a boolean (for default message) or a custom string message.

- Add beta property to Frontmatter schema in FDR API definition
- Regenerate FDR SDK with updated types
- Create BetaBanner component with yellow warning styling
- Integrate banner into LayoutEvaluator page rendering
- Update EMPTY_FRONTMATTER constant with beta property

Co-Authored-By: Deep Singhvi <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link
Contributor

vercel bot commented Nov 4, 2025

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

Project Deployment Preview Updated (UTC)
dev.ferndocs.com Ready Ready Preview Nov 4, 2025 1:21am
fern-dashboard Ready Ready Preview Nov 4, 2025 1:21am
fern-dashboard-dev Ready Ready Preview Nov 4, 2025 1:21am
ferndocs.com Ready Ready Preview Nov 4, 2025 1:21am
preview.ferndocs.com Ready Ready Preview Nov 4, 2025 1:21am
prod-assets.ferndocs.com Ready Ready Preview Nov 4, 2025 1:21am
prod.ferndocs.com Ready Ready Preview Nov 4, 2025 1:21am
1 Skipped Deployment
Project Deployment Preview Updated (UTC)
fern-platform Ignored Ignored Nov 4, 2025 1:21am

Replace beta-specific banner with flexible banner system that supports:
- Shorthand: banner: true or banner: "message"
- Full config: banner: { message, intent, color }
- Multiple intents: info, warning, success, error, note, launch, tip, check
- Optional color overrides for background, text, border
- Backward compatibility: beta property deprecated but still works

Changes:
- Update FDR schema with Banner, BannerConfig, BannerIntent, BannerColor types
- Regenerate FDR SDK with new banner types
- Replace BetaBanner with TopBanner component supporting all intents
- Update LayoutEvaluator to use banner with beta fallback
- Add banner property to EMPTY_FRONTMATTER constant

Co-Authored-By: Deep Singhvi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants