Skip to content

fix(ui): format figures with the pinned en-US locale everywhere - #5059

Merged
swati510 merged 1 commit into
mainfrom
fix/ui-pin-number-locale
Nov 1, 2026
Merged

swati510 merged 1 commit into
mainfrom
fix/ui-pin-number-locale

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

What

Bare Number#toLocaleString() formats with the runtime's locale, so a server in one locale and a browser in another produced different digit grouping (for example 1,261,599 vs 12,61,599), and hydration failed.

How

  • Every bare .toLocaleString() on a number in packages/ui and packages/web now goes through the existing formatNumber, which is pinned to en-US.
  • Nullable sites keep undefined.
  • Untyped chat tool counts fall back to String(value).

Based on #5058.

Verification

  • ui and web tsc --noEmit: clean.
  • ui vitest: 3052 tests passing.
  • New test forces an en-IN locale and checks that the overview health line and owner labels keep en-US grouping.

@repowise-bot

repowise-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Worth a look: 1 thing to check below.

  1. 5 files that usually change with this PR's files are not in it: packages/ui/src/refactoring/plan-detail.tsx changed in 15 of the 18 commits that touched packages/ui/src/refactoring/types.ts; packages/ui/src/graph/graph-toolbar.tsx changed in 13 of the 17 commits that touched packages/ui/src/graph/graph-legend.tsx; packages/web/src/app/repos/[id]/refactoring/page.tsx changed in 12 of the 16 commits that touched packages/ui/src/refactoring/refactoring-board.tsx (+2 more)

✅ Health of changed files: 7.1 (unchanged) Average full file score (structure and history) of 112 changed code files, weighted by size before this PR; not the repository score.


View on Repowise
Plain markdown for agents · Reviews (5) · Last reviewed commit: fix(ui): format figures with the pinned en-US locale everywhere

Settings and updates

Silence one PR with [skip repowise] in the title · Bot settings
/repowise recheck reviews the current head again
/repowise review deep runs the deep review on it
/repowise remember <text> tells the reviewer what to leave out next time (reply on a finding to scope it to that file)
/repowise help lists the commands
⭐ Star Repowise · 📥 Install on another repo

@RaghavChamadiya
RaghavChamadiya force-pushed the fix/ui-pin-number-locale branch 2 times, most recently from 0b0e0d1 to edaf7cb Compare October 30, 2026 20:27
Base automatically changed from fix/ui-hydration-stable-time to main October 31, 2026 03:24
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/ui-pin-number-locale branch from edaf7cb to 8f5e187 Compare November 1, 2026 10:54
A bare number .toLocaleString() formats in the runtime's locale, so a
server render and a browser in en-IN disagree on any figure above 99,999
(1,261,599 vs 12,61,599). That mismatch fails hydration and React throws
away the server HTML. formatNumber is already pinned to en-US; route every
bare number .toLocaleString() in ui and web through it.
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/ui-pin-number-locale branch from 8f5e187 to cf7ce43 Compare November 1, 2026 15:01
@swati510
swati510 merged commit 54e33ef into main Nov 1, 2026
11 of 14 checks passed
@swati510
swati510 deleted the fix/ui-pin-number-locale branch November 1, 2026 15:12
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.

2 participants