feat: add indicator when there are pending invitations#2146
Conversation
WalkthroughNavLink.title now accepts React.ReactNode and NavLink gains an optional className. Invitations nav item (DashboardLayout/MobileNav) renders as a React node with a conditional animated ping badge. Sidenav applies per-item className; user-menu replaces static dots with a two-element non-interactive ping indicator. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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). (4)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
studio/src/components/layout/sidenav.tsx (1)
210-210: Class applied to title span, not the LinkSame note as above: the
item.classNamehere targets the title span. If the intent is to affect the entire clickable row, consider moving the class to the Link container or using a separatetitleClassName.
🧹 Nitpick comments (3)
studio/src/components/user-menu.tsx (2)
55-57: Nice animated avatar badge; makehasInvitationsnull-safeGreat UX improvement. However, if
user.invitationsis everundefined,user.invitations.lengthwill throw. Safer to coerce with optional chaining.Use this instead when computing
hasInvitations:const hasInvitations = !!user?.invitations?.length;
71-72: Make the menu badge non-interactive and hidden from screen readersPrevent the badge from intercepting clicks and mark as decorative.
Apply this diff:
- <div className="absolute size-2 animate-ping rounded-full bg-blue-400" /> - <div className="size-2 rounded-full bg-blue-400" /> + <div aria-hidden="true" className="absolute size-2 animate-ping rounded-full bg-blue-400 pointer-events-none" /> + <div aria-hidden="true" className="size-2 rounded-full bg-blue-400 pointer-events-none" />studio/src/components/layout/sidenav.tsx (1)
31-33: NavLink API: title as ReactNode + className is good; clarify className target
classNameapplies to the title span (not the Link container). Consider renaming totitleClassNameor documenting this to avoid confusion for consumers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
studio/src/components/layout/dashboard-layout.tsx(1 hunks)studio/src/components/layout/sidenav.tsx(4 hunks)studio/src/components/user-menu.tsx(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
studio/src/components/layout/sidenav.tsx (2)
studio/src/components/ui/link.tsx (1)
Link(5-16)studio/src/lib/utils.ts (1)
cn(6-8)
⏰ 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). (4)
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (2)
studio/src/components/layout/sidenav.tsx (1)
10-10: LGTM on ReactNode importImporting ReactNode for the new
NavLink.titleshape is appropriate.studio/src/components/layout/dashboard-layout.tsx (1)
263-263: Per-item className for Invitations is fineWorks with the updated SideNav API. Just remember this class targets the title span (as implemented in SideNav), not the Link container.
…ending-invitations
Summary by CodeRabbit
New Features
Style
Checklist