fix: extract and send @mentions from chat messages

This commit is contained in:
Markov 2026-02-25 13:31:31 +01:00
parent b150f25949
commit 9e6cc84965

View File

@ -146,9 +146,14 @@ export default function ChatPanel({ chatId, projectSlug }: Props) {
setPendingFiles([]);
setSending(true);
try {
// Extract @mentions from text
const mentionMatches = text.match(/@(\w+)/g);
const mentions = mentionMatches ? [...new Set(mentionMatches.map(m => m.slice(1)))] : [];
const msg = await sendMessage({
chat_id: chatId,
content: text,
mentions: mentions.length > 0 ? mentions : undefined,
attachments: attachments.length > 0 ? attachments : undefined,
});
setMessages((prev) => {