One elapsed-time notation: ago() reads dur's units app-wide, health runs cell widened

This commit is contained in:
2026-10-15 17:10:36 +02:00
parent 6a847a2f28
commit 87f5b6b58a
10 changed files with 22 additions and 41 deletions
+1 -2
View File
@@ -5,7 +5,6 @@ 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"
import {
@@ -17,7 +16,7 @@ import {
TableRow,
} from "@/components/ui/table"
import useCustomToast from "@/hooks/useCustomToast"
import { cn, dur, si } from "@/lib/utils"
import { ago, cn, dur, si } from "@/lib/utils"
import { MetricPicker, RunMetricChart, useMetricNames } from "./MetricChart"
import { OpenInDashboard } from "./OpenInDashboard"
import {
+2 -8
View File
@@ -39,7 +39,7 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table"
import { cn, dur } from "@/lib/utils"
import { ago, cn, dur } from "@/lib/utils"
import {
AxisPicker,
MetricPicker,
@@ -425,12 +425,6 @@ function ParamValue({ value }: { value: unknown }) {
)
}
/** How long ago a moment was, in `dur`'s units so a row's two times agree. */
function since(ts: unknown): string {
if (!ts) return "—"
return `${dur(Date.now() - Date.parse(String(ts)))} ago`
}
function RunsTable({
runs,
search,
@@ -611,7 +605,7 @@ function RunsTable({
`${dur(run.duration_ms)} ago`
) : (
<>
{since(run.created_at)}
{ago(String(run.created_at ?? ""))}
<span className="px-1.5 text-border">|</span>
<span>{run.duration_ms ? dur(run.duration_ms) : "—"}</span>
</>