From 10ac28b9d690b9f7a990cc6c2276ea8fe2cfdd66 Mon Sep 17 00:00:00 2001 From: canvrno <46584286+canvrno@users.noreply.github.com> Date: Mon, 17 Mar 2025 20:59:14 -0700 Subject: [PATCH] Issue with 'See More' button in task header (#2302) * Fixes issue with 'See More' button in task header * Removed requestAnimationFrame * Cleanup --------- Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> --- .changeset/famous-brooms-mate.md | 5 +++++ webview-ui/src/components/chat/TaskHeader.tsx | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/famous-brooms-mate.md diff --git a/.changeset/famous-brooms-mate.md b/.changeset/famous-brooms-mate.md new file mode 100644 index 00000000..fd167ff4 --- /dev/null +++ b/.changeset/famous-brooms-mate.md @@ -0,0 +1,5 @@ +--- +"claude-dev": minor +--- + +Corrected issue with 'See more' button in task header diff --git a/webview-ui/src/components/chat/TaskHeader.tsx b/webview-ui/src/components/chat/TaskHeader.tsx index 5aa67fbf..b21dc0ba 100644 --- a/webview-ui/src/components/chat/TaskHeader.tsx +++ b/webview-ui/src/components/chat/TaskHeader.tsx @@ -94,19 +94,20 @@ const TaskHeader: React.FC = ({ }, [isTextExpanded, windowHeight]) useEffect(() => { - if (textRef.current && textContainerRef.current) { + if (isTaskExpanded && textRef.current && textContainerRef.current) { let textContainerHeight = textContainerRef.current.clientHeight if (!textContainerHeight) { textContainerHeight = textContainerRef.current.getBoundingClientRect().height } const isOverflowing = textRef.current.scrollHeight > textContainerHeight + // necessary to show see more button again if user resizes window to expand and then back to collapse if (!isOverflowing) { setIsTextExpanded(false) } setShowSeeMore(isOverflowing) } - }, [task.text, windowWidth]) + }, [task.text, windowWidth, isTaskExpanded]) const isCostAvailable = useMemo(() => { const openAiCompatHasPricing =