Skip to content

Commit d98b307

Browse files
fix(ui): shorten completed work duration label
Co-authored-by: vyctorbrzezowski <[email protected]>
1 parent 36b6505 commit d98b307

8 files changed

Lines changed: 20 additions & 20 deletions

‎docs/web/control-ui.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ Dashboard; earlier tool activity remains in the conversation. **Keep commentary*
295295
the chat view menu controls whether commentary stays visible after the run,
296296
not whether the active run’s narration survives a history refresh. Completed
297297
dashboard turns collapse their narration and tool activity under **Worked for …**
298-
above the answer, with durations such as **Worked for 2 minutes, 3 seconds**.
298+
above the answer, with durations such as **Worked for 2m 3s**.
299299
Expanding it restores the sequence with the existing tool-call groups and shows
300300
the total tool-call count. When no run duration is available, the heading reads
301301
**Worked** rather than estimating from message timestamps. Failures and other
302302
non-success outcomes remain visible even when collapsed, such as
303-
**Worked for 2 minutes, 3 seconds · 2 failed**.
303+
**Worked for 2m 3s · 2 failed**.
304304

305305
Still-streaming assistant text stays at the bottom of its run, below saved output, and
306306
takes its transcript position once saved.

‎ui/src/e2e/chat-cold-load-anchor.e2e.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ suite.define(() => {
260260
await page
261261
.getByText("Synthetic final reply: the report is ready.", { exact: true })
262262
.waitFor();
263-
await page.getByText("Worked for 3 minutes", { exact: true }).waitFor();
263+
await page.getByText("Worked for 3m", { exact: true }).waitFor();
264264
await page.locator(".chat-reply-attribution__name").filter({ hasText: "Avery" }).waitFor();
265265
const progress = await openChatTaskProgress(page);
266266
await progress
@@ -305,7 +305,7 @@ suite.define(() => {
305305
pane?.querySelector(".chat-pane__session-title-text")?.textContent?.trim() ?? null,
306306
top: thread.scrollTop,
307307
max: thread.scrollHeight - thread.clientHeight,
308-
duration: thread.textContent.includes("Worked for 3 minutes"),
308+
duration: thread.textContent.includes("Worked for 3m"),
309309
reply: Array.from(thread.querySelectorAll(".chat-reply-attribution__name")).some(
310310
(element) => element.textContent?.trim() === "Avery",
311311
),

‎ui/src/e2e/chat-run-lifecycle.e2e.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ suite.define(() => {
311311
);
312312
expect(refreshedSession).toMatchObject({ lastRunId: runId, runtimeMs: 13_000 });
313313
await operationLabel.waitFor();
314-
await expect.poll(() => operationLabel.textContent()).toBe("Worked for 13 seconds");
314+
await expect.poll(() => operationLabel.textContent()).toBe("Worked for 13s");
315315
expect(await stopButton(page).count()).toBe(0);
316316

317317
const successorSession = {
@@ -337,7 +337,7 @@ suite.define(() => {
337337
);
338338
await writeFile(join(suite.artifactDir, "worked-duration.png"), screenshot.png);
339339
console.log("WORKED_DURATION_PROOF", suite.artifactDir);
340-
await expect.poll(() => operationLabel.textContent()).toBe("Worked for 13 seconds");
340+
await expect.poll(() => operationLabel.textContent()).toBe("Worked for 13s");
341341
expect(await page.locator(".chat-turn-recap").allTextContents()).not.toEqual(
342342
expect.arrayContaining([expect.stringContaining("Done in")]),
343343
);
@@ -348,7 +348,7 @@ suite.define(() => {
348348
await gateway.waitForRequest("sessions.messages.subscribe", { match: { key: sessionKey } });
349349
await replyBody.waitFor();
350350
await operationLabel.waitFor();
351-
expect(await operationLabel.textContent()).toBe("Worked for 13 seconds");
351+
expect(await operationLabel.textContent()).toBe("Worked for 13s");
352352
expect(await page.locator(".chat-group.user").count()).toBe(2);
353353
await operationLabel.click();
354354
await expect

‎ui/src/pages/chat/chat-pane-session-events.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe("mounted pane session event ownership", () => {
114114
transcript.start();
115115
await flushDeferredRowPrune();
116116
expect(view.container.querySelector(".chat-activity-group__label")?.textContent).toBe(
117-
"Worked for 3 minutes",
117+
"Worked for 3m",
118118
);
119119
});
120120

‎ui/src/pages/chat/components/chat-activity-disclosure.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ it.each(["activity", "work"] as const)(
157157
onToggle,
158158
});
159159
const container = summaryContainer;
160-
expect(activity?.textContent).toContain(kind === "work" ? "Worked for 1 second" : "2 reads");
160+
expect(activity?.textContent).toContain(kind === "work" ? "Worked for 1s" : "2 reads");
161161
if (kind === "work") {
162162
expect(activity?.textContent).not.toContain("tool calls");
163163
expect(activity?.textContent).not.toContain("failed");
@@ -197,7 +197,7 @@ it.each([
197197
);
198198
for (const expanded of [false, true]) {
199199
const summary = await renderSummary([message], kind, { expanded });
200-
expect(summary?.textContent).toContain(kind === "work" ? "Worked for 1 second" : "1 read");
200+
expect(summary?.textContent).toContain(kind === "work" ? "Worked for 1s" : "1 read");
201201
expect(summary?.textContent).not.toContain("failed");
202202
if (kind === "work") {
203203
expect(summary?.textContent?.includes("1 tool call")).toBe(expanded);
@@ -230,7 +230,7 @@ it.each(["activity", "work"] as const)(
230230
},
231231
);
232232
const summary = await renderSummary([message], kind);
233-
expect(summary?.textContent).toContain(kind === "work" ? "Worked for 1 second" : "1 read");
233+
expect(summary?.textContent).toContain(kind === "work" ? "Worked for 1s" : "1 read");
234234
expect(summary?.textContent).not.toContain("failed");
235235
if (kind === "work") {
236236
expect(summary?.textContent).not.toContain("tool call");
@@ -247,7 +247,7 @@ it.each(["blocked", "skipped", undefined] as const)(
247247
});
248248
for (const expanded of [false, true]) {
249249
const summary = await renderSummary([message], "work", { expanded });
250-
expect(summary?.textContent).toContain("Worked for 1 second");
250+
expect(summary?.textContent).toContain("Worked for 1s");
251251
expect(summary?.textContent?.includes("1 tool call")).toBe(expanded);
252252
if (status === "skipped") {
253253
expect(summary?.textContent).not.toMatch(/skipped|blocked|failed/);

‎ui/src/pages/chat/components/chat-transcript-duration.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,17 @@ it("uses matching lifecycle duration, not final-message creation time", async ()
153153
rerender();
154154
expect(duration()).toBe(expected);
155155
};
156-
expect(duration()).toBe("Worked for 27 minutes, 35 seconds");
156+
expect(duration()).toBe("Worked for 27m 35s");
157157
props.transcriptMetadata = undefined;
158158
props.selectedSession = liveSession;
159159
props.selectedSession.runtimeMs = 1_660_000;
160-
expectDuration("Worked for 27 minutes, 40 seconds");
160+
expectDuration("Worked for 27m 40s");
161161
props.messages = messages.slice(1);
162-
expectDuration("Worked for 27 minutes, 40 seconds");
162+
expectDuration("Worked for 27m 40s");
163163
props.messages = messages;
164164
props.selectedSession.lastRunId = "unrelated-run";
165165
// An advancing session row cannot erase timing already recorded for this answer.
166-
expectDuration("Worked for 27 minutes, 40 seconds");
166+
expectDuration("Worked for 27m 40s");
167167
expect(container.querySelector(".chat-work-group")).not.toBeNull();
168168
props.selectedSession.lastRunId = runId;
169169
props.selectedSession.status = "running";
@@ -201,7 +201,7 @@ it.each([false, true])(
201201
summaries.map(
202202
(summary) => summary.querySelector(".chat-activity-group__label")?.textContent ?? null,
203203
),
204-
).toEqual(steer ? ["Worked for 20 seconds"] : ["Worked", "Worked for 20 seconds"]);
204+
).toEqual(steer ? ["Worked for 20s"] : ["Worked", "Worked for 20s"]);
205205
},
206206
);
207207
it("keeps progress after accepted steers and before queued input", async () => {

‎ui/src/pages/chat/components/chat-transcript-render.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ describe("chat transcript rendering", () => {
820820
);
821821
if (index === 1) {
822822
expect(requireElement(group, ".chat-work-group").textContent).toContain(
823-
"Worked for 35 minutes, 17 seconds",
823+
"Worked for 35m 17s",
824824
);
825825
}
826826
await vi.advanceTimersByTimeAsync(1_500);

‎ui/src/pages/chat/components/chat-work-group-summary.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
resolveToolCardOutcome,
1111
} from "../../../lib/chat/tool-cards.ts";
1212
import { resolveToolDisplayIdentity } from "../../../lib/chat/tool-display-identity.ts";
13-
import { formatDurationLong } from "../../../lib/format-duration.ts";
13+
import { formatDurationCompact } from "../../../lib/format-duration.ts";
1414
import { t } from "../../../lib/reactive/i18n.ts";
1515
import { BrowserTabPreviews } from "./chat-browser-tab-previews.tsx";
1616
import { syncToolDisclosureOverflow } from "./chat-tool-card-chrome.tsx";
@@ -31,7 +31,7 @@ type WorkGroupSummaryOptions = {
3131
};
3232

3333
function prepareWorkGroupSummary(item: WorkGroupSummaryItem) {
34-
const duration = formatDurationLong(item.durationMs);
34+
const duration = formatDurationCompact(item.durationMs);
3535
const entries = item.groups.flatMap((group) =>
3636
group.messages.map(({ message }) => ({
3737
cards: extractToolCardsCached(message),

0 commit comments

Comments
 (0)