Scroll the runs table, pick a range, and choose what a comparison plots against

This commit is contained in:
2026-08-25 16:32:34 +02:00
parent 8d5cf0a71a
commit 28a00a55d5
14 changed files with 498 additions and 151 deletions
+36 -18
View File
@@ -4,6 +4,7 @@ import { ChevronDown, ChevronRight, Download } from "lucide-react"
import { useState } from "react"
import type { ArtifactRow, RunNodeRow } from "@/client"
import { ValuePreview } from "@/components/Flow/ValuePreview"
import { ago } from "@/components/Health/queries"
import { Button } from "@/components/ui/button"
import { Skeleton } from "@/components/ui/skeleton"
@@ -121,15 +122,7 @@ export function RunDetail({ id }: { id: string }) {
) : (
<dl className="grid gap-x-6 gap-y-1 sm:grid-cols-2 lg:grid-cols-3">
{Object.entries(run.params).map(([key, value]) => (
<div
key={key}
className="flex justify-between gap-4 border-border border-b py-1"
>
<dt className={LABEL}>{key}</dt>
<dd className="truncate font-mono text-sm">
{paramText(value)}
</dd>
</div>
<Entry key={key} name={key} value={value} />
))}
</dl>
)}
@@ -154,15 +147,7 @@ export function RunDetail({ id }: { id: string }) {
<h2 className="font-medium text-sm">Result</h2>
<dl className="grid gap-x-6 gap-y-1 sm:grid-cols-2 lg:grid-cols-3">
{Object.entries(run.result ?? {}).map(([key, value]) => (
<div
key={key}
className="flex justify-between gap-4 border-border border-b py-1"
>
<dt className={LABEL}>{key}</dt>
<dd className="truncate font-mono text-sm">
{paramText(value)}
</dd>
</div>
<Entry key={key} name={key} value={value} />
))}
</dl>
</section>
@@ -175,6 +160,39 @@ export function RunDetail({ id }: { id: string }) {
)
}
/**
* One named value: read directly when it is a scalar, unfolded when it is not.
*
* The same disclosure a node's ports use on the canvas — a run's report is a
* record like any other, and serialising it onto one truncated line answers
* nothing.
*/
function Entry({ name, value }: { name: string; value: unknown }) {
const structured = value !== null && typeof value === "object"
return (
<div
className={cn(
"gap-4 border-border border-b py-1",
structured ? "flex flex-col" : "flex justify-between",
)}
>
<dt className={LABEL}>{name}</dt>
<dd
className={cn(
"min-w-0",
structured ? "" : "truncate font-mono text-sm",
)}
>
{structured ? (
<ValuePreview value={value} defaultOpen />
) : (
paramText(value)
)}
</dd>
</div>
)
}
function Fact({
label,
children,