Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor(frontend): a log line with no time has no time

zchpeter61eec0ca7600
diff --git a/frontend/src/components/task-run-log/SectionContent.tsx b/frontend/src/components/task-run-log/SectionContent.tsx
index ba7cc2a765..8946c7ad79 100644
--- a/frontend/src/components/task-run-log/SectionContent.tsx
+++ b/frontend/src/components/task-run-log/SectionContent.tsx
@@ -7,10 +7,10 @@ import { cn } from "@/lib/utils";
import { displayableInstantMs } from "@/utils/datetime";
import type { Section } from "./types";
-// A log line carries 0 for a step that has no time yet, and the full reading
-// is only offered for an instant the formatters can render.
-const fullTime = (timeMs: number) => {
- const instantMs = timeMs > 0 ? displayableInstantMs(timeMs) : undefined;
+// The full reading is offered only for an instant the formatters can render.
+const fullTime = (timeMs: number | undefined) => {
+ const instantMs =
+ timeMs === undefined ? undefined : displayableInstantMs(timeMs);
return instantMs === undefined ? undefined : (
<FullDateTime tsMs={instantMs} />
);
diff --git a/frontend/src/components/task-run-log/TaskRunLogViewer.test.tsx b/frontend/src/components/task-run-log/TaskRunLogViewer.test.tsx
index 1692298acf..024dd8787f 100644
--- a/frontend/src/components/task-run-log/TaskRunLogViewer.test.tsx
+++ b/frontend/src/components/task-run-log/TaskRunLogViewer.test.tsx
@@ -286,6 +286,51 @@ describe("TaskRunLogViewer", () => {
unmount();
});
+ test("offers the full date only for a line that has an instant", () => {
+ const item = (key: string, time: string, timeMs: number | undefined) => ({
+ key,
+ time,
+ timeMs,
+ relativeTime: "",
+ levelIndicator: "\u2713",
+ levelClass: "text-green-600",
+ detail: `ROW ${key}`,
+ detailClass: "text-gray-600",
+ });
+ const section: Section = {
+ id: "section-0",
+ type: TaskRunLogEntry_Type.COMMAND_EXECUTE,
+ label: "Command Execute",
+ status: "success",
+ statusIcon: CheckCircle2,
+ statusClass: "text-green-600",
+ duration: "2s",
+ entryCount: 3,
+ items: [
+ item("timed", "12:00:00.000", Date.UTC(2026, 2, 2, 12)),
+ item("untimed", "--:--:--.---", undefined),
+ item("impossible", "12:00:02.000", 8.64e15 + 1),
+ ],
+ };
+
+ const { container, unmount } = renderIntoContainer(
+ createElement(SectionContent, { section, datasetKey: "runs/1" })
+ );
+
+ // A tooltip with nothing to say renders its children bare, so the trigger
+ // it wraps them in is what says whether the full date is on offer.
+ const cell = (text: string) =>
+ Array.from(container.querySelectorAll("span")).find(
+ (span) => span.textContent === text
+ );
+ expect(cell("12:00:00.000")?.firstElementChild).not.toBeNull();
+ expect(cell("--:--:--.---")?.firstElementChild).toBeNull();
+ // Finite, and past the last instant there is: no reading, so no tooltip.
+ expect(cell("12:00:02.000")?.firstElementChild).toBeNull();
+
+ unmount();
+ });
+
test("renders a load more action for large sections", () => {
const largeSection: Section = {
id: "section-0",
diff --git a/frontend/src/components/task-run-log/model.ts b/frontend/src/components/task-run-log/model.ts
index fc7bbd4974..72325f3d82 100644
--- a/frontend/src/components/task-run-log/model.ts
+++ b/frontend/src/components/task-run-log/model.ts
@@ -480,7 +480,7 @@ const buildDisplayItems = (
return {
key: `${idPrefix ?? "section"}-${groupIndex}-${entryIndex}`,
time: formatTime(entry.logTime),
- timeMs: entryTime,
+ timeMs: entry.logTime ? entryTime : undefined,
relativeTime: relativeMs > 0 ? formatRelativeTime(relativeMs) : "",
levelIndicator: entryHasError ? "\u2717" : "\u2713",
levelClass: entryHasError ? "text-error" : "text-success",
diff --git a/frontend/src/components/task-run-log/types.ts b/frontend/src/components/task-run-log/types.ts
index 3947d73df1..955505f6c4 100644
--- a/frontend/src/components/task-run-log/types.ts
+++ b/frontend/src/components/task-run-log/types.ts
@@ -10,8 +10,8 @@ export interface DisplayItem {
key: string;
/** Dense time-of-day; the date lives on the run header and in the tooltip. */
time: string;
- /** Backs that tooltip. 0 when the entry carries no timestamp. */
- timeMs: number;
+ /** Backs that tooltip; absent when the entry carries no timestamp. */
+ timeMs: number | undefined;
relativeTime: string;
levelIndicator: string;
levelClass: string;