From cce2cfef9c0dceae586b82f770c8b686cf3dea3c Mon Sep 17 00:00:00 2001 From: Max Freedom Pollard <272618364+MaxFreedomPollard@users.noreply.github.com> Date: Thu, 22 Oct 2026 15:12:59 -0700 Subject: [PATCH] fix(ui): match hyphens and dots in mentions matchedUsers builds the mention_username_list sent with a new comment, but its pattern stops at "-" and ".", while parseUserInfo, which turns the same text into links, accepts both. A comment mentioning the user "jane-doe" links to /users/jane-doe, but the mention notification is looked up for "jane": another user receives it, or nobody does. Use the parseUserInfo pattern in matchedUsers so the users who are notified are the users the comment links to. Co-Authored-By: Claude Opus 5.5 --- ui/src/utils/common.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/utils/common.ts b/ui/src/utils/common.ts index 930392c18..c95b95991 100644 --- a/ui/src/utils/common.ts +++ b/ui/src/utils/common.ts @@ -95,8 +95,9 @@ const bgFadeOut = (el) => { * @returns Array<{displayName: string, userName: string}> */ function matchedUsers(markdown) { - const globalReg = /\B@([\w|]+)/g; - const reg = /\B@([\w\\_\\.]+)/; + // Same pattern as parseUserInfo: usernames may contain "-" and ".". + const globalReg = /\B@([\w\\_\\.\\-]+)/g; + const reg = /\B@([\w\\_\\.\\-]+)/; const users = markdown.match(globalReg); if (!users) {