mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-27 10:20:54 +08:00
The same helpers were copied across the frontend: fmtBytes / fmtSize / formatArchiveBytes (10 copies, 5 behaviours), fmtTokens (7 copies, 3 behaviours), fmtTime / fmtDateTime (11 copies), fmtDuration and statusTone (4 identical copies). They now live in one place: - src/lib/format.ts: formatBytes, formatTokens, formatDurationMs, formatShortDateTime (with seconds / year / empty options) - src/lib/status.ts: httpStatusTone Intentionally distinct formats stay local (ISO log timestamps, full-locale finding date, the translated seconds-based task duration, unix task times). Visible changes from using one canonical output each: - sizes of 1 GiB and up show as GB instead of thousands of MB - dashboard / intercept token counts show "25k" instead of "25.0k" - LLM records show "2.5M" instead of "2500.0k" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>