Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@devkiran
Copy link
Collaborator

@devkiran devkiran commented Dec 21, 2025

Summary by CodeRabbit

Release Notes

  • Style

    • Updated email template designs: simplified bounty notification layouts, removed borders from sales alert summaries, and restructured fraud event group displays with improved spacing and visual hierarchy.
  • Chores

    • Added development tooling for email preview functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Contributor

vercel bot commented Dec 21, 2025

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

Project Deployment Review Updated (UTC)
dub Ready Ready Preview Dec 21, 2025 4:07pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

Walkthrough

Updated email templates with styling and layout adjustments, including removal of flex layout and border styling, refactored conditional rendering logic with index-aware border control, and added a devDependency for React Email preview server.

Changes

Cohort / File(s) Summary
Package Dependencies
packages/email/package.json
Added @react-email/preview-server v5.1.0 to devDependencies
Email Template Styling
packages/email/src/templates/new-bounty-available.tsx, packages/email/src/templates/new-sale-alert-program-owner.tsx
Removed flex layout from Details section and converted Text to Section in bounty template; removed border styling from price/summary block in sale alert template
Email Template Refactoring
packages/email/src/templates/unresolved-fraud-events-summary.tsx
Refactored group rendering with index-aware conditional border logic; reorganized layout structure to position border on Row element; updated Link href to use group.id; consolidated action column content within group row

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • packages/email/src/templates/unresolved-fraud-events-summary.tsx may require extra attention as it involves structural refactoring with conditional rendering logic; verify the isLastItem calculation is correct and border placement renders as intended
  • Confirm styling changes in the other templates don't unintentionally affect visual hierarchy or readability of email content

Possibly related PRs

  • notifyPartnerCommission #2805: Modifies the same email template files (packages/email/src/templates/new-sale-alert-program-owner.tsx), suggesting coordinated styling updates across email templates.

Suggested reviewers

  • steven-tey
  • TWilson023

Poem

A rabbit hops through email dreams so fine, ✨
With borders gone and layouts redesigned,
Bounty templates bloom with cleaner grace,
While fraud events now show each group's true face! 🐰
Index-aware logic guides the way,
Making email views shine bright today!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Fix the react email templates preview' is vague and generic, using non-descriptive language that doesn't clearly convey what specific aspects of the preview are being fixed. Consider a more specific title that identifies the concrete changes, such as 'Update react email templates styling and structure' or 'Refactor email template layout and preview dependencies'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-react-email

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fab5f8e and 48eff53.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/email/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/email/package.json
⏰ 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). (2)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: build

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.

@socket-security
Copy link

socket-security bot commented Dec 21, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​react-email/​preview-server@​5.1.0941008698100

View full report

@socket-security
Copy link

socket-security bot commented Dec 21, 2025

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @react-email/preview-server is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: packages/email/package.jsonnpm/@react-email/[email protected]

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@react-email/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@devkiran devkiran requested a review from steven-tey December 21, 2025 15:49
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3015b03 and fab5f8e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • packages/email/package.json (1 hunks)
  • packages/email/src/templates/new-bounty-available.tsx (1 hunks)
  • packages/email/src/templates/new-sale-alert-program-owner.tsx (1 hunks)
  • packages/email/src/templates/partner-program-summary.tsx (2 hunks)
  • packages/email/src/templates/unresolved-fraud-events-summary.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-05-29T04:45:18.504Z
Learnt from: devkiran
Repo: dubinc/dub PR: 2448
File: packages/email/src/templates/partner-program-summary.tsx:0-0
Timestamp: 2025-05-29T04:45:18.504Z
Learning: In the PartnerProgramSummary email template (packages/email/src/templates/partner-program-summary.tsx), the stat titles are hardcoded constants ("Clicks", "Leads", "Sales", "Earnings") that will always match the ICONS object keys after toLowerCase() conversion, so icon lookup failures are not possible.

