diff --git a/webview-ui/src/utils/context-mentions.ts b/webview-ui/src/utils/context-mentions.ts index 8408e1a11d..463eedb04e 100644 --- a/webview-ui/src/utils/context-mentions.ts +++ b/webview-ui/src/utils/context-mentions.ts @@ -300,16 +300,14 @@ export function shouldShowContextMenu(text: string, position: number): boolean { const textAfterAt = beforeCursor.slice(atIndex + 1) + // Check if there's any whitespace after the '@' + if (/\s/.test(textAfterAt)) return false + // Don't show the menu if it's clearly a URL if (textAfterAt.toLowerCase().startsWith("http")) { return false } - // If there's a space after @, don't show the menu (normal @ mention) - if (textAfterAt.indexOf(" ") === 0) { - return false - } - // Show menu in all other cases return true }