Skip to content

Commit 340fd27

Browse files
nickchomeyCopilot
andauthored
Update webview-ui/src/components/chat/ChatView.tsx
Co-authored-by: Copilot <[email protected]>
1 parent d1f0ef2 commit 340fd27

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,15 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
622622
disableAutoScrollRef.current = false
623623
}, [])
624624

625+
// Utility function to validate mentions
626+
const isValidMention = (mention: string): boolean => {
627+
const trimmed = mention?.trim() || "";
628+
return !!trimmed && trimmed !== "@" && trimmed !== "@/";
629+
};
630+
625631
const handleAddMention = useCallback((mention: string) => {
626632
// Validate mention before adding - skip empty or invalid mentions
627-
const trimmed = mention?.trim() || "";
628-
if (!trimmed || trimmed === "@" || trimmed === "@/") {
629-
return;
633+
if (!isValidMention(mention)) {
630634
}
631635
// Check for duplicates before adding
632636
setContextMentions((prev) => {

0 commit comments

Comments
 (0)