From e09f859fa7321cb6601f001cdd20f8bbea27d757 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Fri, 27 Feb 2026 13:57:58 -0800 Subject: [PATCH] copy on hover, better button treatments --- apps/web/src/components/ChatView.tsx | 52 +++++++++++++++++++++------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 7ae68e537100..1456a07dd003 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -83,6 +83,8 @@ import { LockOpenIcon, Undo2Icon, XIcon, + CopyIcon, + CheckIcon, } from "lucide-react"; import { Button } from "./ui/button"; import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "./ui/select"; @@ -2333,6 +2335,28 @@ const PendingApprovalsPanel = memo(function PendingApprovalsPanel({ ); }); +const MessageCopyButton = memo(function MessageCopyButton({ text }: { text: string }) { + const [copied, setCopied] = useState(false); + + const handleCopy = useCallback(() => { + void navigator.clipboard.writeText(text); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }, [text]); + + return ( + + ); +}); + interface MessagesTimelineProps { hasMessages: boolean; isWorking: boolean; @@ -2549,7 +2573,7 @@ const MessagesTimeline = memo(function MessagesTimeline({ const canRevertAgentWork = revertTurnCountByUserMessageId.has(row.message.id); return (
-
+
{userImages.length > 0 && (
{userImages.map( @@ -2583,17 +2607,21 @@ const MessagesTimeline = memo(function MessagesTimeline({ )}
- {canRevertAgentWork && ( - - )} +
+ {row.message.text && } + {canRevertAgentWork && ( + + )} +

{formatTimestamp(row.message.createdAt)}