feat(web): add dismissible in-app GitHub star nudge after successful sends

SI
1d ago
+226-1

Summary of Changes

Adds a subtle, non-intrusive, one-time in-app toast nudging users to star the repo on GitHub after they have experienced real value from useSend.

  • Value-Realized Triggers: Fires ~1.5s after a high-intent, successful real-world action:
    • Sending a test email after configuring a domain (send-test-mail.tsx)
    • Scheduling a campaign (schedule-campaign.tsx)
  • Non-blocking Toast UI: Uses the existing Sonner toast helper (@usesend/ui/src/toaster), avoiding disruptive modals or layout-shifting banners.
  • Permanent Dismissal: Clicking "Star on GitHub", clicking "Not now", or dismissing the toast permanently persists usesend:star-nudge-dismissed="true" in localStorage so users are never nagged again.
  • Feedback Session Guard: Checks sessionStorage (usesend:feedback-active) to guarantee the star prompt never collides with or appears in the same session as the FeedbackDialog.
  • Zero Backend / Telemetry: 100% client-side logic with strict SSR guards (typeof window !== "undefined") and defensive try/catch wrappers around Web Storage for incognito/private browsing compatibility.
  • Cross-Platform Test Fix: Normalized CRLF line endings in editor-dependencies.unit.test.ts so lockfile checks pass consistently on both Windows and Linux.

🎥 Screen Recording / Demo

https://github.com/user-attachments/assets/8929bd01-b736-441e-86a2-b7adbbbb9691


How it was Tested

  • Unit Tests:
    • Added apps/web/src/lib/star-nudge.unit.test.ts (7/7 tests passing):
      • Initial state check when storage is empty.
      • Persistent dismissal in localStorage.
      • Session suppression when FeedbackDialog is active.
      • Toast action handlers (Star on GitHub opens repo in new tab & dismisses; Not now dismisses).
    • All 383 unit tests across the web package pass.
  • Type Safety:
    • pnpm --filter=web typecheck passed with 0 errors.
  • Manual Verification:
    1. Clicked Send test email on a verified domain -> standard success toast displayed, followed 1.5s later by the star nudge toast.
    2. Verified clicking Star on GitHub opens https://github.com/usesend/usesend in a new tab and permanently sets the dismissal flag.
    3. Verified clicking Not now immediately dismisses without navigation.
    4. Verified subsequent sends never re-trigger the toast.
    5. Opened the Feedback dialog -> verified the star nudge is suppressed for the rest of that session.

Ask Polylane for an impact assessment of this pull request:

Assess with Polylane


Summary by cubic

Adds a one-time, dismissible in-app toast that nudges users to star the GitHub repo after a successful test email send or campaign schedule. The nudge is fully client-side, persists dismissal in localStorage, and is suppressed whenever the feedback dialog has been opened in the same session.

Behavior

  • Appears ~1.5s after a successful test send or schedule through the existing Sonner toast; eligibility is rechecked right before it renders, so opening the feedback dialog during the delay also suppresses it.
  • "Star on GitHub" opens the repo in a new tab and dismisses the nudge permanently; "Not now", manual dismissal, and auto-close dismiss it too.
  • Normalizes CRLF line endings in editor-dependencies.unit.test.ts so lockfile assertions pass consistently on Windows and Linux.

Summary by CodeRabbit

  • New Features
    • After successfully scheduling a campaign or sending a test email, a delayed prompt invites you to star the project.
    • The prompt links to the project page and can be dismissed; dismissal is remembered so it won’t appear again.
    • The prompt is suppressed if feedback is opened during the same session, including while the prompt is waiting to appear.