Skip to content

Commit 0bdb5a8

Browse files
authored
fix(web): show native caret and selection in file comments (pingdotgg#17554)
1 parent 0224cd1 commit 0bdb5a8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/web/src/components/diffs/DiffCommentAnnotation.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function DiffCommentAnnotation({
5959
return (
6060
<div
6161
data-diff-comment-annotation
62-
className="group/comment flex min-w-0 items-start gap-2.5 border-s-2 border-primary/55 bg-primary/[0.045] px-3 py-2.5 font-sans text-foreground"
62+
className="group/comment flex min-w-0 items-start gap-2.5 border-s-2 border-primary/55 bg-primary/[0.045] px-3 py-2.5 font-sans text-foreground selection:bg-primary selection:text-primary-foreground"
6363
contentEditable={false}
6464
onPointerDown={(event) => event.stopPropagation()}
6565
>
@@ -81,10 +81,12 @@ export function DiffCommentAnnotation({
8181
);
8282
}
8383

84+
// Editable file annotations inherit Pierre's transparent native caret and selection.
85+
// Comments use a native textarea, so they need their own visible text feedback.
8486
return (
8587
<div
8688
data-diff-comment-annotation
87-
className="px-3 py-2 font-sans text-foreground"
89+
className="px-3 py-2 font-sans text-foreground caret-foreground selection:bg-primary selection:text-primary-foreground"
8890
contentEditable={false}
8991
onPointerDown={(event) => event.stopPropagation()}
9092
>

0 commit comments

Comments
 (0)