perf(playground): optimize rendering and bundle imports - #1458
Conversation
- Add optimizePackageImports for lucide-react, radix-ui, date-fns - Add content-visibility CSS for deferred off-screen rendering - Memoize AssistantMessage and UserMessage components - Extract message parts in single pass instead of multiple filters - Redesign provider OG image with cleaner centered layout Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughThis PR introduces performance optimizations and UI refinements. It adds Next.js package import optimization configuration, CSS rendering performance rules for message lists, refactors chat message rendering with memoized components, and redesigns the provider OpenGraph image with a simplified, centered layout. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (6)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx,json,md}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/{ui,playground}/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{js,ts,tsx,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/{ui,playground,docs}/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2025-12-03T12:42:14.219ZApplied to files:
📚 Learning: 2025-12-03T12:42:26.162ZApplied to files:
🧬 Code graph analysis (1)apps/ui/src/app/providers/[id]/opengraph-image.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (10)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
optimizePackageImportsfor lucide-react, radix-ui/react-icons, and date-fns to speed up dev server boot (15-70% faster)content-visibility: autoCSS for deferred off-screen rendering of message lists (10x faster initial render for long conversations)AssistantMessageandUserMessagecomponents to prevent unnecessary re-renders during streamingTest plan
/providers/[id]🤖 Generated with Claude Code
Summary by CodeRabbit
Performance
Style
✏️ Tip: You can customize this high-level summary in your review settings.