mirror of https://github.com/langgenius/dify.git
prevent comment thread pinch
This commit is contained in:
parent
be1f841b37
commit
bd597497e7
|
|
@ -179,6 +179,7 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
|||
appId ? state.mentionableUsersCache[appId] : undefined
|
||||
))
|
||||
const mentionUsers = mentionUsersFromStore ?? []
|
||||
const setCommentPreviewHovering = useStore(state => state.setCommentPreviewHovering)
|
||||
|
||||
// Extract all mentionable names for highlighting
|
||||
const mentionableNames = useMemo(() => {
|
||||
|
|
@ -192,6 +193,10 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
|||
setReplyContent('')
|
||||
}, [comment.id])
|
||||
|
||||
useEffect(() => () => {
|
||||
setCommentPreviewHovering(false)
|
||||
}, [setCommentPreviewHovering])
|
||||
|
||||
// P0: Auto-focus reply input when thread opens or comment changes
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
|
|
@ -344,6 +349,8 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
|||
top: canvasPosition.y,
|
||||
transform: 'translateY(-20%)',
|
||||
}}
|
||||
onMouseEnter={() => setCommentPreviewHovering(true)}
|
||||
onMouseLeave={() => setCommentPreviewHovering(false)}
|
||||
>
|
||||
<div
|
||||
ref={threadRef}
|
||||
|
|
|
|||
Loading…
Reference in New Issue