diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.tsx index b53f31106dd..b6788b8904f 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/CollapsibleMessage.tsx @@ -1,13 +1,5 @@ -/** - * CollapsibleMessage - Collapsible message with arrow and char count - * Used for system messages - */ - -import { useState } from 'react'; -import { Typography } from 'antd'; -import { DownOutlined, RightOutlined } from '@ant-design/icons'; - -const { Text } = Typography; +import { useState } from "react"; +import { ChevronDown, ChevronRight } from "lucide-react"; interface CollapsibleMessageProps { label: string; @@ -15,13 +7,12 @@ interface CollapsibleMessageProps { defaultExpanded?: boolean; } -export function CollapsibleMessage({ - label, - content, - defaultExpanded = false +export function CollapsibleMessage({ + label, + content, + defaultExpanded = false, }: CollapsibleMessageProps) { const [isExpanded, setIsExpanded] = useState(defaultExpanded); - const [isHovered, setIsHovered] = useState(false); const charCount = content?.length || 0; if (!content || charCount === 0) { @@ -29,57 +20,32 @@ export function CollapsibleMessage({ } return ( -
- {/* Clickable Header with hover state */} +
setIsExpanded(!isExpanded)} - onMouseEnter={() => setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} - style={{ - display: 'flex', - alignItems: 'center', - gap: 6, - cursor: 'pointer', - padding: '4px 0', - borderRadius: 4, - background: isHovered ? '#f5f5f5' : 'transparent', - transition: 'background 0.15s ease', - marginBottom: isExpanded ? 4 : 0, - }} + className="flex items-center gap-1.5 cursor-pointer py-1 rounded hover:bg-muted transition-colors" > {isExpanded ? ( - + ) : ( - + )} - + {label} - - + + ({charCount.toLocaleString()} chars) - +
- {/* Content with smooth animation */}
-
+
{content}
diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.tsx index af27be1736f..31a0ae7cf61 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/HistoryTree.tsx @@ -1,15 +1,7 @@ -/** - * HistoryTree - Collapsible tree view for message history - * Shows arrow indicator and message count - */ - -import { useState } from 'react'; -import { Typography } from 'antd'; -import { DownOutlined, RightOutlined } from '@ant-design/icons'; -import { ParsedMessage } from './prettyMessagesTypes'; -import { SimpleMessageBlock } from './SimpleMessageBlock'; - -const { Text } = Typography; +import { useState } from "react"; +import { ChevronDown, ChevronRight } from "lucide-react"; +import { ParsedMessage } from "./prettyMessagesTypes"; +import { SimpleMessageBlock } from "./SimpleMessageBlock"; interface HistoryTreeProps { messages: ParsedMessage[]; @@ -17,56 +9,35 @@ interface HistoryTreeProps { export function HistoryTree({ messages }: HistoryTreeProps) { const [isExpanded, setIsExpanded] = useState(false); - const [isHovered, setIsHovered] = useState(false); if (messages.length === 0) { return null; } return ( -
- {/* Clickable Header with hover state */} +
setIsExpanded(!isExpanded)} - onMouseEnter={() => setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} - style={{ - display: 'flex', - alignItems: 'center', - gap: 6, - cursor: 'pointer', - padding: '4px 0', - borderRadius: 4, - background: isHovered ? '#f5f5f5' : 'transparent', - transition: 'background 0.15s ease', - marginBottom: isExpanded ? 4 : 0, - }} + className="flex items-center gap-1.5 cursor-pointer py-1 rounded hover:bg-muted transition-colors" > {isExpanded ? ( - + ) : ( - + )} - - HISTORY ({messages.length} message{messages.length !== 1 ? 's' : ''}) - + + HISTORY ({messages.length} message{messages.length !== 1 ? "s" : ""}) +
- {/* Expanded Tree Content with smooth animation */}
-
+
{messages.map((msg, index) => ( 0 ? content : null; + const displayContent = + content && content !== "null" && content.length > 0 ? content : null; const hasToolCalls = toolCalls && toolCalls.length > 0; - // If no content and no tool calls, don't render if (!displayContent && !hasToolCalls) { return null; } return ( -
- +
+ {label} - + {displayContent && (
{displayContent}
)} - {/* Inline tool calls for assistant messages in history */} {hasToolCalls && (
{toolCalls.map((tc, index) => ( - + ))}
)} diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx index 691266b5207..c7c75c1e580 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx @@ -1,61 +1,33 @@ -/** - * SimpleToolCallBlock - Simple tool call display without copy button - * Used in compact/tree views - */ - -import { Typography } from 'antd'; -import { ToolCall } from './prettyMessagesTypes'; - -const { Text } = Typography; +import { ToolCall } from "./prettyMessagesTypes"; interface SimpleToolCallBlockProps { tool: ToolCall; compact?: boolean; } -export function SimpleToolCallBlock({ tool, compact = false }: SimpleToolCallBlockProps) { +export function SimpleToolCallBlock({ + tool, + compact = false, +}: SimpleToolCallBlockProps) { return (
- {/* Function badge */} -
+
function
- - {tool.name} - + {tool.name} {Object.keys(tool.arguments).length > 0 && (
{Object.entries(tool.arguments).map(([key, value]) => ( -
- - {key}:{' '} - - {JSON.stringify(value)} +
+ {key}: + {JSON.stringify(value)}
))}