diff --git a/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx b/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx index 1cb751bc..945f6764 100644 --- a/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx +++ b/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx @@ -5,7 +5,7 @@ import z from "zod"; import { Workflow } from "@/app/lib/types/workflow_types"; import { WorkflowTool } from "@/app/lib/types/workflow_types"; import MarkdownContent from "@/app/lib/components/markdown-content"; -import { ChevronRightIcon, ChevronDownIcon, ChevronUpIcon, CodeIcon, CheckCircleIcon, FileTextIcon } from "lucide-react"; +import { ChevronRightIcon, ChevronDownIcon, ChevronUpIcon, CodeIcon, CheckCircleIcon, FileTextIcon, EyeIcon, EyeOffIcon, WrapTextIcon, ArrowRightFromLineIcon, BracesIcon, TextIcon } from "lucide-react"; import { TestProfile } from "@/app/lib/types/testing_types"; import { ProfileContextBox } from "./profile-context-box"; import { Message, ToolMessage, AssistantMessageWithToolCalls } from "@/app/lib/types/types"; @@ -81,7 +81,7 @@ function InternalAssistantMessage({ content, sender, latency, delta, showJsonMod
{formattedJson}
@@ -127,7 +127,7 @@ function InternalAssistantMessage({ content, sender, latency, delta, showJsonMod
{deltaDisplay}
@@ -298,9 +298,74 @@ function ClientToolCall({
const [wrapText, setWrapText] = useState(true);
const [paramsExpanded, setParamsExpanded] = useState(false);
const [resultsExpanded, setResultsExpanded] = useState(false);
-
const hasExpandedContent = paramsExpanded || resultsExpanded;
+ const isCompressed = !paramsExpanded && !resultsExpanded;
+ // Compressed state: stretch header, no wrapping
+ if (isCompressed) {
+ return (
+
+ {sender && (
+
+ {sender}
+
+ )}
+
+
+
+
+ {!availableResult && }
+ {availableResult && }
+
+ Invoked Tool:
+
+ {toolCall.function.name}
+
+
+
+ {hasExpandedContent && (
+
+
+
+ )}
+
+
+ }
+ wrapText={wrapText}
+ onExpandedChange={setParamsExpanded}
+ />
+ {availableResult && (
+
+ }
+ wrapText={wrapText}
+ onExpandedChange={setResultsExpanded}
+ />
+
+ )}
+
+
+
+
+ );
+ }
+
+ // Expanded state: respect 85% max width, prevent overshoot
return (
{sender && (
@@ -308,53 +373,51 @@ function ClientToolCall({
{sender}
)}
-
+
-
-
+ bg-gray-50 dark:bg-gray-800 shadow-sm dark:shadow-gray-950/20 w-full">
+
+
{!availableResult && }
{availableResult && }
-
+
Invoked Tool:
-
+
{toolCall.function.name}
+ {hasExpandedContent && (
+
+
+
+ )}
-
-
+
}
wrapText={wrapText}
onExpandedChange={setParamsExpanded}
/>
{availableResult && (
-
+
}
wrapText={wrapText}
onExpandedChange={setResultsExpanded}
- rightButton={hasExpandedContent ? (
-
- ) : undefined}
/>
)}
@@ -408,8 +471,8 @@ function ExpandableContent({
const isMarkdown = label === 'Result' && typeof content === 'string' && !content.startsWith('{');
- return
-
+ return
+
{!isExpanded && }
{isExpanded && }
{icon && {icon}}
@@ -418,14 +481,14 @@ function ExpandableContent({
{isExpanded && (
isMarkdown ? (
-
+
) : (
{formattedContent}