From 8df548605e3197f1288335b103479a5962e3653e Mon Sep 17 00:00:00 2001 From: Kalven Schraut Date: Sat, 12 Sep 2026 11:30:37 -0500 Subject: [PATCH] feat(web): suggest usernames in PR review comments --- .../diffs/DiffCommentAnnotation.tsx | 6 +- .../pullRequest/PullRequestDetailPanel.tsx | 18 +- .../pullRequest/PullRequestMarkdownEditor.tsx | 6 +- .../PullRequestMentionProvider.tsx | 58 +++++++ .../PullRequestReviewAnnotation.tsx | 6 +- .../pullRequest/PullRequestReviewBar.tsx | 6 +- .../pullRequest/PullRequestSummaryTab.tsx | 6 +- .../components/ui/mention-textarea.test.tsx | 90 ++++++++++ .../src/components/ui/mention-textarea.tsx | 160 ++++++++++++++++++ .../components/ui/mentionText.logic.test.ts | 29 ++++ .../src/components/ui/mentionText.logic.ts | 39 +++++ docs/user/source-control.md | 4 + 12 files changed, 412 insertions(+), 16 deletions(-) create mode 100644 apps/web/src/components/pullRequest/PullRequestMentionProvider.tsx create mode 100644 apps/web/src/components/ui/mention-textarea.test.tsx create mode 100644 apps/web/src/components/ui/mention-textarea.tsx create mode 100644 apps/web/src/components/ui/mentionText.logic.test.ts create mode 100644 apps/web/src/components/ui/mentionText.logic.ts diff --git a/apps/web/src/components/diffs/DiffCommentAnnotation.tsx b/apps/web/src/components/diffs/DiffCommentAnnotation.tsx index bce9f7e55f58..9fa0f4377c49 100644 --- a/apps/web/src/components/diffs/DiffCommentAnnotation.tsx +++ b/apps/web/src/components/diffs/DiffCommentAnnotation.tsx @@ -2,7 +2,7 @@ import { MessageCircle, Trash2 } from "lucide-react"; import { useLayoutEffect, useRef, useState, type ReactNode } from "react"; import { Button } from "~/components/ui/button"; -import { Textarea } from "~/components/ui/textarea"; +import { MentionTextarea } from "~/components/ui/mention-textarea"; import { isCommentSubmitShortcut } from "./commentSubmitShortcut"; @@ -88,7 +88,7 @@ export function DiffCommentAnnotation({ contentEditable={false} onPointerDown={(event) => event.stopPropagation()} > -