fix(levelcode): pin the dashboard's number grouping to one locale - #87
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the levelcode PR #34 review, which caught the same bug in the editor's response bar.
AccountPagecalledtoLocaleString()with no locale, so digit grouping followed the viewer's machine. Verified under an ambientde-DE: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,279with1.279.Scoped deliberately to
AccountPage, the surface the review covered.AdminPage,PricingCardsandContributionsHeatmapcarry 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 --noEmitclean; no baretoLocaleString()left on the page.🤖 Generated with Claude Code