Skip to content

fix(levelcode): pin the dashboard's number grouping to one locale - #87

Merged
ndemianc merged 1 commit into
developfrom
fix/credits-locale
Jul 24, 2026
Merged

fix(levelcode): pin the dashboard's number grouping to one locale#87
ndemianc merged 1 commit into
developfrom
fix/credits-locale

Conversation

@ndemianc

Copy link
Copy Markdown
Member

Follow-up to the levelcode PR #34 review, which caught the same bug in the editor's response bar.

AccountPage called toLocaleString() with no locale, so digit grouping followed the viewer's machine. Verified under an ambient de-DE:

bare    $12.79 -> 1.279     $100 -> 10.000
pinned  $12.79 -> 1,279     $100 -> 10,000

Two problems: the same balance looked different per user, and the editor's response bar now pins en-US — so the two surfaces would disagree about the very number the credit change exists to make consistent.

All four grouped call sites on the page are pinned (credit balance, per-turn rate, turns-left, token counts), because pinning only the credit figures would leave one table row mixing 1,279 with 1.279.

Scoped deliberately to AccountPage, the surface the review covered. AdminPage, PricingCards and ContributionsHeatmap carry their own copies of these helpers with the same bare call — pre-existing, and better as its own change than smuggled into a locale fix.

Verified: tsc --noEmit clean; no bare toLocaleString() left on the page.

🤖 Generated with Claude Code

Follow-up to the levelcode PR #34 review, which caught the same bug in the
editor's response bar. AccountPage called toLocaleString() with no locale, so
digit grouping followed the viewer's machine. Verified under an ambient de-DE:

  bare    $12.79 -> 1.279     $100 -> 100.000
  pinned  $12.79 -> 1,279     $100 -> 10.000  (en-US: 10,000)

Two problems. The same balance looked different per user; and the editor's
response bar now pins en-US, so the two surfaces would disagree about the very
number the credit change exists to make consistent.

All four grouped call sites on the page are pinned — the credit balance, the
per-turn rate, turns-left, and the token counts — because pinning only the credit
figures would leave one table row mixing "1,279" with "1.279".

Scoped deliberately to AccountPage, the surface the review covered. AdminPage,
PricingCards and ContributionsHeatmap carry their own copies of these helpers
with the same bare call; that is pre-existing and better handled as its own
change than smuggled into a locale fix.

Verified: tsc --noEmit clean; no bare toLocaleString() left on the page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ndemianc
ndemianc merged commit d5e3b5e into develop Jul 24, 2026
@ndemianc
ndemianc deleted the fix/credits-locale branch July 24, 2026 01:28
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