From 45b4237fd5fc05802c3f6eab4f575b4be608ca00 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 09:45:34 -0400 Subject: [PATCH] fix: always render @[userId] mention tokens regardless of split test (#35564) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * fix: always render @[userId] mention tokens regardless of split test Readers outside the comment-mentions/email-notifications split tests were seeing raw @[] 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 - 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 GitOrigin-RevId: c7cedbfe6966bb2ebce58a5f4e03b1627198dab7 --- .../components/review-panel-expandable-content.tsx | 7 +------ .../review-panel/components/review-panel-message.tsx | 3 --- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/services/web/frontend/js/features/review-panel/components/review-panel-expandable-content.tsx b/services/web/frontend/js/features/review-panel/components/review-panel-expandable-content.tsx index 9462e0ae71..3f5ff35456 100644 --- a/services/web/frontend/js/features/review-panel/components/review-panel-expandable-content.tsx +++ b/services/web/frontend/js/features/review-panel/components/review-panel-expandable-content.tsx @@ -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(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( diff --git a/services/web/frontend/js/features/review-panel/components/review-panel-message.tsx b/services/web/frontend/js/features/review-panel/components/review-panel-message.tsx index c08cf6ab77..2871d791ee 100644 --- a/services/web/frontend/js/features/review-panel/components/review-panel-message.tsx +++ b/services/web/frontend/js/features/review-panel/components/review-panel-message.tsx @@ -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} /> )}