fix: always render @[userId] mention tokens regardless of split test (#35564)

* Initial plan

* fix: always render @[userId] mention tokens regardless of split test

Readers outside the comment-mentions/email-notifications split tests
were seeing raw @[<userId>] tokens in chat messages and review-panel
comments, leaking internal Mongo ObjectIds.

Fix: always parse and render @[userId] tokens using parseMentions() +
MentionBadge regardless of split-test membership. MentionBadge already
safely falls back to "@Unknown" when a userId can't be resolved to a
project member, so no ID is ever emitted.

- message-content.tsx: remove mentionsFeatureEnabled gate; always call
  renderMentionedContent() instead of falling back to raw <Linkify>
- review-panel-message.tsx: remove mentionsFeatureEnabled gate; always
  pass displayMentions to ExpandableContent

The mentions-input autocomplete (typing new @mentions) remains gated
behind the split test as before — this fix is rendering-only.

Co-authored-by: jdomaga <25135258+jdomaga@users.noreply.github.com>

* feat: always allow for mentions to display

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jdomaga <25135258+jdomaga@users.noreply.github.com>
Co-authored-by: Jimmy Domagala-Tang <jimmy.domagala-tang@overleaf.com>
GitOrigin-RevId: c7cedbfe6966bb2ebce58a5f4e03b1627198dab7
This commit is contained in:
Copilot
2026-09-17 11:37:32 +00:00
committed by Copybot
co-authored by jdomaga Jimmy Domagala-Tang
parent 4840bfc23e
commit 45b4237fd5
2 changed files with 1 additions and 9 deletions
@@ -18,7 +18,6 @@ export const ExpandableContent = memo<{
checkNewLines?: boolean
inline?: boolean
translate?: 'yes' | 'no'
displayMentions?: boolean
}>(function ExpandableContent({
content,
className,
@@ -27,7 +26,6 @@ export const ExpandableContent = memo<{
checkNewLines = true,
inline = false,
translate,
displayMentions = false,
}) {
const { t } = useTranslation()
const contentRef = useRef<HTMLDivElement>(null)
@@ -41,10 +39,7 @@ export const ExpandableContent = memo<{
const isOverflowing = content.length > limit
const segments = useMemo(
() => (displayMentions ? parseMentions(content) : null),
[content, displayMentions]
)
const segments = useMemo(() => parseMentions(content), [content])
const renderedContent = segments
? renderSegments(
@@ -15,7 +15,6 @@ import { useUserContext } from '@/shared/context/user-context'
import ReviewPanelEntryUser from './review-panel-entry-user'
import { usePermissionsContext } from '@/features/ide-react/context/permissions-context'
import { PreventSelectingEntry } from './review-panel-prevent-selecting'
import { mentionsFeatureEnabled } from '@/shared/utils/mentions'
export const ReviewPanelMessage: FC<{
message: ReviewPanelCommentThreadMessage
@@ -44,7 +43,6 @@ export const ReviewPanelMessage: FC<{
const hasSubmittedRef = useRef(false)
const user = useUserContext()
const permissions = usePermissionsContext()
const mentionsEnabled = mentionsFeatureEnabled()
const isCommentAuthor = Boolean(message.user && user.id === message.user.id)
const canEdit = isCommentAuthor && permissions.comment
@@ -147,7 +145,6 @@ export const ReviewPanelMessage: FC<{
checkNewLines
content={message.content}
translate="no"
displayMentions={mentionsEnabled}
/>
)}