Skip to content

fix(plugin-grid): the bulk confirm sentence formats numbers and dates in the display locale - #26358

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-26307-bulk-confirm-locale
Oct 27, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-26307-bulk-confirm-locale

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #26307

Clause-②: no
Metadata-protocol: none

What changed

A bulk action's confirm sentence formatted its numbers and dates in en-US for every viewer, while the same action's single-record confirm formats them in the viewer's language since PR #26282. BulkActionDialog called bulkConfirmText(def.confirmText, { count, params, values, lookupLabels }) with no locale, so fillTemplateHoles fell back to en-US.

  • ui/packages/plugin-grid/src/components/BulkActionDialog.tsx: reads useDisplayLocale() from @object-ui/i18n, the same hook the console's action runners install (useActionRunnerDisplayLocale in ui/packages/react/src/context/actionRunnerTranslator.ts), and passes it to bulkConfirmText.
  • ui/packages/plugin-grid/src/components/bulkConfirmText.ts: bulkConfirmText(confirmText, scope, locale?) hands locale to fillTemplateHoles's third parameter, the locale channel apart from the template roots, so a param named locale stays a value the sentence prints. No second locale resolution: with no locale handed, the engine keeps en-US.
  • scripts/sdui-manifest.sources/plugin-grid.json: re-recorded with node scripts/gen-sdui-manifest-node.mjs under the verify lock, on the tree after merging origin/main (PR refactor(plugin-grid): move ObjectGrid's module-level helpers into sibling modules (slice 1) #26323 had moved the same record; main's record was taken at the merge, then re-recorded). Only plugin-grid's sources digest moved; the artefact did not (manifestSha256 unchanged). node scripts/check-sdui-manifest.mjs: exit 0.
  • .changeset/26307-bulk-confirm-locale.md: @object-ui/plugin-grid patch.

Red first

New pin ui/packages/plugin-grid/src/__tests__/bulkConfirmLocale-26307.test.tsx: the helper over de-DE and zh-CN, and the real BulkActionDialog under a real I18nProvider + LocalizationProvider. Expected strings are computed with Intl in the test, so a newer ICU cannot drift them.

Red leg: the two source files restored to a70aa00b (the unfixed base versions) in the working tree only, at head 64e9dbc5, under the verify lock:

× formats a currency, a number and a date hole in a German display locale
    Expected: "Set 1.234.567,50 € on 2 records?"   Received: "Set €1,234,567.50 on 2 records?"
× formats a date hole in a Chinese display locale
    Expected: "Due 2026年10月26日?"                 Received: "Due October 26, 2026?"
× formats a currency hole in the tenant display locale   (BulkActionDialog)
    Expected: "Set the amount to 1.234.567,50 € on 2 records?"   Received: "Set the amount to €1,234,567.50 on 2 records?"
Tests  3 failed | 2 passed (5)

The two passing cases are the en-US ones (no locale handed; no tenant locale under an English UI), which hold before and after. Restored from HEAD (blob hashes compared, git diff HEAD empty), green leg: Tests 5 passed (5).

