Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(plugin-grid): format every column-summary arm in the tenant locale - #9326

Merged
os-tesla merged 1 commit into
mainfrom
claude/issue-9294-summary-footer-locale
Sep 13, 2026
Merged

os-tesla merged 1 commit into
mainfrom
claude/issue-9294-summary-footer-locale

Conversation

@os-tesla

Copy link
Copy Markdown
Collaborator

Fixes #9294

formatSummaryLabel in packages/plugin-grid/src/useColumnSummary.ts handed Intl no locale argument at seven call sites. 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 useDisplayLocale'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)

# site before after
1 percent-of-rows toLocaleString(undefined, {maximumFractionDigits: 1}) toLocaleString(displayLocale, …)
2 count / non-numeric toLocaleString() toLocaleString(displayLocale)
3 currency, explicit code new Intl.NumberFormat(undefined, …) new Intl.NumberFormat(displayLocale, …)
4 currency, no code resolved new Intl.NumberFormat(undefined, …) new Intl.NumberFormat(displayLocale, …)
5 currency, constructor threw toLocaleString() toLocaleString(displayLocale)
6 avg toLocaleString(undefined, {maximumFractionDigits: 2}) toLocaleString(displayLocale, …)
7 numeric default toLocaleString() toLocaleString(displayLocale)

The colType === 'percent' arm is untouched — objectui#9269 landed it via PR objectui#9293, and it is this PR's control.

displayLocale also becomes a required, non-optional string (the two parameters ahead of it are respelled T | undefined so 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 to useDisplayLocale, 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.5 in a EUR column through @object-ui/fields' formatCurrency / formatNumber against the options each arm passes today:

case today (options preserved) via the shared formatter
currency, column scale: 2 €1,234.50 €1,234.50 — agrees
currency, column scale: 0 €1,235 €1,234.50 — declared scale discarded
currency, whole amount, scale: 2 €1,235.00 €1,235 — wholeness switch drops the fraction
plain / avg 1,234.5 1,234.50 at width 2, 1,235 at width 0 — no width reproduces today's

formatNumber sets both fraction bounds from one decimals argument, so there is no value that reproduces the avg arm's maximumFractionDigits: 2 with no minimum. Every one of those moves also fires in en, 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 edit packages/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-DE and tr-TR readings differ from the en one. 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.

en rows are not controls: this container's machine locale is en-US, measured to render every fixture in the file identically to en. They are overshoot detectors. de-DE and tr-TR are the rows that move.

Directions, predicted in writing before the first run — and what ran

predicted observed on the base tree
lit control (percent column) GREEN GREEN (2 passed under a name-filtered run)
movement, the seven sites RED RED (14)
agreement at en GREEN GREEN (7)
agreement at de-DE / tr-TR RED RED (14)
tr-TR currency, absolute bytes RED RED (1)
prefix probes GREEN GREEN (8)

Base 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 the HEAD blob) and restored under a trap.

Tests 5 failed | 44 passed (49) — and the five are exactly:

  • currency-explicit-code movement @ de-DE, @ tr-TR
  • currency-explicit-code agreement @ de-DE, @ tr-TR
  • the tr-TR absolute-byte row

Every 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 HEAD empty, git status --porcelain empty, and the restored blob hash byte-identical to HEAD's.

Blast radius

A package-scoped run is not the blast radius, so rendered strings were swept repo-wide:

  • Footer-shaped literals (Sum:/Avg:/Count:/Filled: followed by a digit or currency sign) appear outside packages/plugin-grid only in CHANGELOG.md files — historical release notes, not assertions.
  • No test outside packages/plugin-grid asserts on a summary label. The two hits for grid.summary. / useColumnSummary elsewhere (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-catalog carries 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-check script — 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: minor with a **BREAKING** carrier. major is 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: formatImportJobTime in packages/plugin-grid/src/ImportWizard.tsx renders an import-job timestamp through a bare toLocaleString(), 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 own open_issues_count of 464, controls lit both ways) — objectui#7174, objectui#8209 and objectui#8507 all miss it.


Generated by Claude Code

`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
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 52 chunks) 3116.3 KB 3134.8 KB
Main entry chunk (gzip) 144.3 KB 350 KB
Entry file index-oYnabybC.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.69KB 6.21KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 502.06KB 115.19KB
core (index.js) 8.52KB 3.41KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 211.58KB 58.68KB
fields (index.js) 247.91KB 62.51KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.21KB 2.26KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 32.15KB 10.49KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.84KB 10.95KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.39KB 3.10KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 14.81KB 3.63KB
plugin-calendar (index.js) 49.04KB 13.93KB
plugin-charts (index.js) 71.52KB 19.98KB
plugin-chatbot (index.js) 195.35KB 46.52KB
plugin-dashboard (index.js) 131.24KB 34.61KB
plugin-designer (index.js) 215.95KB 44.33KB
plugin-detail (index.js) 253.51KB 65.88KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 136.79KB 34.19KB
plugin-gantt (index.js) 166.95KB 41.04KB
plugin-grid (index.js) 211.58KB 57.48KB
plugin-kanban (index.js) 46.00KB 14.30KB
plugin-list (index.js) 112.59KB 27.66KB
plugin-map (index.js) 20.43KB 6.81KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.42KB 11.93KB
plugin-timeline (index.js) 30.07KB 8.74KB
plugin-tree (index.js) 9.55KB 3.32KB
plugin-view (index.js) 84.43KB 20.80KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 94.03KB 31.02KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.66KB 2.50KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 14.82KB 4.99KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 14.27KB 5.47KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copy link
Copy Markdown
Collaborator Author

Contract review — PR objectui#9326 @ head 8e920d69b · ✅ CLEARED

domain:ui PM seat (os-tesla), R33. Review of record names this 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 decimals value reproducing today's maximumFractionDigits: 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

@os-tesla
os-tesla marked this pull request as ready for review September 13, 2026 01:08
@os-tesla
os-tesla added this pull request to the merge queue Sep 13, 2026
Merged via the queue into main with commit 8e67cc4 Sep 13, 2026
38 checks passed
@os-tesla
os-tesla deleted the claude/issue-9294-summary-footer-locale branch September 13, 2026 01:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

2 participants