Skip to content

Conversation

@ameer2468
Copy link
Contributor

@ameer2468 ameer2468 commented Sep 25, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved “Copy link” behavior on Cap cards: when a verified custom domain is available in production, the copied URL now uses it; otherwise, it falls back to the standard link. This ensures more reliable, shareable links and avoids unverified or incorrect URLs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updates CapCard’s copy-link onClick logic to prefer a custom domain URL in production when both customDomain and domainVerified are true; otherwise it falls back to the previous behavior (use cap.link in production, origin-based URL in other environments).

Changes

Cohort / File(s) Summary
CapCard copy-link logic
apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx
Adds guards for customDomain and domainVerified to select a custom-domain URL in production; otherwise uses existing cap.link or origin-based URL fallback.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant CC as CapCard onClick
  participant ENV as Environment
  participant CL as Clipboard

  U->>CC: Click "Copy Link"
  CC->>ENV: Check production?
  alt Production
    CC->>CC: If customDomain && domainVerified
    alt Both true
      CC->>CL: Copy custom-domain URL
    else
      CC->>CL: Copy cap.link URL
    end
  else Non-production
    CC->>CL: Copy origin-based URL
  end
  CL-->>U: Link copied
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • fix: copy link #1072 — Also modifies CapCard.tsx copy-link URL selection logic, adjusting environment-based behavior; closely connected to this PR’s domain selection guards.

Poem

A bunny taps the copy key,
Chooses links most carefully—
Custom burrows, verified,
Else the meadow’s path is tried.
Hop, click, share—so neat and clean,
URLs fit for any scene. 🐇🔗

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch custom-domain-copying

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6af2d73 and 8e53529.

📒 Files selected for processing (1)
  • apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx (1 hunks)

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.

@ameer2468 ameer2468 merged commit 50b260d into main Sep 25, 2025
15 of 16 checks passed
@ameer2468 ameer2468 deleted the custom-domain-copying branch September 25, 2025 21:39
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