Tests and gates

  • Pin, at head 64e9dbc5: red 3 failed / 2 passed, then green 5 / 5 (above).
  • Full plugin-grid suite, pnpm exec vitest run packages/plugin-grid --maxWorkers=2 from ui/, under the lock at e42274e0 (the merge; same sources as 64e9dbc5, which changes only the pin's matcher): 251 of 252 files, 2251 of 2252 tests passed. The one failure was this pin's dialog case matching with findByText, whose normaliser turns the no-break space Intl writes before a de-DE € into a plain space in the node text but not in the matcher string; 64e9dbc5 reads the dialog description's textContent instead, and the pin is 5 / 5 at that head.
  • @object-ui/plugin-grid type-check (tsc --noEmit && tsc -p tsconfig.test.json): exit 0 at e42274e0.
  • node scripts/check-sdui-manifest.mjs: exit 0 at e42274e0 after the re-record.
  • Derived gates (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, head 64e9dbc5): 45 derived; 44 run, each exit 0; pnpm check:type-check-debt exit 3 (PREREQUISITE NOT MET: it was queued on the shared verify lock for its closure build), so NOT MEASURED locally, and CI's Lint & Repo Gates runs it. --ran reconciliation: "45 derived famil(ies) accounted for — 44 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)", 0 UNRUN.
  • The derivation warned that the tree is 5 commits behind origin/main (3 gate scripts changed across that range). Main was merged once before opening, as required; it is not merged again unless a conflict, a main-caused red or a queue removal calls for it.

Acceptance notes

  • useDisplayLocale() with no providers mounted resolves en, so every existing bulk dialog suite (rendered without providers) keeps its en-US sentences; the full plugin-grid run above confirms it.

Generated by Claude Code

The bulk confirm sentence formats its numbers and dates in en-US for
every viewer. This pin is red until BulkActionDialog passes the display
locale through bulkConfirmText to fillTemplateHoles.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
…cale

BulkActionDialog reads useDisplayLocale(), the locale the console's
action runners already install, and passes it through bulkConfirmText to
fillTemplateHoles's locale parameter. The bulk confirm sentence's
currency, number and date holes render in the viewer's locale instead of
en-US. No second locale resolution: absent, the engine keeps en-US.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
node scripts/gen-sdui-manifest-node.mjs on the fixed tree; the artefact
did not move (manifestSha256 unchanged), only plugin-grid's sources
digest. node scripts/check-sdui-manifest.mjs exit 0.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
…lk-confirm-locale

# Conflicts:
#	scripts/sdui-manifest.sources/plugin-grid.json
After merging origin/main (main's record taken at the merge), node
scripts/gen-sdui-manifest-node.mjs re-recorded plugin-grid alone; the
artefact did not move. node scripts/check-sdui-manifest.mjs exit 0.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
findByText normalises the no-break space Intl writes before a de-DE
currency sign in the node text but not in the matcher string, so the
right German sentence did not match. Read the dialog description's
textContent instead.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling labels Oct 26, 2026
…lk-confirm-locale

# Conflicts:
#	scripts/sdui-manifest.sources/plugin-grid.json
Merged origin/main (main's record taken at the merge); node
scripts/gen-sdui-manifest-node.mjs re-recorded plugin-grid alone, the
artefact did not move. node scripts/check-sdui-manifest.mjs exit 0.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

维护者速读

改了什么:批量操作的确认句(带 currency、number、date 格式化的模板洞)现在按查看者的显示语言格式化数字、金额和日期;德语用户看到 1.234.567,50 €,不再是 €1,234,567.50。
为什么改:同一个操作的单条确认自 #26282 起已按查看者语言显示,批量确认却仍对所有人用 en-US;#26282 当时把这一半留给了 #26217,而后者合并时没带上。
风险与回滚:只多传一个参数,读的是控制台已有的同一个 useDisplayLocale(),不新增语言判定;没有语言信息时仍是 en-US,原有英文句子不变。回滚 = revert 本 PR。
先看:ui/packages/plugin-grid/src/components/BulkActionDialog.tsx(风险 hunk:确认步 bulkConfirmText(…, displayLocale) 一行)→ ui/packages/plugin-grid/src/components/bulkConfirmText.ts(第三参数直传 fillTemplateHoles)→ ui/packages/plugin-grid/src/__tests__/bulkConfirmLocale-26307.test.tsx。
两分钟验证:在 ui/ 下 pnpm exec vitest run packages/plugin-grid/src/__tests__/bulkConfirmLocale-26307.test.tsx,预期 Tests 5 passed (5)。
需要你做的:无,席位落地。
席位意见:ACCEPT。一个参数、一处调用,补的是 #26282 留下的批量那一半;两轮补丁只为跟上 plugin-grid 记录。

席位核对

seat 2 · 2026-10-27T00:06Z · head 661393e6 (#26307)

item reading
form 5 files, +158/−3: BulkActionDialog.tsx reads useDisplayLocale() and passes it to bulkConfirmText, which takes an optional third locale argument straight to fillTemplateHoles's locale channel; new 5-case pin bulkConfirmLocale-26307; sources/plugin-grid.json; root .changeset/ patch on plugin-grid
premise measured the console's action runners already read the same hook (useActionRunnerDisplayLocale, #26282); no second locale resolution, absent ⇒ en-US as before
gates (check-runs on 661393e6) 61 runs: 54 success, 7 skipped, 0 failed. Local: red 3/5 at base (de-DE currency, zh-CN date, real dialog de-DE), green 5/5; plugin-grid 252 files / 2252 tests; plugin-grid type-check exit 0; check-sdui-manifest exit 0; 44 of 45 derived gates exit 0, check:type-check-debt NOT MEASURED locally (CI's Lint & Repo Gates green)
accepted deviations none
out of scope none
landing NOT governed (check-governed-merges --pr 26358: 161 lines, no hit path); git merge-tree against origin/main clean; no main change to plugin-grid or its record since a47d3696 (#26354 merged in). Next on plugin-grid: #26341 (#25884)

Merged via the queue into main with commit 6390fe5 Oct 27, 2026
62 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-26307-bulk-confirm-locale branch October 27, 2026 00:20
os-tesla pushed a commit that referenced this pull request Oct 27, 2026
Main re-recorded six registry packages under scripts/sdui-manifest.sources/
(#26274, #26358) while the manifest's bytes stayed the same: six
modify/delete conflicts against this PR's deletion of those records,
resolved by deleting them.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6SEitNngAMugGbuJHWsDS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling

Projects

None yet

2 participants