From 917796da57ccb8108e16d60ca249acb133947bd2 Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Tue, 9 Jun 2026 17:37:08 +0800 Subject: [PATCH] fix(issues): keep sticky comment highlight consistent --- .../views/issues/components/comment-card.tsx | 65 ++++++++++++++----- .../issues/components/issue-detail.test.tsx | 4 +- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/packages/views/issues/components/comment-card.tsx b/packages/views/issues/components/comment-card.tsx index 5c68507e7..e4e33ecc7 100644 --- a/packages/views/issues/components/comment-card.tsx +++ b/packages/views/issues/components/comment-card.tsx @@ -1,6 +1,6 @@ "use client"; -import { memo, useCallback, useRef, useState } from "react"; +import { memo, useCallback, useRef, useState, type ReactNode } from "react"; import { CheckCircle2, ChevronRight, ListChevronsDownUp, Copy, MoreHorizontal, Pencil, RotateCcw, Trash2 } from "lucide-react"; import { toast } from "sonner"; import { Card } from "@multica/ui/components/ui/card"; @@ -43,6 +43,41 @@ import { useT } from "../../i18n"; import { CommentsFoldBar } from "./resolved-thread-bar"; import { deriveThreadResolution } from "./thread-utils"; +const highlightedCommentBackgroundClass = + "bg-[color-mix(in_srgb,var(--card)_95%,var(--brand)_5%)]"; +const highlightedCommentFadeClass = + "after:from-[color-mix(in_srgb,var(--card)_95%,var(--brand)_5%)]"; + +function StickyHeaderShell({ + className, + sticky = true, + highlighted, + children, +}: { + className?: string; + sticky?: boolean; + highlighted?: boolean; + children: ReactNode; +}) { + if (!sticky) { + return