Applied to files:

  • packages/email/src/templates/new-sale-alert-program-owner.tsx
  • packages/email/src/templates/unresolved-fraud-events-summary.tsx
📚 Learning: 2025-12-08T09:44:28.429Z
Learnt from: devkiran
Repo: dubinc/dub PR: 3200
File: apps/web/lib/api/fraud/detect-duplicate-payout-method-fraud.ts:55-73
Timestamp: 2025-12-08T09:44:28.429Z
Learning: In apps/web/lib/api/fraud/detect-duplicate-payout-method-fraud.ts, the fraud event creation logic intentionally generates self-referential fraud events (where partnerId equals duplicatePartnerId) for partners with duplicate payout methods. This is by design to create raw events for all partners involved in a duplicate payout method scenario, regardless of whether they reference themselves.

Applied to files:

  • packages/email/src/templates/unresolved-fraud-events-summary.tsx
📚 Learning: 2025-12-03T09:19:48.164Z
Learnt from: devkiran
Repo: dubinc/dub PR: 3175
File: apps/web/lib/actions/partners/bulk-reject-partner-applications.ts:14-21
Timestamp: 2025-12-03T09:19:48.164Z
Learning: In apps/web/lib/actions/partners/bulk-reject-partner-applications.ts, the bulkRejectPartnerApplicationsAction does not need explicit plan capability checks for fraud operations (when reportFraud is true) because the authorization is handled automatically by the underlying fraud operation functions (resolveFraudGroups, createFraudEvents) or through other automated mechanisms in the system.

Applied to files:

  • packages/email/src/templates/unresolved-fraud-events-summary.tsx
🧬 Code graph analysis (3)
packages/email/src/templates/unresolved-fraud-events-summary.tsx (2)
packages/email/src/react-email.d.ts (5)
  • Row (9-9)
  • Column (10-12)
  • Text (15-15)
  • Img (13-13)
  • Link (14-14)
packages/utils/src/constants/misc.ts (1)
  • OG_AVATAR_URL (29-29)
packages/email/src/templates/new-bounty-available.tsx (1)
packages/email/src/react-email.d.ts (2)
  • Section (8-8)
  • Text (15-15)
packages/email/src/templates/partner-program-summary.tsx (1)
packages/email/src/react-email.d.ts (2)
  • Container (7-7)
  • Section (8-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). (1)
  • GitHub Check: build
🔇 Additional comments (3)
packages/email/src/templates/new-sale-alert-program-owner.tsx (1)

129-129: LGTM - Border removal improves visual design.

The border removal simplifies the price summary section's appearance, which aligns with the overall layout improvements in this PR.

packages/email/src/templates/unresolved-fraud-events-summary.tsx (1)

114-180: Verify the nested table structure across email clients through testing.

Testing across multiple email clients (Gmail, Outlook, Apple Mail) is a best practice for email templates. However, react-email components have been tested using the most popular email clients, and the library takes care of inconsistencies between Gmail, Outlook, and other email clients. The displayed nesting depth (Column > Row > Column pattern, approximately 2-3 levels) is well within safe limits—keeping nested tables to 4-6 tables max helps avoid rendering problems, though some older clients like Lotus Notes may render emails poorly with deeply nested tables.

The conditional isLastItem border logic and column split percentages are standard email template patterns that render consistently. Proceed with testing as part of your normal QA workflow.

packages/email/src/templates/new-bounty-available.tsx (1)

77-87: The Markdown wrapper change from Text to Section is intentional and part of the email preview fix.

This change (lines 81-87) replaced a Text element wrapper with a Section element. While this is a structural change in the email HTML, it was deliberately made as part of commit "Fix the react email templates preview" and follows the standard pattern for react-email. All react-email components are tested on the most popular email clients, and Markdown inside Section is an established pattern in react-email examples. The Markdown component itself has independent rendering logic with its own style customization props, so the external wrapper change affects layout structure but not markdown parsing.

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