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 */}
-
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)}
))}