feat: Add truncation notification for large outputs (#7212)

 (textOutputView/index.tsx): add support for displaying a message when the output is truncated due to its size
This commit is contained in:
Cristhian Zanforlin Lousa 2025-03-21 14:56:57 -03:00 committed by GitHub
commit e5cb767432
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,14 +10,25 @@ const TextOutputView = ({
if (typeof value === "object" && Object.keys(value).includes("text")) {
value = value.text;
}
const isTruncated = value?.length > 20000;
return (
<Textarea
className={`w-full custom-scroll ${left ? "min-h-32" : "h-full"}`}
placeholder={"Empty"}
readOnly
// update to real value on flowPool
value={value}
/>
<>
{" "}
<Textarea
className={`w-full custom-scroll ${left ? "min-h-32" : "h-full"}`}
placeholder={"Empty"}
readOnly
// update to real value on flowPool
value={value}
/>
{isTruncated && (
<div className="mt-2 text-xs text-muted-foreground">
This output has been truncated due to its size.
</div>
)}
</>
);
};