| author | |
| committer | |
| log | 62e74cdd9a0aa4df5fc612d94193da9610129dc9 |
| tree | dca6429a8b5ae50ed7e1847e50a0cf5a7865017c |
| parent | df370c31d26afc72ace55263e746ba4386dada25 |
| signature | Signed by PGP key B5690EEEBB952194 |
3 files changed, 2 insertions(+), 18 deletions(-)
apps/web/src/session-logic.ts+1-1| ... | ... | @@ -35,7 +35,7 @@ import { |
| 35 | 35 | type TurnDiffSummary, |
| 36 | 36 | } from "./types"; |
| 37 | 37 | |
| 38 | export { formatDuration, formatElapsed } from "@t3tools/shared/orchestrationTiming"; | |
| 38 | export { formatDuration } from "@t3tools/shared/orchestrationTiming"; | |
| 39 | 39 | |
| 40 | 40 | export type WorkLogToolLifecycleStatus = |
| 41 | 41 | | "inProgress" |
packages/shared/src/orchestrationTiming.test.ts+1-7| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | 2 | |
| 3 | import { formatDuration, formatElapsed } from "./orchestrationTiming.ts"; | |
| 3 | import { formatDuration } from "./orchestrationTiming.ts"; | |
| 4 | 4 | |
| 5 | 5 | describe("formatDuration", () => { |
| 6 | 6 | it.each([ |
| ... | ... | @@ -29,9 +29,3 @@ describe("formatDuration", () => { |
| 29 | 29 | expect(formatDuration(durationMs)).toBe("0ms"); |
| 30 | 30 | }); |
| 31 | 31 | }); |
| 32 | ||
| 33 | describe("formatElapsed", () => { | |
| 34 | it("formats a long run across midnight", () => { | |
| 35 | expect(formatElapsed("2026-09-03T22:00:00Z", "2026-09-04T04:59:50Z")).toBe("6h 59m 50s"); | |
| 36 | }); | |
| 37 | }); |
packages/shared/src/orchestrationTiming.ts-10| ... | ... | @@ -28,16 +28,6 @@ export function formatDuration(durationMs: number): string { |
| 28 | 28 | return parts.join(" "); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | export function formatElapsed(startIso: string, endIso: string | undefined): string | null { | |
| 32 | if (!endIso) return null; | |
| 33 | const startedAt = Date.parse(startIso); | |
| 34 | const endedAt = Date.parse(endIso); | |
| 35 | if (Number.isNaN(startedAt) || Number.isNaN(endedAt) || endedAt < startedAt) { | |
| 36 | return null; | |
| 37 | } | |
| 38 | return formatDuration(endedAt - startedAt); | |
| 39 | } | |
| 40 | ||
| 41 | 31 | export function isLatestTurnSettled( |
| 42 | 32 | latestTurn: LatestTurnTiming | null, |
| 43 | 33 | session: SessionActivityState | null, |