Skip to content

feat(invite): show toast on collection invitation accept#895

Draft
B-a-l-aj-i wants to merge 2 commits intodevfrom
feat/invite-accept-toast
Draft

feat(invite): show toast on collection invitation accept#895
B-a-l-aj-i wants to merge 2 commits intodevfrom
feat/invite-accept-toast

Conversation

@B-a-l-aj-i
Copy link
Copy Markdown
Contributor

@B-a-l-aj-i B-a-l-aj-i commented Mar 30, 2026

Summary by CodeRabbit

  • New Features
    • Users now receive a success notification confirming when they've joined a shared collection after accepting an invitation.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

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

Project Deployment Actions Updated (UTC)
recollect Ready Ready Preview Apr 1, 2026 5:53am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9c66e70d-29e2-4a2f-955a-99b391bca00a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The changes implement an invite acceptance confirmation feature. API redirect handlers now append an invite=accepted query parameter upon successful invitation acceptance, and the dashboard component detects this parameter to display a success toast notification to the user.

Changes

Cohort / File(s) Summary
API Invite Handlers
src/app/api/v2/invite/route.ts, src/pages/api/invite.ts
Both endpoints now append ?invite=accepted query parameter to successful redirect URLs, with an explanatory comment added to the legacy API endpoint.
Dashboard Integration
src/pageComponents/dashboard/index.tsx
Added useEffect hook that detects the invite=accepted query parameter, displays a success toast with message "You've joined the shared collection", then removes the parameter via shallow router replacement to prevent toast re-triggering.

Sequence Diagram

sequenceDiagram
    participant User
    participant API as API Handler
    participant Router as Next.js Router
    participant Dashboard as Dashboard Component
    participant Toast as Toast Service

    User->>API: Accept invitation (click link)
    API->>API: Validate & update collaborator
    API->>Router: Redirect to /?invite=accepted
    Router->>Dashboard: Render with query param
    Dashboard->>Dashboard: useEffect detects invite=accepted
    Dashboard->>Toast: Call successToast()
    Toast->>User: Display "You've joined the shared collection"
    Dashboard->>Router: router.replace() to remove param
    Router->>Dashboard: Rerender (param removed, toast won't retrigger)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A carrot-filled journey, from click to delight,
Query params sparkle like stars in the night,
The toast pops up warm, welcoming and true,
"You've joined!" it declares with a celebratory pew! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a toast notification that displays when a user accepts a collection invitation.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/invite-accept-toast

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.

@B-a-l-aj-i
Copy link
Copy Markdown
Contributor Author

show-toast-on-collection-invite-accept-1774874043028.mp4

@B-a-l-aj-i B-a-l-aj-i changed the title feat(invite): add query param for invite acceptance and show toast on dashboard feat(invite): show toast on collection invitation accept Mar 30, 2026
@B-a-l-aj-i B-a-l-aj-i marked this pull request as draft March 31, 2026 12:40
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