Skip to content

Show networkStatus badge in PartnerRowItem - #3988

Merged
steven-tey merged 2 commits into
mainfrom
network-status-badge
Jun 5, 2026
Merged

Show networkStatus badge in PartnerRowItem#3988
steven-tey merged 2 commits into
mainfrom
network-status-badge

Conversation

@steven-tey

@steven-tey steven-tey commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Network status badges for partners (trusted/approved) with size and layout options.
  • Updates

    • Partner list and profile UIs display network status next to names.
    • Partner query/options simplified: removed application-event option; added platform inclusion and new filters (country, referredBy).
    • Partner data now includes platform and additional status/timestamp fields.
  • Removed

    • Application source UI and the related source column.

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview Jun 4, 2026 11:56pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

API 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.

Changes

Partner Network Status Implementation

Layer / File(s) Summary
Partner API schema and data shape
apps/web/lib/zod/schemas/partners.ts, apps/web/app/(ee)/api/partners/route.ts, apps/web/lib/api/partners/get-partners.ts
Query schema removes includeApplicationEvent and adds country, referredByPartnerId, includePartnerPlatforms. Response schema removes applicationEvent and adds customerDataSharingEnabledAt, groupMoveDisabledAt, and platforms. API route and data fetching stop including applicationEvent and conditionally attach platforms.
Badge components and TrustedPartnerBadge API
apps/web/ui/partners/partner-network/partner-network-status-badge.tsx, apps/web/ui/partners/trusted-partner-badge.tsx
New PartnerNetworkStatusBadge component renders TrustedPartnerBadge for "trusted" or an approved tooltip for "approved". TrustedPartnerBadge now accepts variant (`"overlay"
Partner list and info card UI integration
apps/web/ui/partners/partner-row-item.tsx, apps/web/ui/partners/partner-info-cards.tsx
PartnerRowItem and PartnerInfoCards accept/display optional networkStatus and render PartnerNetworkStatusBadge. Removed applicationEvent/referralSource rendering and adjusted pending createdAt display and timestamp tooltip usage.
Page client cleanup and icon prop update
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/applications/application-referral-source-icon.tsx
Removed includeApplicationEvent flag from SWR query options and deleted commented-out Source column. ApplicationReferralSourceIcon now accepts optional className and forwards it to rendered icons.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • dubinc/dub#3848: Modifies ApplicationReferralSourceIcon and overlaps with the className passthrough changes.
  • dubinc/dub#3984: Directly touches partners API/schema and referralSource handling; may conflict with removal of applicationEvent.
  • dubinc/dub#3827: Changes PartnerRowItem rendering and may intersect with networkStatus badge placement.

Suggested reviewers

  • pepeladeira

Poem

🐰 I hop to the code with a ribbon and grin,
A badge for partners — let trust settle in.
Old events fade softly, new fields take their place,
Icons wear classNames with elegance and grace.
Hooray for small rabbits who tidy the space!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the primary change: adding networkStatus badge rendering to PartnerRowItem component.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch network-status-badge

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1e65ea2 and 6086219.

📒 Files selected for processing (10)
  • apps/web/app/(ee)/api/partners/route.ts
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/applications/application-referral-source-icon.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx
  • apps/web/lib/api/partners/get-partners.ts
  • apps/web/lib/zod/schemas/partners.ts
  • apps/web/ui/partners/partner-application-source.tsx
  • apps/web/ui/partners/partner-info-cards.tsx
  • apps/web/ui/partners/partner-network/partner-network-status-badge.tsx
  • apps/web/ui/partners/partner-row-item.tsx
  • apps/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

@steven-tey

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
apps/web/ui/partners/partner-network/partner-network-status-badge.tsx (1)

34-39: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Still needs fix: Wrap BadgeCheck2Fill in a DOM element for ref forwarding.

The previous review correctly identified that BadgeCheck2Fill doesn't forward refs, which breaks Tooltip's asChild anchoring. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6086219 and d008178.

📒 Files selected for processing (3)
  • apps/web/ui/partners/partner-info-cards.tsx
  • apps/web/ui/partners/partner-network/partner-network-status-badge.tsx
  • apps/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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
apps/web/ui/partners/partner-network/partner-network-status-badge.tsx (1)

19-40: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Wrap the Tooltip trigger in a DOM element (BadgeCheck2Fill isn't ref-forwarding).

The Tooltip component uses asChild on its trigger (confirmed in packages/ui/src/tooltip.tsx:77-128), which requires the child to forward refs. However, BadgeCheck2Fill is not implemented with forwardRef (as seen in packages/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

📥 Commits

Reviewing files that changed from the base of the PR and between 1e65ea2 and d008178.

📒 Files selected for processing (10)
  • apps/web/app/(ee)/api/partners/route.ts
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/applications/application-referral-source-icon.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx
  • apps/web/lib/api/partners/get-partners.ts
  • apps/web/lib/zod/schemas/partners.ts
  • apps/web/ui/partners/partner-application-source.tsx
  • apps/web/ui/partners/partner-info-cards.tsx
  • apps/web/ui/partners/partner-network/partner-network-status-badge.tsx
  • apps/web/ui/partners/partner-row-item.tsx
  • apps/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

@steven-tey
steven-tey merged commit 93174a5 into main Jun 5, 2026
11 checks passed
@steven-tey
steven-tey deleted the network-status-badge branch June 5, 2026 00:04
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.

1 participant