Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

fix(web): the Trace overview's Elapsed shows the total, breakdown on hover (#676)

Yaowei Zheng1b0d2142335f
diff --git a/changelog/unreleased/2026-09-10-trace-elapsed-total.md b/changelog/unreleased/2026-09-10-trace-elapsed-total.md
new file mode 100644
index 00000000..f915ca00
--- /dev/null
+++ b/changelog/unreleased/2026-09-10-trace-elapsed-total.md
@@ -0,0 +1,14 @@
+# The Trace overview shows the elapsed total, with its breakdown on hover
+
+- **Date:** 2026-09-10
+- **Type:** fix
+- **Scope:** `web`
+- **PR:** [#676](https://github.com/Prism-Shadow/penguin-harness/pull/676)
+
+[中文版](2026-09-10-trace-elapsed-total.zh.md)
+
+A Trace file's overall summary printed the elapsed total and its API / tool breakdown on the same
+line, so the row carried three durations at rest. Elapsed now shows the total on its own and keeps
+the breakdown in its hover text — the reading the per-round chip beside it already gave, so both
+surfaces word it the same way. A reader with no hover is not left without it: the row carries the
+breakdown beside the total as visually hidden text, which a screen reader reads out in place.
diff --git a/changelog/unreleased/2026-09-10-trace-elapsed-total.zh.md b/changelog/unreleased/2026-09-10-trace-elapsed-total.zh.md
new file mode 100644
index 00000000..6752f658
--- /dev/null
+++ b/changelog/unreleased/2026-09-10-trace-elapsed-total.zh.md
@@ -0,0 +1,12 @@
+# Trace 全局统计的用时只显示总计,明细移到悬停
+
+- **Date:** 2026-09-10
+- **Type:** fix
+- **Scope:** `web`
+- **PR:** [#676](https://github.com/Prism-Shadow/penguin-harness/pull/676)
+
+[English](2026-09-10-trace-elapsed-total.md)
+
+Trace 文件的全局统计此前把用时总计与 API/工具明细印在同一行,静止状态下一行就摆着三个时长。「用时」现在
+只显示总计,明细留在悬停文本里——这正是旁边逐轮统计一直以来的读法,两处措辞由此一致。无从悬停的读者也不会
+因此读不到它:该行在总计旁带着一段视觉隐藏的明细文本,屏幕阅读器就地读出。
diff --git a/packages/web/src/features/traces/trace-file-view.tsx b/packages/web/src/features/traces/trace-file-view.tsx
index 61a81490..dec10097 100644
--- a/packages/web/src/features/traces/trace-file-view.tsx
+++ b/packages/web/src/features/traces/trace-file-view.tsx
@@ -109,12 +109,25 @@ const rowKeyOf = (taskIndex: number, i: number): string => `${taskIndex}-${i}`;
* Each item takes its own row, with three groups arranged side by side as
* columns — laid out horizontally it would read as a blur of digits, while
* giving each group a full row would waste the right half of the space.
+ *
+ * `detail` is the breakdown behind the value: the row shows the total alone and keeps the
+ * breakdown in its hover text, the same way the per-round chips do. A reader with no hover
+ * gets it from `sr-only` text rather than from an `aria-label`: this row is a bare `div`,
+ * whose role is `generic`, and ARIA prohibits naming that role — a label here would be
+ * dropped, while hidden text is read in place, right after the value it belongs to (the
+ * same way an update hint is folded into a button elsewhere in the app). An empty detail
+ * renders neither: a tooltip repeating only the visible label says nothing.
*/
-function SummaryRow({ label, value }: { label: string; value: string }) {
+function SummaryRow({ label, value, detail }: { label: string; value: string; detail?: string }) {
+ const hasDetail = detail !== undefined && detail !== "";
return (
- <div className="flex items-baseline justify-between gap-3 py-0.5">
+ <div
+ title={hasDetail ? `${label}${detail}` : undefined}
+ className="flex items-baseline justify-between gap-3 py-0.5"
+ >
<span className="shrink-0 text-[11px] text-gray-400">{label}</span>
<span className="truncate font-mono text-sm font-semibold tabular-nums">{value}</span>
+ {hasDetail && <span className="sr-only">{detail}</span>}
</div>
);
}
@@ -476,10 +489,8 @@ export function TraceFileView({
/>
<SummaryRow
label={S.chat.statElapsed}
- value={`${humanizeDuration(Math.max(0, globalMs))}${durationSplit(
- analysis.apiMs,
- analysis.toolMs,
- )}`}
+ value={humanizeDuration(Math.max(0, globalMs))}
+ detail={durationSplit(analysis.apiMs, analysis.toolMs)}
/>
{/* Global TPS = the output of every round (including compaction
rounds) ÷ the sum of LLM generation time, same scope as the