Show networkStatus badge in PartnerRowItem - #3988
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAPI and schemas drop applicationEvent and add country, referredByPartnerId, and includePartnerPlatforms. UI adds PartnerNetworkStatusBadge, makes TrustedPartnerBadge configurable, surfaces optional partner.networkStatus, removes applicationEvent-based source rendering, and updates a client SWR call and referral-icon props. ChangesPartner Network Status Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/ui/partners/partner-network/partner-network-status-badge.tsx`:
- Around line 16-32: Tooltip's Trigger expects a ref-forwarding child but
BadgeCheck2Fill does not forward refs; wrap the BadgeCheck2Fill used as the
Tooltip trigger inside a plain DOM element (e.g., a <span> or <div>) so the
Tooltip can attach refs/anchors correctly. Update the
partner-network-status-badge component to render Tooltip with the trigger
element wrapping BadgeCheck2Fill (retain the existing tooltip content) instead
of passing BadgeCheck2Fill directly; alternatively, if you prefer changing the
icon, make the BadgeCheck2Fill component forward its ref, but the quickest fix
is to wrap it in a DOM wrapper in this file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fe5e8c24-7c3e-4e82-889b-c27426d66c56
📒 Files selected for processing (10)
apps/web/app/(ee)/api/partners/route.tsapps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/applications/application-referral-source-icon.tsxapps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsxapps/web/lib/api/partners/get-partners.tsapps/web/lib/zod/schemas/partners.tsapps/web/ui/partners/partner-application-source.tsxapps/web/ui/partners/partner-info-cards.tsxapps/web/ui/partners/partner-network/partner-network-status-badge.tsxapps/web/ui/partners/partner-row-item.tsxapps/web/ui/partners/trusted-partner-badge.tsx
💤 Files with no reviewable changes (4)
- apps/web/ui/partners/partner-application-source.tsx
- apps/web/lib/api/partners/get-partners.ts
- apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx
- apps/web/lib/zod/schemas/partners.ts
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
apps/web/ui/partners/partner-network/partner-network-status-badge.tsx (1)
34-39:⚠️ Potential issue | 🟠 Major | ⚡ Quick winStill needs fix: Wrap BadgeCheck2Fill in a DOM element for ref forwarding.
The previous review correctly identified that
BadgeCheck2Filldoesn't forward refs, which breaksTooltip'sasChildanchoring. This issue remains unresolved.Reminder of the fix
- <BadgeCheck2Fill - className={cn( - "shrink-0 text-blue-500", - size === "small" ? "size-3.5" : "size-5", - )} - /> + <span className="inline-flex shrink-0"> + <BadgeCheck2Fill + className={cn( + "text-blue-500", + size === "small" ? "size-3.5" : "size-5", + )} + /> + </span>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/ui/partners/partner-network/partner-network-status-badge.tsx` around lines 34 - 39, Wrap the BadgeCheck2Fill icon in a real DOM element so Tooltip's asChild can forward refs; specifically, in the partner-network-status-badge component replace the direct <BadgeCheck2Fill .../> with a <span> (or other native element) that receives the className used for sizing/positioning and let the icon keep purely visual classes, e.g., move "shrink-0" and size classes onto the wrapper so Tooltip (asChild) can attach the ref to the span and BadgeCheck2Fill remains unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@apps/web/ui/partners/partner-network/partner-network-status-badge.tsx`:
- Around line 34-39: Wrap the BadgeCheck2Fill icon in a real DOM element so
Tooltip's asChild can forward refs; specifically, in the
partner-network-status-badge component replace the direct <BadgeCheck2Fill .../>
with a <span> (or other native element) that receives the className used for
sizing/positioning and let the icon keep purely visual classes, e.g., move
"shrink-0" and size classes onto the wrapper so Tooltip (asChild) can attach the
ref to the span and BadgeCheck2Fill remains unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e659a9cd-3920-4653-b53f-aaec547a06e3
📒 Files selected for processing (3)
apps/web/ui/partners/partner-info-cards.tsxapps/web/ui/partners/partner-network/partner-network-status-badge.tsxapps/web/ui/partners/trusted-partner-badge.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/web/ui/partners/partner-info-cards.tsx
There was a problem hiding this comment.
♻️ Duplicate comments (1)
apps/web/ui/partners/partner-network/partner-network-status-badge.tsx (1)
19-40:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winWrap the Tooltip trigger in a DOM element (BadgeCheck2Fill isn't ref-forwarding).
The
Tooltipcomponent usesasChildon its trigger (confirmed inpackages/ui/src/tooltip.tsx:77-128), which requires the child to forward refs. However,BadgeCheck2Fillis not implemented withforwardRef(as seen inpackages/ui/src/icons/nucleo/badge-check2-fill.tsx:3-20), so tooltip positioning and focus management may fail.🔧 Proposed fix
<Tooltip content={ <div className="flex max-w-xs items-start gap-1.5 p-3"> <BadgeCheck2Fill className="mt-0.5 size-5 shrink-0 text-blue-500" /> <div className="flex flex-col gap-1"> <span className="text-sm font-semibold text-neutral-900"> Approved Partner </span> <span className="text-sm font-normal text-neutral-600"> This partner is approved in the Dub Partner Network. </span> </div> </div> } > - <BadgeCheck2Fill - className={cn( - "shrink-0 text-blue-500", - size === "small" ? "size-3.5" : "size-5", - )} - /> + <span className="inline-flex shrink-0"> + <BadgeCheck2Fill + className={cn( + "text-blue-500", + size === "small" ? "size-3.5" : "size-5", + )} + /> + </span> </Tooltip>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/ui/partners/partner-network/partner-network-status-badge.tsx` around lines 19 - 40, The Tooltip is using asChild but its child BadgeCheck2Fill does not forward refs, breaking positioning/focus; wrap the BadgeCheck2Fill inside a DOM element that accepts refs (e.g., a <span> or <div>) and pass that wrapper as the Tooltip child instead of BadgeCheck2Fill directly (keep existing className and sizing logic on the wrapper or transfer className appropriately) so Tooltip.asChild can attach refs and event handlers correctly; update the partner-network-status-badge component to use Tooltip -> wrapper -> BadgeCheck2Fill.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@apps/web/ui/partners/partner-network/partner-network-status-badge.tsx`:
- Around line 19-40: The Tooltip is using asChild but its child BadgeCheck2Fill
does not forward refs, breaking positioning/focus; wrap the BadgeCheck2Fill
inside a DOM element that accepts refs (e.g., a <span> or <div>) and pass that
wrapper as the Tooltip child instead of BadgeCheck2Fill directly (keep existing
className and sizing logic on the wrapper or transfer className appropriately)
so Tooltip.asChild can attach refs and event handlers correctly; update the
partner-network-status-badge component to use Tooltip -> wrapper ->
BadgeCheck2Fill.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c5914ad6-1291-4aba-99fd-fbfdff3d4d29
📒 Files selected for processing (10)
apps/web/app/(ee)/api/partners/route.tsapps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/applications/application-referral-source-icon.tsxapps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsxapps/web/lib/api/partners/get-partners.tsapps/web/lib/zod/schemas/partners.tsapps/web/ui/partners/partner-application-source.tsxapps/web/ui/partners/partner-info-cards.tsxapps/web/ui/partners/partner-network/partner-network-status-badge.tsxapps/web/ui/partners/partner-row-item.tsxapps/web/ui/partners/trusted-partner-badge.tsx
💤 Files with no reviewable changes (4)
- apps/web/ui/partners/partner-application-source.tsx
- apps/web/lib/api/partners/get-partners.ts
- apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx
- apps/web/lib/zod/schemas/partners.ts
Summary by CodeRabbit
New Features
Updates
Removed