mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
fix: prevent tool args from expanding chat width during streaming (#47)
This commit is contained in:
@@ -131,9 +131,9 @@ export function ChatMessageDisplay({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={callId}
|
key={callId}
|
||||||
className="p-4 my-2 text-gray-500 border border-gray-300 rounded"
|
className="p-4 my-2 text-gray-500 border border-gray-300 rounded overflow-hidden"
|
||||||
>
|
>
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2 min-w-0">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="text-xs">Tool: {toolName}</div>
|
<div className="text-xs">Tool: {toolName}</div>
|
||||||
{input && Object.keys(input).length > 0 && (
|
{input && Object.keys(input).length > 0 && (
|
||||||
@@ -146,11 +146,11 @@ export function ChatMessageDisplay({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{input && isExpanded && (
|
{input && isExpanded && (
|
||||||
<div className="mt-1 font-mono text-xs overflow-hidden">
|
<pre className="mt-1 font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-48">
|
||||||
{typeof input === "object" &&
|
{typeof input === "object" &&
|
||||||
Object.keys(input).length > 0 &&
|
Object.keys(input).length > 0 &&
|
||||||
`Input: ${JSON.stringify(input, null, 2)}`}
|
`Input: ${JSON.stringify(input, null, 2)}`}
|
||||||
</div>
|
</pre>
|
||||||
)}
|
)}
|
||||||
<div className="mt-2 text-sm">
|
<div className="mt-2 text-sm">
|
||||||
{state === "input-streaming" ? (
|
{state === "input-streaming" ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user