diff --git a/frontend/src/components/thread/tool-call-side-panel.tsx b/frontend/src/components/thread/tool-call-side-panel.tsx index caf0f603..785dd2be 100644 --- a/frontend/src/components/thread/tool-call-side-panel.tsx +++ b/frontend/src/components/thread/tool-call-side-panel.tsx @@ -12,6 +12,7 @@ import { useIsMobile } from '@/hooks/use-mobile'; import { Button } from '@/components/ui/button'; import { ToolView } from './tool-views/wrapper'; import { motion, AnimatePresence } from 'framer-motion'; +import { toast } from 'sonner'; export interface ToolCallInput { assistantCall: { @@ -259,10 +260,9 @@ export function ToolCallSidePanel({ setIsCopyingContent(true); const success = await copyToClipboard(fileContent); if (success) { - // Use toast if available, otherwise just log - console.log('File content copied to clipboard'); + toast.success('File content copied to clipboard'); } else { - console.error('Failed to copy file content'); + toast.error('Failed to copy file content'); } setTimeout(() => setIsCopyingContent(false), 500); }, [displayToolCall?.toolResult?.content, copyToClipboard]); diff --git a/frontend/src/components/thread/tool-views/GenericToolView.tsx b/frontend/src/components/thread/tool-views/GenericToolView.tsx index bccdf981..5f38bef6 100644 --- a/frontend/src/components/thread/tool-views/GenericToolView.tsx +++ b/frontend/src/components/thread/tool-views/GenericToolView.tsx @@ -16,6 +16,7 @@ import { Badge } from '@/components/ui/badge'; import { ScrollArea } from "@/components/ui/scroll-area"; import { Button } from '@/components/ui/button'; import { LoadingState } from './shared/LoadingState'; +import { toast } from 'sonner'; export function GenericToolView({ name = 'generic-tool', @@ -143,9 +144,9 @@ export function GenericToolView({ setIsCopyingInput(true); const success = await copyToClipboard(formattedAssistantContent); if (success) { - console.log('Tool input copied to clipboard'); + toast.success('File content copied to clipboard'); } else { - console.error('Failed to copy tool input'); + toast.error('Failed to copy file content'); } setTimeout(() => setIsCopyingInput(false), 500); }, [formattedAssistantContent, copyToClipboard]); @@ -156,9 +157,9 @@ export function GenericToolView({ setIsCopyingOutput(true); const success = await copyToClipboard(formattedToolContent); if (success) { - console.log('Tool output copied to clipboard'); + toast.success('File content copied to clipboard'); } else { - console.error('Failed to copy tool output'); + toast.error('Failed to copy file content'); } setTimeout(() => setIsCopyingOutput(false), 500); }, [formattedToolContent, copyToClipboard]); @@ -224,7 +225,7 @@ export function GenericToolView({ onClick={handleCopyInput} disabled={isCopyingInput} className="h-6 w-6 p-0" - title="Copy input" + title="Copy file content" > {isCopyingInput ? ( @@ -256,7 +257,7 @@ export function GenericToolView({ onClick={handleCopyOutput} disabled={isCopyingOutput} className="h-6 w-6 p-0" - title="Copy output" + title="Copy file content" > {isCopyingOutput ? ( diff --git a/frontend/src/components/thread/tool-views/file-operation/FileOperationToolView.tsx b/frontend/src/components/thread/tool-views/file-operation/FileOperationToolView.tsx index 91419569..9a2aa926 100644 --- a/frontend/src/components/thread/tool-views/file-operation/FileOperationToolView.tsx +++ b/frontend/src/components/thread/tool-views/file-operation/FileOperationToolView.tsx @@ -56,6 +56,7 @@ import { import { ToolViewProps } from '../types'; import { GenericToolView } from '../GenericToolView'; import { LoadingState } from '../shared/LoadingState'; +import { toast } from 'sonner'; export function FileOperationToolView({ assistantContent, @@ -90,9 +91,9 @@ export function FileOperationToolView({ setIsCopyingContent(true); const success = await copyToClipboard(fileContent); if (success) { - console.log('File content copied to clipboard'); + toast.success('File content copied to clipboard'); } else { - console.error('Failed to copy file content'); + toast.error('Failed to copy file content'); } setTimeout(() => setIsCopyingContent(false), 500); }; @@ -313,6 +314,14 @@ export function FileOperationToolView({
+ {isHtml && htmlPreviewUrl && !isStreaming && ( + + )} {/* Copy button - only show when there's file content */} {fileContent && !isStreaming && ( )} - {isHtml && htmlPreviewUrl && !isStreaming && ( - - )}