Contexto
unit (linux) is currently red on dev (confirmed on the latest dev commit, e.g. run https://github.com/alltomatos/opencode/actions/runs/34911995346/job/104201311221, and on the two runs before it) and blocks every PR's CI, including #234.
Bug
formatMinutes() in packages/app/src/pages/stats/stats-controller.ts calls mins.toLocaleString() with no locale argument, so it silently uses the CI runner's/browser's default locale. Every other numeric/date formatter in the stats page (numFmt, compactFmt, the session-time formatter) explicitly passes language.intl() — formatMinutes is the one outlier.
Its unit test (stats-controller.test.ts) hardcodes the pt-BR-style output ("60.327 min", period as thousands separator) that this fork's default locale produces locally, but GitHub's ubuntu-latest runners default to a locale that renders it as "60,327 min" — so the test (and therefore unit (linux)) fails there regardless of which PR triggers it.
Fix
formatMinutes(ms, locale?) now accepts and forwards an explicit locale, matching the other formatters in this file.
stats.tsx's three call sites now pass language.intl().
- The unit test now pins
"pt-BR" explicitly instead of relying on whatever locale the process happens to default to, so it's deterministic on any runner.
Contexto
unit (linux)is currently red ondev(confirmed on the latestdevcommit, e.g. run https://github.com/alltomatos/opencode/actions/runs/34911995346/job/104201311221, and on the two runs before it) and blocks every PR's CI, including #234.Bug
formatMinutes()inpackages/app/src/pages/stats/stats-controller.tscallsmins.toLocaleString()with no locale argument, so it silently uses the CI runner's/browser's default locale. Every other numeric/date formatter in the stats page (numFmt,compactFmt, the session-time formatter) explicitly passeslanguage.intl()—formatMinutesis the one outlier.Its unit test (
stats-controller.test.ts) hardcodes the pt-BR-style output ("60.327 min", period as thousands separator) that this fork's default locale produces locally, but GitHub'subuntu-latestrunners default to a locale that renders it as"60,327 min"— so the test (and thereforeunit (linux)) fails there regardless of which PR triggers it.Fix
formatMinutes(ms, locale?)now accepts and forwards an explicit locale, matching the other formatters in this file.stats.tsx's three call sites now passlanguage.intl()."pt-BR"explicitly instead of relying on whatever locale the process happens to default to, so it's deterministic on any runner.