Repository navigation
fix(platform): format product list prices in the reader's locale - #4205
Conversation
The products list's Price cell called formatCurrency without a locale, so it fell back to the default `en` and showed `€1,234.56` to a French or German reader while the product details showed `1 234,56 €`. The table config factory now hands its column builders the active locale and recomputes the columns when it changes, as the documents table config does, and the Price cell passes it on. Closes #3619
|
Independent review of PR #4205 at
Runtime (mine)
Verified from source
Follow-ups (none block)
CI: at 01:55Z the exact head had 16 of 21 checks still queued, including Lint, Type check and UI, with none failed. I'll merge only once every check is terminal and acceptable at this exact head, squashing with |
TALE-525 reconciliation — ACCEPT record reused; no new merge authorizationPR #4205 head is still Already done: reading TALE-164 and the latest TALE-359 discussion revealed that agent #2 had already independently accepted this exact head in record 5975581548, before this task was dispatched. TALE-359 coordination comment Source corroboration completed before reconciliation: the factory passes the shared Merge-order check: #4207 at My attempted proof (not green): targeted jsdom invocation for the seven products/contacts/websites table/config suites and product details control, one worker, 2 GiB Node heap. Initial launch lacked CI read 02:09Z: 36 visible checks: 6 passed, 24 queued/pending, 6 skipped, 0 failed. This includes newly visible build checks and supersedes the earlier 21-check snapshot; pending is not green. No CI rerun or cancellation. Unrun: browser/layout/visual gate, E2E, stack, containers, HTTP/request/readback, full suites, lint/format/typecheck in this review run. Light-only restriction honored; display-only source reviewed, no live UI/readback claim. Disk preflight had 262 GiB free, above the 20 GiB floor. Shared checkout unchanged; no commit, push, merge or card move. Deliverables in TALE-525 delivery box: this record, attempted-test log, exact-head CI JSON, check summary JSON, merge-order output and planning note. The generated source snapshot is removed after inspection; no other task's files are altered. |
What changed
The products list formatted every Price in English, whatever the reader's language. The product details dialog got it right. For 1234.56 EUR, a French reader saw
€1,234.56in the list and1 234,56 €in the details.use-products-table-config.tsxcalledformatCurrency(price, currency)with no locale, so it fell back to the defaulten. The column builder couldn't do better:createTableConfigHookgave builders translations but not the active locale, and a column builder can't call a hook.createTableConfigHooknow readsuseLocale()and passeslocaleto its column builders.localeis also in the column memo's dependencies, so the columns are rebuilt when the language changes. This is how the hand-built documents table config already reads the locale. The Price cell passeslocaletoformatCurrency, the same call the details dialog makes. The details dialog itself is untouched; it stays the control.tests/manual/reference/automation.mdhas a new row recording that the spec owns this behaviour.The change is display-only. No request, response, contract or stored value changes; the price is read and saved exactly as before.
How I verified it
price columncases inproducts-table.test.tsxrender the realProductsTableunder the realAppShelllocale/i18n providers. Each case reads the row's Price cell, clicks the row to open the real details dialog, and compares the two. Onmain(6524150fe):PRODUCT_PRICE_LOCALEobservation. The details dialog (the control) and theen-UScase passed both before and after the fix.product-view-dialog.test.tsx). Result:Test Files 7 passed (7) · Tests 37 passed (37)withvitest.ui.config.ts(jsdom).oxlint --type-awareon the changed files is clean, andoxfmt --checkpasses.bun run lint:manualis ok (5 trees, 1442 boxes).tscover the changed files, the three factory consumers, the router registration and the ambient types passed with exit 0 (6,178 files). I did not run the whole-platformtsclocally; the Type check job runs it.Sweep
<span>, so nothing changes for assistive technology.Intlfor the active locale in both places (fr-FR1 234,56 €, de-DE1.234,56 €, en-US€1,234.56).docs/en/platform/knowledge/structured-data.mdsays the list shows the price but doesn't specify a format.locale.Not covered
app/features/settings/audit-logs/components/activity-log-view.tsximports the plainformatNumberand calls it without a locale (lines 67, 192, 196). That issue gets its own change, so this PR doesn't touch it.Closes #3619