Repository navigation
fix(plugin-grid): format every column-summary arm in the tenant locale - #9326
Conversation
`formatSummaryLabel` handed `Intl` no locale argument at seven call sites: the currency arm's two branches and its constructor-threw fallback, the average arm, the plain numeric default, the percent-of-rows arm and the count/non-numeric arm. An omitted or `undefined` locale is not "no opinion" -- it is the MACHINE's locale, which is neither of this renderer's two channels, and it is the one thing `useDisplayLocale`'s doc comment tells callers not to do. All seven now take the concrete BCP-47 tag that hook resolves, so the footer and the cells above it read under one convention. `displayLocale` becomes a required non-optional `string`: under the optional spelling it replaces, dropping the argument type-checks and renders a plausible number rather than an error, which is the same failure shape one layer up. Only the locale tag moves. Every arm keeps its formatter and fraction-digit widths, so the column's declared `scale` and the percent-of-rows literal sign stay where the number-display policy owns them. Routing the arms through the shared `formatCurrency` / `formatNumber` was measured and rejected: it discards the declared `scale`, drops a whole amount's fraction digits, pins the plain and average arms to a fixed width, and moves `en` output too. The pin reads ROWS, not cells: it asserts each arm's output changes when the tenant locale changes, with the already-repaired percent column as the lit control that proves the fixture moves the locale at all. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract review — PR objectui#9326 @ head
|
| check | reading |
|---|---|
CI at 8e920d69b |
36/36 settled — 0 failing, 0 pending |
--pair 9326 |
✓ both carriers agree |
| ⭐ all seven sites carry a concrete locale | ✓ enumerated: :330 :333 :346 :352 :361 :396 :398 |
| the lit control | ✓ :394 formatPercent(value, decimals, displayLocale) — objectui#9269's landing, untouched |
| ⛔ percent arm untouched | ✓ |
| ⛔ objectui#4589 policy ownership untouched | ✓ |
| No-Touch zone | ✓ not touched |
⭐⭐ You closed the defect CLASS, not the instance — and that is the best decision in the PR
displayLocale is now a required, non-optional string, with the two parameters ahead of it respelled T | undefined purely so it can be mandatory. The comment at the site carries the argument:
Under the
displayLocale?:it replaces, dropping the argument type-checks and the result renders as a plausible number rather than as an error — the same failure shape as the omitted locale this card repaired, one layer up, and the reason that defect was invisible in review for as long as it was.
⇒ the omission that caused this card can no longer type-check at this function. ⛔ An eighth call site cannot be added wrong. That is rule 45 — close a class by derivation, not by a list — and it is the difference between this card being fixed and this card being finished.
⭐ And ⛔ no ?? 'en' backstop, with the right reason: that would be a renderer-side default papering over an absent channel (Commandment #0.1). The concrete fallback belongs to useDisplayLocale, which already owns it. A seat that added the backstop would have passed every test and re-created the defect one layer down.
⭐⭐ Route B was MEASURED and then rejected — which is what triage asked for and what usually does not happen
Triage said: if you take the shared-formatter route, measure first. You measured, and the rejection is specific rather than hand-wavy — routing through formatCurrency / formatNumber:
- discards the column's declared scale (a scale-0 column goes
1,235→1,234.50); - fires a wholeness switch that drops a whole amount's fraction digits (
1,235.00→1,235); - pins the plain / avg arms to a fixed width, with no
decimalsvalue reproducing today'smaximumFractionDigits: 2-with-no-minimum.
⭐ And the clinching observation: every one of those moves also fires in en — which a locale repair must not do. They also land on objectui#4589's policy and would edit packages/fields, which PR objectui#9310 holds open. ⇒ route A, with reasons, not preference.
⭐ The lit control was read POSITIVELY, not inferred from absence
-t 'already-repaired percent column moves' on the base tree → Tests 2 passed | 47 skipped. ⇒ the fixture really moves the tenant locale, so every other row is a reading rather than NOT MEASURED. ⛔ Most seats assert the control implicitly by "the suite ran"; isolating it is what makes the other 29 reds mean something.
Base: 29 failed | 20 passed (49), matching the partition predicted in writing in the file header. After: 128 files / 1182 tests passed.
Ablation: the currency explicit-code branch back to undefined, landing proved on disk (anchor-with-tag 1→0, anchor-with-undefined 0→1, blob 0bd7e87d → 4324bcf7) ⇒ 5 failed | 44 passed, and the five are exactly that site's movement and agreement rows at de-DE/tr-TR plus the tr-TR absolute-byte row — every other arm and the lit control stayed green. ⇒ site-specific, not blanket. Restore proved by state: empty git diff HEAD, empty git status --porcelain, blob back to 0bd7e87d.
⭐ The type-check ran the dependent closure, and the exclusion this lane paid for was checked rather than assumed
Membership read first: 7 direct / 8 transitive dependents, all declaring a type-check script — including @object-ui/site, a DIRECT dependent. Filter direction confirmed with turbo --dry=json (9 packages selected) before trusting it. Tasks: 45 successful, 45 total, 0 error TS lines. ⇒ the lesson from PR objectui#9310's red landed in the very next seat.
The lint narrowing is declared with all three pieces
Population from eslint's own config (165 files), the package's own CI command, and invariance established by reading the config rather than assuming — no projectService / parserOptions.project, and ⭐ none of the 23 local rules in eslint-rules/ does cross-file I/O (no readFileSync/readdirSync/globSync/execSync). ⇒ this diff cannot move an untouched file's verdict, measured rather than asserted.
⭐ And the NBSP audit is the kind of care this family needs: the de-DE currency rendering carries U+00A0, so it is described in words and never written literally, and the absolute-byte assertion uses tr-TR, which is plain.
objectui#9327, filed with a complete dedup
formatImportJobTime in ImportWizard.tsx renders through a bare toLocaleString() — same machine-locale channel, on a DATE, where the failure is field ORDER (03/04/2026 reads as two different days) rather than a separator. ⭐ Deduped against the fully enumerated open set (464 rows reconciled against the repository's own open_issues_count of 464), controls lit both ways, and the bodies of #7174 / #8209 / #8507 each read directly. ⇒ different failure mode, same contract, correctly its own card.
Changeset
minor with a **BREAKING** carrier. Right level: rendered output moves in every session whose browser locale differs from the tenant's. ⛔ major unavailable by construction.
Carriers
Cleared in one stroke on both limbs — PR objectui#9326 and card objectui#9294 — each read back.
Generated by Claude Code
Fixes #9294
formatSummaryLabelinpackages/plugin-grid/src/useColumnSummary.tshandedIntlno locale argument at seven call sites. An omitted orundefinedlocale is not "no opinion" — it is the MACHINE's locale, which is neither of this renderer's two channels, anduseDisplayLocale's own doc comment names it as the one thing a caller must not do. All seven now take the concrete BCP-47 tag that hook resolves.Triage counted seven call sites where the card says "four arms" — one arm has several branches. Both counts are right about different things; this covers seven.
The seven, re-derived on this branch's own base (
c64975e9f)toLocaleString(undefined, {maximumFractionDigits: 1})toLocaleString(displayLocale, …)toLocaleString()toLocaleString(displayLocale)new Intl.NumberFormat(undefined, …)new Intl.NumberFormat(displayLocale, …)new Intl.NumberFormat(undefined, …)new Intl.NumberFormat(displayLocale, …)toLocaleString()toLocaleString(displayLocale)toLocaleString(undefined, {maximumFractionDigits: 2})toLocaleString(displayLocale, …)toLocaleString()toLocaleString(displayLocale)The
colType === 'percent'arm is untouched — objectui#9269 landed it via PR objectui#9293, and it is this PR's control.displayLocalealso becomes a required, non-optionalstring(the two parameters ahead of it are respelledT | undefinedso it can be mandatory). Under the optional spelling it replaces, dropping the argument type-checks and renders a plausible number rather than an error — the same failure shape as the omitted locale itself, one layer up. The function is module-private with a single call site, so nothing outside pays for it. Deliberately no??backstop: the concrete fallback belongs touseDisplayLocale, and a renderer-side default papering over an absent channel is what Commandment #0.1 forbids.Route taken: thread the tag — and the other route was measured, not assumed
Triage left the route open and required the shared-formatter route be measured first. It was measured, and rejected. Rendering
1234.5in aEURcolumn through@object-ui/fields'formatCurrency/formatNumberagainst the options each arm passes today:scale: 2€1,234.50€1,234.50— agreesscale: 0€1,235€1,234.50— declaredscalediscardedscale: 2€1,235.00€1,235— wholeness switch drops the fraction1,234.51,234.50at width 2,1,235at width 0 — no width reproduces today'sformatNumbersets both fraction bounds from onedecimalsargument, so there is no value that reproduces the avg arm'smaximumFractionDigits: 2with no minimum. Every one of those moves also fires inen, which a locale repair must not do — and all of them land on objectui#4589's number-display policy, which this card is fenced away from. That route would also editpackages/fields, which PR objectui#9310 currently holds open.⇒ Route A: only the locale tag moves. Every arm keeps its formatter and its fraction-digit widths.
The pin reads ROWS, not cells
packages/plugin-grid/src/__tests__/useColumnSummary.tenantLocale-9294.test.tsx, written before the code so the "unmodified" arm was the real base tree.The defect is not "this cell renders the wrong bytes" — it is "this cell does not move at all when the tenant locale moves". So the headline table names no bytes: for every arm it asserts only that the
de-DEandtr-TRreadings differ from theenone. A second table then computes its right-hand side from the tag under test, so a repair that threaded some varying locale — the one thing a movement assertion cannot see — still fails. Neither table is sufficient alone.The lit control. The already-repaired percent column moves on the unmodified base tree, which is what qualifies it: a control that cannot fire proves nothing. Its cases run first and say in their own names that if the control is flat, the fixture is inert and every other row is NOT MEASURED rather than a negative answer.
enrows are not controls: this container's machine locale isen-US, measured to render every fixture in the file identically toen. They are overshoot detectors.de-DEandtr-TRare the rows that move.Directions, predicted in writing before the first run — and what ran
ende-DE/tr-TRBase tree:
Tests 29 failed | 20 passed (49)— exactly the predicted partition.After the fix, the whole package:
Test Files 128 passed (128) · Tests 1182 passed (1182).Ablation leg
One call site (the currency explicit-code branch) put back to
undefined, from the committed tree, with the mutation proved on disk before the run (injected token +1, removed token -1, blob hash moved off theHEADblob) and restored under a trap.Tests 5 failed | 44 passed (49)— and the five are exactly:de-DE, @tr-TRde-DE, @tr-TREvery other arm and the lit control stayed green, so the pin is site-specific rather than a blanket assertion. Restore verified by state, not by exit code:
git diff HEADempty,git status --porcelainempty, and the restored blob hash byte-identical toHEAD's.Blast radius
A package-scoped run is not the blast radius, so rendered strings were swept repo-wide:
Sum:/Avg:/Count:/Filled:followed by a digit or currency sign) appear outsidepackages/plugin-gridonly inCHANGELOG.mdfiles — historical release notes, not assertions.packages/plugin-gridasserts on a summary label. The two hits forgrid.summary./useColumnSummaryelsewhere (packages/i18n/src/__tests__/untranslated-identity-4376.test.ts,packages/types/src/zod/objectql.zod.ts) are a bundle-key description and a prose comment.e2e/has no match for the summary footer at all.examples/schema-catalogcarries summary schemas but pins no rendered figure.Type-check was run over the dependent closure, not the package: a membership read found 7 direct dependents, 8 transitively, and every one of them declares a
type-checkscript — including@object-ui/site, which is a direct dependent and is exactly the exclusion that went red in this lane recently. It is in the run, not out of it.Changeset
@object-ui/plugin-grid: minorwith a**BREAKING**carrier.majoris unavailable: this package sits in the fixed group whose major tracks@objectstack's. Rendered output moves in every session whose browser locale differs from the tenant's — the normal case for a German tenant staffed on English systems, or the reverse — not only in the sessions that were wrong; the changeset says so with the measured table.Acceptance notes
Boundaries held: the
colType === 'percent'arm is untouched, and objectui#4589's number-display policy ownership is untouched (widths, formatter choice and the percent-of-rows literal sign all stay where they are).One out-of-scope observation, filed separately rather than folded in:
formatImportJobTimeinpackages/plugin-grid/src/ImportWizard.tsxrenders an import-job timestamp through a baretoLocaleString(), i.e. the same machine-locale channel, on a date rather than a number. Deduped against the fully enumerated open set (464 rows reconciled against the repository's ownopen_issues_countof 464, controls lit both ways) — objectui#7174, objectui#8209 and objectui#8507 all miss it.Generated by Claude Code