diff --git a/frontend/src/hooks/useCopyText.js b/frontend/src/hooks/useCopyText.js index 04519b2e..2f17d6c1 100644 --- a/frontend/src/hooks/useCopyText.js +++ b/frontend/src/hooks/useCopyText.js @@ -1,11 +1,15 @@ +import { THOUGHT_REGEX_COMPLETE } from "@/components/WorkspaceChat/ChatContainer/ChatHistory/ThoughtContainer"; import { useState } from "react"; export default function useCopyText(delay = 2500) { const [copied, setCopied] = useState(false); const copyText = async (content) => { if (!content) return; - navigator?.clipboard?.writeText(content); - setCopied(content); + + // Filter thinking blocks from the content if they exist + const nonThinkingContent = content.replace(THOUGHT_REGEX_COMPLETE, ""); + navigator?.clipboard?.writeText(nonThinkingContent); + setCopied(nonThinkingContent); setTimeout(() => { setCopied(false); }, delay);