Skip to content

Spell out the live turn stats instead of 3F +2.8K/-2.7K - #772

Open
gongcavalry wants to merge 1 commit into
xintaofei:mainfrom
gongcavalry:fix/live-turn-stats-plain-language
Open

gongcavalry wants to merge 1 commit into
xintaofei:mainfrom
gongcavalry:fix/live-turn-stats-plain-language

Conversation

@gongcavalry

Copy link
Copy Markdown
Contributor

Before / after

before   生成中 | 18 分钟 | 3F +2.8K/-2.7K | 0.2 tok/s
after    生成中 | 18 分钟 | 改了 3 个文件 · 新增 2751 行、删除 2744 行 | 0.2 token/秒

Why

The status line under a running turn is the only place that answers "what is this agent doing to my files right now", and every part of it currently costs a decoding step:

  • F — files, but nothing on screen says so;
  • + / - — line direction, with no unit;
  • compact notation — 2751 becomes 2.8K.

That third one is the real loss. The single comparison worth making at a glance is whether additions and deletions nearly cancel, because that is the signature of a whole-file rewrite rather than a targeted edit — and rounding both sides to 2.8K / 2.7K is exactly what hides it. The old format destroyed the most actionable signal in the widget while making the reader work for the rest.

Change

live-turn-stats.tsx now renders full sentences from i18n instead of concatenating bare symbols, and the same sentence is repeated as a hover hint (title) and carried by an aria-label on the icon, matching how ComposerContextUsage already names its gauge.

Line counts use a plain Intl.NumberFormat instead of the compact one. Two helpers became dead once nothing compacted numbers any more — formatCompactInt and compactNumberFormatter — so they are removed rather than left to rot.

Locale: five new keys (filesChanged, linesChanged, editStatsAria, editStatsTooltip, outputSpeedValue) in all ten files. English, German, French, Spanish and Portuguese use ICU plurals; CJK and Arabic stay flat.

Tests

Check Result
pnpm test (vitest, full) 6608 passed / 453 files
live-turn-stats.test.tsx 6 passed
pnpm lint (eslint) clean
pnpm build + tauri build --bundles app both succeed; 3F + no longer appears anywhere in the bundle

No existing assertion depended on the old 3F / tok/s strings, so no test was edited.

Notes

Independent of #771 — different component, different concern. This branch is based on current main (a425e41) and touches neither file that PR changes.


中文说明:这一条纯粹是可读性。原来 3F +2.8K/-2744 里每一段都要先翻译一遍才懂,而其中唯一值得扫一眼就看出的信号——新增和删除行数是否接近抵消(这是「整文件重写」而非「精准小改」的特征)——恰好被 compact 取整抹掉了。改成完整句子并按真实数字显示后,这个信号一眼就能看到。

The status line under a running turn read `3F +2.8K/-2.7K`. Every part of
it cost a decoding step: `F` for files, `+`/`-` for line direction, and
the compact notation rounding both sides toward the same figure. That last
one is the problem — the single comparison worth making at a glance is
whether additions and deletions nearly cancel, which is how you spot a
whole-file rewrite, and the formatting was the first thing to destroy it.

Now reads `改了 3 个文件 · 新增 2751 行、删除 2744 行` and `0.2 token/秒`,
with the same sentence as a hover hint. Line counts are formatted in full
rather than compacted; the two helpers left unused by that change
(`formatCompactInt`, `compactNumberFormatter`) are removed.

Locale: five new keys in all ten files. English, German, French, Spanish
and Portuguese use ICU plurals; CJK and Arabic stay flat.

Tests: vitest 6608 passed / 453 files; eslint clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant