From 896c79c59e28dfe2c4d7b272d99efbdcd80dbd45 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Sat, 4 Apr 2026 10:20:56 +0100 Subject: [PATCH] Fix for wrapping text on run inspector --- .../components/primitives/CopyTextLink.tsx | 33 +++++++++++++++++ .../route.tsx | 36 ++++++++++++------- 2 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 apps/webapp/app/components/primitives/CopyTextLink.tsx diff --git a/apps/webapp/app/components/primitives/CopyTextLink.tsx b/apps/webapp/app/components/primitives/CopyTextLink.tsx new file mode 100644 index 0000000000..33818fa607 --- /dev/null +++ b/apps/webapp/app/components/primitives/CopyTextLink.tsx @@ -0,0 +1,33 @@ +import { ClipboardCheckIcon, ClipboardIcon } from "lucide-react"; +import { useCopy } from "~/hooks/useCopy"; +import { cn } from "~/utils/cn"; + +type CopyTextLinkProps = { + value: string; + className?: string; +}; + +export function CopyTextLink({ value, className }: CopyTextLinkProps) { + const { copy, copied } = useCopy(value); + + return ( + + ); +} diff --git a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx index 3d8d7ed4e3..e0bec66ffb 100644 --- a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx +++ b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx @@ -32,6 +32,7 @@ import { MachineTooltipInfo } from "~/components/MachineTooltipInfo"; import { Button, LinkButton } from "~/components/primitives/Buttons"; import { Callout } from "~/components/primitives/Callout"; import { CopyableText } from "~/components/primitives/CopyableText"; +import { CopyTextLink } from "~/components/primitives/CopyTextLink"; import { DateTime, DateTimeAccurate } from "~/components/primitives/DateTime"; import { Header2, Header3 } from "~/components/primitives/Headers"; import { Paragraph } from "~/components/primitives/Paragraph"; @@ -263,19 +264,21 @@ function SpanBody({ span.entity?.type === "prompt"; return ( -
+
-
-
+
+
- +
@@ -311,7 +314,6 @@ function formatSpanDuration(nanoseconds: number): string { return `${mins}m ${secs}s`; } - function applySpanOverrides(span: Span, spanOverrides?: SpanOverride): Span { if (!spanOverrides) { return span; @@ -1259,8 +1261,13 @@ function SpanEntity({ span }: { span: Span }) { )} - Message - {span.message} + + Message + + + + {span.message} + {span.events.length > 0 && } @@ -1416,7 +1423,13 @@ function SpanEntity({ span }: { span: Span }) { @@ -1456,4 +1469,3 @@ function SpanEntity({ span }: { span: Span }) { } } } -