The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 00:45 UTC
fix(shared): show zero seconds in minute durations (#33994)
Yash Singh committed
Nov 10, 2026 at 11:51 UTC
08af12da49f1ce9e08a076635321ffbed0e517a4
3 files changed
+17
-3
apps/mobile/src/features/threads/subagent-card-presentation.test.ts
+1
-1
@@ -22,7 +22,7 @@ describe("subagent card", () => {
22
expect(subagentCardElapsed([unfinished], DateTime.toEpochMillis(later))).toBeNull();
23
expect(
24
subagentCardElapsed([{ ...unfinished, status: "running" }], DateTime.toEpochMillis(later)),
25
- ).toBe("2m");
25
+ ).toBe("2m 0s");
26
expect(
27
subagentCardElapsed([{ ...unfinished, status: "idle" }], DateTime.toEpochMillis(later)),
28
).toBeNull();
packages/shared/src/orchestrationTiming.test.ts
+15
-1
@@ -1,6 +1,20 @@
1
import { describe, expect, it } from "vite-plus/test";
2
3
-import { deriveSubagentElapsedMs } from "./orchestrationTiming.ts";
3
+import { deriveSubagentElapsedMs, formatDuration } from "./orchestrationTiming.ts";
4
+
5
+describe("formatDuration", () => {
6
+ it.each([
7
+ [59_000, "59s"],
8
+ [59_500, "1m 0s"],
9
+ [60_000, "1m 0s"],
10
+ [720_000, "12m 0s"],
11
+ [736_000, "12m 16s"],
12
+ [3_600_000, "1h"],
13
+ [3_660_000, "1h 1m 0s"],
14
+ ])("formats %i milliseconds as %s", (durationMs, expected) => {
15
+ expect(formatDuration(durationMs)).toBe(expected);
16
+ });
17
+});
18
19
describe("deriveSubagentElapsedMs", () => {
20
const startedAt = "2026-09-21T12:00:00.000Z";
packages/shared/src/orchestrationTiming.ts
+1
-1
@@ -32,6 +32,6 @@ export function formatDuration(durationMs: number): string {
32
const parts: string[] = [];
33
if (hours > 0) parts.push(`${hours}h`);
34
if (minutes > 0) parts.push(`${minutes}m`);
35
- if (seconds > 0) parts.push(`${seconds}s`);
35
+ if (seconds > 0 || minutes > 0) parts.push(`${seconds}s`);
36
return parts.join(" ");
37
}