feat: @mentions in comments

Parse @username in comment content, notify mentioned users (dedup
against recipe-author/parent-author who are already notified via
comment/reply), and render @username as a link to their profile.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-03 22:16:06 +02:00
parent 73a71d28cd
commit a51ba85253
5 changed files with 52 additions and 5 deletions
+11
View File
@@ -0,0 +1,11 @@
const MENTION_REGEX = /@([a-z0-9_-]{3,30})/gi;
export function extractMentionedUsernames(content: string): string[] {
const matches = content.matchAll(MENTION_REGEX);
const usernames = new Set<string>();
for (const m of matches) {
const username = m[1];
if (username) usernames.add(username.toLowerCase());
}
return [...usernames];
}