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

Skip to content

Conversation

@devkiran
Copy link
Collaborator

@devkiran devkiran commented Jun 2, 2025

Summary by CodeRabbit

  • New Features
    • Users now receive a welcome email after creating a new program, including helpful steps to get started and direct links to manage their program.
  • Improvements
    • Enhanced onboarding flow to streamline program creation and ensure users are promptly informed when their program is ready.
    • Added contextual descriptions and help links to program-related pages: Discounts, Partners, Payouts, and Rewards.
    • Updated program welcome modal with clearer next steps and improved text styling.

@vercel
Copy link
Contributor

vercel bot commented Jun 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dub ✅ Ready (Inspect) Visit Preview Jun 17, 2025 0:04am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 2, 2025

Walkthrough

The changes introduce a new email template for welcoming users who create a program, update the program creation logic to send this email, and refine the onboarding logic for program creation by checking the workspace's default program status instead of counting existing programs. Additionally, several dashboard pages were enhanced with contextual title information and links, and the program welcome modal's steps and styling were updated.

Changes

File(s) Summary
apps/web/lib/actions/partners/create-program.ts Modified createProgram to accept user email and send a welcome email after program setup.
apps/web/lib/actions/partners/onboard-program.ts Changed logic to check defaultProgramId instead of counting programs for onboarding.
packages/email/src/templates/program-welcome.tsx Added new ProgramWelcome React email template for program creation welcome emails.
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/*/page.tsx Added titleInfo prop with descriptive text and help links to Discounts, Partners, Payouts, and Rewards pages.
apps/web/ui/modals/program-welcome-modal.tsx Updated welcome modal steps text and styling; added new step for rewards setup.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WebApp
    participant EmailService

    User->>WebApp: Create Program Request (with email)
    WebApp->>WebApp: Create Program & related setup
    WebApp->>EmailService: Send ProgramWelcome email (with program & workspace info)
    EmailService-->>User: Deliver Welcome Email
    WebApp-->>User: Respond with program creation result
Loading

Poem

In the warren where new programs grow,
A welcome email is ready to go!
With logos and links, and steps to begin,
Partners and branding—let the fun spin!
Now, with a hop and a click,
Your journey starts—oh, isn’t that slick?
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@steven-tey steven-tey force-pushed the program-created-email branch 2 times, most recently from de5e9c1 to 2a78029 Compare June 16, 2025 05:21
@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 16, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@steven-tey
Copy link
Collaborator

@CodeRabbit final review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 16, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

I'll conduct a comprehensive final review of the changes in this PR. Let me examine the key files to ensure everything looks good.


🏁 Script executed:

#!/bin/bash
# Examine the main files that were changed
echo "=== Checking create-program.ts changes ==="
cat apps/web/lib/actions/partners/create-program.ts

echo -e "\n=== Checking onboard-program.ts changes ==="
cat apps/web/lib/actions/partners/onboard-program.ts

echo -e "\n=== Checking program-welcome.tsx template ==="
cat packages/email/src/templates/program-welcome.tsx

Length of output: 14706


@steven-tey Excellent work on this PR! 🎉 The implementation looks solid and follows best practices. Here's my final review:

Strengths

1. Clean Architecture

  • Proper separation of concerns between program creation and email sending
  • Email sending is handled asynchronously with waitUntil to avoid blocking the user flow
  • Type safety maintained by expanding the user parameter to include email

2. Robust Error Handling

  • Using Promise.allSettled ensures that email sending failures won't break program creation
  • Proper fallbacks in the email template (default logo, error handling)

3. Optimized Database Logic

  • Smart change from counting programs to checking defaultProgramId existence
  • More efficient and cleaner approach for preventing duplicate programs

4. Professional Email Template

  • Comprehensive onboarding guidance with 4 clear steps
  • Proper branding with logo fallback to DUB_THUMBNAIL
  • Responsive design using @react-email/components
  • Helpful links to relevant dashboard sections

5. User Experience

  • Welcome email provides immediate value with actionable next steps
  • Clear call-to-action button to dashboard
  • Professional styling consistent with Dub's brand

🔍 Code Quality

The implementation demonstrates:

  • Proper TypeScript typing
  • Consistent error handling patterns
  • Clean separation of email logic from core business logic
  • Appropriate use of async operations

📧 Email Template Highlights

The ProgramWelcome template includes:

  • Program branding with logo display
  • Direct link to program landing page
  • 4-step getting started guide covering branding, bank setup, partner invites, and rewards
  • Proper footer with marketing compliance

Final Verdict

This PR is ready to merge! The implementation is well-thought-out, follows established patterns, and provides a great user experience for new program creators. The email will help users get started quickly with their new programs.

All automated tests are passing, and the code quality is excellent. Great job! 🚀

🐰
∩___∩
( ◕ ◕ )
\ /
| |
∪ ∪

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: 0

🔭 Outside diff range comments (1)
apps/web/ui/modals/program-welcome-modal.tsx (1)

51-55: Query-param key mismatch prevents modal from closing cleanly

You delete program-onboarded in onClose but delete onboarded-program when the “Get started” button is clicked. One of these keys is wrong, so the modal may re-open unexpectedly.

-              queryParams({
-                del: ["onboarded-program"],
-              })
+              queryParams({
+                del: ["program-onboarded"],
+              })

Double-check any code that sets this param to keep behaviour consistent.

Also applies to: 115-119

🧹 Nitpick comments (1)
apps/web/ui/modals/program-welcome-modal.tsx (1)

95-96: Minor a11y nit – add focus styling to anchor buttons

The new font styling is fine, but the anchors still lack a visible focus outline. Consider adding the Tailwind focus-visible:outline utilities for keyboard users.

-className="flex items-center gap-2 text-sm font-medium text-neutral-800 underline decoration-dotted"
+className="flex items-center gap-2 text-sm font-medium text-neutral-800 underline decoration-dotted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-500"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de5e9c1 and 1406893.

📒 Files selected for processing (6)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/discounts/page.tsx (1 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/page.tsx (1 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/page.tsx (1 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/rewards/page.tsx (1 hunks)
  • apps/web/ui/modals/program-welcome-modal.tsx (3 hunks)
  • packages/email/src/templates/program-welcome.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/page.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/rewards/page.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/page.tsx
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/discounts/page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/email/src/templates/program-welcome.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (2)
apps/web/ui/modals/program-welcome-modal.tsx (2)

30-33: Copy change looks good
Updated wording is clearer and action-oriented. No issues spotted.


41-45: ```shell
#!/bin/bash
set -e

echo "=== Occurrences of '/dashboard/${workspaceSlug}' in .tsx files ==="
rg -n "/dashboard/\$\{workspaceSlug\}" -g "*.tsx" || echo "No occurrences found."

echo
echo "=== Occurrences of 'program/branding' in .tsx files ==="
rg -n "program/branding" -g "*.tsx" || echo "No occurrences found."

echo
echo "=== Occurrences of 'program/rewards' in .tsx files ==="
rg -n "program/rewards" -g "*.tsx" || echo "No occurrences found."


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@bug0-qa-agent
Copy link

bug0-qa-agent bot commented Jun 17, 2025

🤖 Bug0 QA Agent

Here are the results of the automated tests for PR #2464:

To re-run the tests, please comment /bug0 run or push a new commit to this PR.

@steven-tey steven-tey merged commit c4cd553 into main Jun 17, 2025
8 checks passed
@steven-tey steven-tey deleted the program-created-email branch June 17, 2025 00:25
@coderabbitai coderabbitai bot mentioned this pull request Jul 7, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 9, 2025
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.

3 participants