diff --git a/web/chat/chat-input-bar.react.js b/web/chat/chat-input-bar.react.js --- a/web/chat/chat-input-bar.react.js +++ b/web/chat/chat-input-bar.react.js @@ -608,7 +608,7 @@ ? { textBeforeAtSymbol: typeaheadRegexMatches.groups?.textPrefix ?? '', - textPrefix: typeaheadRegexMatches.groups?.username ?? '', + textPrefix: typeaheadRegexMatches.groups?.mentionText ?? '', } : null, [typeaheadRegexMatches], diff --git a/web/utils/typeahead-utils.js b/web/utils/typeahead-utils.js --- a/web/utils/typeahead-utils.js +++ b/web/utils/typeahead-utils.js @@ -9,6 +9,7 @@ type MentionTypeaheadSuggestionItem, type TypeaheadTooltipActionItem, } from 'lib/shared/mention-utils.js'; +import { validChatNameRegexString } from 'lib/shared/thread-utils.js'; import { stringForUserExplicit } from 'lib/shared/user-utils.js'; import type { SetState } from 'lib/types/hook-types.js'; @@ -18,7 +19,7 @@ import Button from '../components/button.react.js'; const webMentionTypeaheadRegex: RegExp = new RegExp( - `(?(?:^(?:.|\n)*\\s+)|^)@(?${oldValidUsernameRegexString})?$`, + `(?(?:^(?:.|\n)*\\s+)|^)@(?${oldValidUsernameRegexString}|${validChatNameRegexString})?$`, ); export type TooltipPosition = {