diff --git a/lib/shared/mention-utils.js b/lib/shared/mention-utils.js --- a/lib/shared/mention-utils.js +++ b/lib/shared/mention-utils.js @@ -15,7 +15,7 @@ export type TypeaheadMatchedStrings = { +textBeforeAtSymbol: string, - +usernamePrefix: string, + +textPrefix: string, }; export type Selection = { diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js --- a/native/chat/chat-input-bar.react.js +++ b/native/chat/chat-input-bar.react.js @@ -552,14 +552,14 @@ if (typeaheadRegexMatches && !isEditMode) { const typeaheadMatchedStrings = { textBeforeAtSymbol: typeaheadRegexMatches[1] ?? '', - usernamePrefix: typeaheadRegexMatches[4] ?? '', + textPrefix: typeaheadRegexMatches[4] ?? '', }; const suggestedUsers = getTypeaheadUserSuggestions( this.props.userSearchIndex, this.props.mentionsCandidates, this.props.viewerID, - typeaheadMatchedStrings.usernamePrefix, + typeaheadMatchedStrings.textPrefix, ); if (suggestedUsers.length > 0) { diff --git a/native/chat/typeahead-tooltip.react.js b/native/chat/typeahead-tooltip.react.js --- a/native/chat/typeahead-tooltip.react.js +++ b/native/chat/typeahead-tooltip.react.js @@ -30,7 +30,7 @@ focusAndUpdateTextAndSelection, } = props; - const { textBeforeAtSymbol, usernamePrefix } = matchedStrings; + const { textBeforeAtSymbol, textPrefix } = matchedStrings; const styles = useStyles(unboundStyles); @@ -40,7 +40,7 @@ const { newText, newSelectionStart } = getNewTextAndSelection( textBeforeAtSymbol, text, - usernamePrefix, + textPrefix, item, ); @@ -64,7 +64,7 @@ styles.buttonLabel, textBeforeAtSymbol, text, - usernamePrefix, + textPrefix, focusAndUpdateTextAndSelection, ], ); 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 @@ -602,7 +602,7 @@ ? { textBeforeAtSymbol: typeaheadRegexMatches.groups?.textPrefix ?? '', - usernamePrefix: typeaheadRegexMatches.groups?.username ?? '', + textPrefix: typeaheadRegexMatches.groups?.username ?? '', } : null, [typeaheadRegexMatches], @@ -630,7 +630,7 @@ userSearchIndex, props.inputState.typeaheadState.frozenMentionsCandidates, viewerID, - typeaheadMatchedStrings.usernamePrefix, + typeaheadMatchedStrings.textPrefix, ); }, [ userSearchIndex, diff --git a/web/chat/typeahead-tooltip.react.js b/web/chat/typeahead-tooltip.react.js --- a/web/chat/typeahead-tooltip.react.js +++ b/web/chat/typeahead-tooltip.react.js @@ -26,7 +26,7 @@ function TypeaheadTooltip(props: TypeaheadTooltipProps): React.Node { const { inputState, textarea, matchedStrings, suggestedUsers } = props; - const { textBeforeAtSymbol, usernamePrefix } = matchedStrings; + const { textBeforeAtSymbol, textPrefix } = matchedStrings; const [isVisibleForAnimation, setIsVisibleForAnimation] = React.useState(false); @@ -63,7 +63,7 @@ inputStateSetTextCursorPosition: inputState.setTextCursorPosition, suggestedUsers, textBeforeAtSymbol, - usernamePrefix, + textPrefix, }), [ inputState.draft, @@ -71,7 +71,7 @@ inputState.setTextCursorPosition, suggestedUsers, textBeforeAtSymbol, - usernamePrefix, + textPrefix, ], ); 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 @@ -82,7 +82,7 @@ +inputStateSetTextCursorPosition: (newPosition: number) => mixed, +suggestedUsers: $ReadOnlyArray, +textBeforeAtSymbol: string, - +usernamePrefix: string, + +textPrefix: string, }; function getTypeaheadTooltipActions( @@ -94,7 +94,7 @@ inputStateSetTextCursorPosition, suggestedUsers, textBeforeAtSymbol, - usernamePrefix, + textPrefix, } = params; return suggestedUsers .filter( @@ -106,7 +106,7 @@ const { newText, newSelectionStart } = getNewTextAndSelection( textBeforeAtSymbol, inputStateDraft, - usernamePrefix, + textPrefix, suggestedUser, );