feat: implement patch#37
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughA comprehensive implementation of ChangesMention Feature — Frontend, Backend, Database, and Routing
Sequence Diagram(s)sequenceDiagram
participant User
participant Browser
participant MentionTextarea
participant API as API Server
participant DB as Database
User->>Browser: Types "@john" in textarea
Browser->>MentionTextarea: onChange / caret position
MentionTextarea->>MentionTextarea: Detect mention context (`@john`)
MentionTextarea->>API: orpc.user.mentionCandidates({prefix:"john"})
API->>DB: Query users where username startsWith "john"
DB-->>API: [john_doe, johnny_smith, ...]
API-->>MentionTextarea: Candidates dropdown
MentionTextarea->>Browser: Render dropdown list
User->>MentionTextarea: Arrow Down + Enter to select "john_doe"
MentionTextarea->>MentionTextarea: Apply mention (`@john_doe`)
MentionTextarea->>Browser: Update textarea value + move caret
Browser-->>User: Textarea updated with "@john_doe "
sequenceDiagram
participant User
participant Browser
participant PostAPI as Post API
participant CommentAPI as Comment API
participant DB as Database
participant Mail as Mail Service
User->>Browser: Create post with "@john" mention
Browser->>PostAPI: orpc.post.create({body:"Check this `@john`"})
PostAPI->>DB: Create post in transaction
PostAPI->>PostAPI: Extract mentions (`@john`)
PostAPI->>DB: Insert mention record (post→john)
DB-->>PostAPI: ✓
PostAPI->>DB: Fetch mentioned usernames
DB-->>PostAPI: [{username:"john"}]
PostAPI->>Mail: notifyMentionedUsersForContent(...) (async)
Mail->>DB: Check 15min dedupe window
DB-->>Mail: No recent notification
Mail->>Mail: sendMentionEmail(john@example.com)
Mail-->>User: Email sent (async)
PostAPI-->>Browser: Post created with mentions
sequenceDiagram
participant User
participant Browser
participant PostRoute as /p/$postSlug Route
participant PostAPI as Post API
participant DB as Database
participant OGRoute as /api/og/post/$postSlug/og.png
User->>Browser: Navigate to /p/post-slug
Browser->>PostRoute: Load route
PostRoute->>PostAPI: orpc.post.findOne({slug:"post-slug"})
PostAPI->>DB: Fetch post + author + mentions
DB-->>PostAPI: {body, author, mentions:[...], reactions, comments}
PostAPI-->>PostRoute: Post data loaded
PostRoute->>PostRoute: Build SEO metadata + OG image URL
Browser->>OGRoute: Prefetch /api/og/post/post-slug/og.png
OGRoute->>PostAPI: getPostOgData("post-slug")
PostAPI->>DB: Fetch post preview + author + counts
DB-->>PostAPI: {bodyPreview, author, hasImage, reactionCount, commentCount}
OGRoute->>OGRoute: Render PostOg template
OGRoute-->>Browser: OG image PNG
PostRoute->>Browser: Render PostCard with mentions
Browser-->>User: Post page with OG preview
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Summary by CodeRabbit
Release Notes
New Features
Improvements