From 364be48248b59d4ea05364c1aaa8bf5d0414e95a Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Sat, 11 Oct 2025 12:08:20 +0800 Subject: [PATCH] feat: add smooth scroll to comment thread --- web/app/components/workflow/comment/thread.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/comment/thread.tsx b/web/app/components/workflow/comment/thread.tsx index 14f6b00d74..1212abb7c1 100644 --- a/web/app/components/workflow/comment/thread.tsx +++ b/web/app/components/workflow/comment/thread.tsx @@ -205,8 +205,12 @@ export const CommentThread: FC = memo(({ const isNewComment = comment.id !== previousCommentIdRef.current const hasNewReply = replies.length > previousReplyCountRef.current - if (isNewComment || hasNewReply) - container.scrollTop = container.scrollHeight + if (isNewComment || hasNewReply) { + container.scrollTo({ + top: container.scrollHeight, + behavior: 'smooth', + }) + } previousCommentIdRef.current = comment.id previousReplyCountRef.current = replies.length