diff --git a/ui/src/components/ChatMessage.tsx b/ui/src/components/ChatMessage.tsx index ed9f6ba4..febae610 100644 --- a/ui/src/components/ChatMessage.tsx +++ b/ui/src/components/ChatMessage.tsx @@ -26,6 +26,8 @@ interface ChatMessageProps { onEdit?: (messageId: string, newContent: string) => void; onRetry?: (messageId: string) => void; onHandoff?: (spec: { what: string; why: string; constraints: string; success: string }) => void; + onBookmark?: (messageId: string) => void; + isBookmarked?: boolean; } export function ChatMessage({ @@ -43,6 +45,8 @@ export function ChatMessage({ onEdit, onRetry, onHandoff, + onBookmark, + isBookmarked, }: ChatMessageProps) { const [isEditing, setIsEditing] = useState(false); const [editValue, setEditValue] = useState(content); @@ -135,6 +139,8 @@ export function ChatMessage({ role="user" isStreaming={isAnyStreaming} onEdit={() => setIsEditing(true)} + onBookmark={id && onBookmark ? () => onBookmark(id) : undefined} + isBookmarked={isBookmarked} /> @@ -159,6 +165,8 @@ export function ChatMessage({ role="assistant" isStreaming={isAnyStreaming} onRetry={id && onRetry ? () => onRetry(id) : undefined} + onBookmark={id && onBookmark ? () => onBookmark(id) : undefined} + isBookmarked={isBookmarked} /> ); diff --git a/ui/src/components/ChatMessageActions.tsx b/ui/src/components/ChatMessageActions.tsx index 92d59380..0fc47ac8 100644 --- a/ui/src/components/ChatMessageActions.tsx +++ b/ui/src/components/ChatMessageActions.tsx @@ -1,20 +1,23 @@ import { Pencil, RefreshCw } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; +import { ChatMessageBookmark } from "./ChatMessageBookmark"; interface ChatMessageActionsProps { role: "user" | "assistant" | "system"; isStreaming?: boolean; onEdit?: () => void; onRetry?: () => void; + onBookmark?: () => void; + isBookmarked?: boolean; } -export function ChatMessageActions({ role, isStreaming, onEdit, onRetry }: ChatMessageActionsProps) { +export function ChatMessageActions({ role, isStreaming, onEdit, onRetry, onBookmark, isBookmarked }: ChatMessageActionsProps) { if (isStreaming) return null; if (role === "user" && onEdit) { return ( -