Skip to content

fix(console): zh form titles space a Latin object name, the lookup create dialog has a title, the success toast names the action, money metrics keep currency decimals - #30495

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/project-thread-poei5v
Nov 5, 2026

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

domain:ui#5 · os-sales · session_01L6bhgTuQiDduLj5Xcj3KMa

Requested by Sales · project thread

Part of #30126

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 只做 Console and CLI polish from the real-user walkthrough #30126 的 items 1、2、3、7;其余条目不在本 PR。
  • item 1:zh 的「新建/编辑/查看{{object}}」在对象名是拉丁文时补一个空格(「新建 Repair Ticket」),中文名不变(「新建联系人」)。做法是 i18n.ts 里按 key 列表生效的 zh postProcessor,语言包拼法不动。
  • item 2:查找字段「新建关联记录」弹窗有了标题,复用 form.createTitle;作者写的 title 仍优先。
  • item 3:默认成功提示说出动作名(「“解决”已完成」),新 key actions.completedNamed(10 个语言包);无 label 的动作仍是通用文案。
  • item 7:无 format 的金额指标按币种自身小数位显示(CNY ¥1,293.00、JPY ¥1,293),与列表单元格一致;根因在 core 的 dataset-format.ts,MetricWidget 静态卡同规则修。
  • 门禁 35/35 exit 0,type-check 与 check:spec-symbols exit 0;五处消融各自变红;1440 宽 zh 前后截图见下。

What changes

  • item 1, zh titles space a Latin object name. ui/packages/i18n/src/i18n.ts registers an i18next post-processor that runs only for the keys in CJK_LATIN_SPACED_KEYS (form.createTitle, form.editTitle, form.viewTitle, console.ai.recordWriteCreateTitle, console.ai.recordWriteUpdateTitle) and only in zh. It pads the interpolated object value with a space on each side where a Latin letter or digit meets Han text. 新建{{object}} stays the pack spelling, so the placeholder-spelling ruling (objectui#3512) holds.
  • item 2, the lookup's create dialog has a title. useActionModal's { objectName, mode: 'create' } branch titles the form with form.createTitle and the object's label (the console's own New dialog title) when the descriptor has no title. An authored title wins; an edit form is not given one.
  • item 3, the default success toast names the action. ActionRunner.composeSuccessMessage's last rung reads the new key actions.completedNamed ({{action}} completed, zh “{{action}}”已完成) for an action with a label; an action with no label keeps actions.completedSuccessfully. The host still localizes the label before dispatch, so the toast carries the label the user saw on the button.
  • item 7, money metrics keep the currency's decimals. formatMeasure (core dataset-format.ts) no longer passes minimumFractionDigits: 0, maximumFractionDigits: 2 to a currency amount with no format, so Intl uses the currency's own minor-unit width. MetricWidget's static card with a currency and no format gets the same rule instead of whole units. An authored format pattern still states its width.
  • Changeset: patch for @object-ui/i18n, @object-ui/core, @object-ui/app-shell, @object-ui/plugin-dashboard.

Tests

  • i18n.test.ts: zh 新建/编辑/查看 + Repair Ticket is spaced; 新建维修工单 is not; a key outside the table (form.createSuccess) is not; ja and en are untouched; unit cases for spaceLatinValueFromCjk.
  • useActionModal.objectCreateTitle-30126.test.tsx (new): en Create Repair Ticket, zh 新建 Repair Ticket, authored title wins, CONTROL edit form has no create title.
  • ActionRunner.defaultSuccessToast-10900.test.ts: Resolve completed with no translator; the translator is asked for actions.completedNamed with action; an empty answer falls back to the filled English; a blank label keeps the generic line; successMessage still wins.
  • dataset-format.test.ts: CNY 1293 → ¥1,293.00, 1280.5 → ¥1,280.50, JPY ¥1,293, KWD three decimals, pattern 0,0 → ¥1,293.
  • MetricWidget.numberFormat.test.tsx: CNY ¥1,293.00 / ¥1,280.50, JPY ¥1,293, pattern 0,0 → ¥1,281.
  • Moved pins (each now reads the new behaviour): RecordFormPage.i18n.test.tsx (新建 Contacts, pack value still 新建{{object}}), the two flowDoneSuccessMessage-12274 tests (Escalate case completed), ObjectView.toolbarScriptSelection-12331 (Add to Campaign completed), and MetricWidget.numberFormat ($1,930,000.00, 1.930.000,00 €).

Acceptance notes

  • Out of scope: Console and CLI polish from the real-user walkthrough #30126 items 4, 5, 6 and 8 to 16 (server, CLI, re-measure, or held by other cards). Nothing here touches packages/**, AppHeader.tsx or RecordDetailView.
  • Mechanism deviation 1 (item 1): an i18next formatter has to be spelled inside the pack value ({{object, name}}), which breaks the placeholder-spelling gate (fallback-placeholder-spelling-3512.test.ts, the objectui#3512 / feat(spec): element:button declares the action it executes — InlineActionSchema (objectui#2997) #4135 ruling: packs use {{name}} only). A key-listed post-processor gives the same result with the pack unchanged; the seat agreed (claim amendment 2).
  • Mechanism deviation 2 (item 7): the reported readings do not come from MetricWidget.metricPatternDecimals. They come from the dataset metric path, DatasetWidget → core formatMeasure, which passed minimumFractionDigits: 0, maximumFractionDigits: 2 (code identical at the @object-ui/*@18.3.0 release commit 83d7e4a and on main). That pair is exactly what prints ¥1,280.5 for 1280.5 (the 18.3.0 report) and ¥1,293 for 1293.00 (the main report); Intl with no fraction options gives ¥1,280.50 / ¥1,293.00. Re-measured live on main (989ae42): ¥1,293 before, ¥1,293.00 after. The static MetricWidget card had the same gap in a different form (whole units, ¥1,281), fixed by the same rule. The seat added dataset-format.ts to the surface.
  • Bounded in-place widening: form.editTitle, form.viewTitle and console.ai.recordWriteUpdateTitle share the exact shape of createTitle, so they are in the key list too.
  • item 3 interpolation: completedNamedText fills the one {{action}} hole with a single String.replace for the no-translator fallback; it is not a new general interpolator (the 3512 gate's needle list is unchanged).
  • Pre-existing: eslint reports one error in MetricWidget.tsx (react-hooks "Cannot create components during render"); it is on base at line 419 too, not from this diff.
  • New i18n key actions.completedNamed in all 10 packs is the Clause-② widening; no key is removed or renamed.

Verification

  • Head 70fc02c9 (origin/main merged; merge-tree against today's main is clean).
  • node scripts/pm/dispatch-gates.mjs --commands on the changed paths: 35 derived families, all run, all exit 0; --ran reconcile: 0 NOT-MEASURED, 0 UNRUN.
  • type-check exit 0 for i18n, core, react, plugin-dashboard, app-shell (i18n and app-shell re-run after the merge). pnpm --dir ui run check:spec-symbols exit 0. check:new-line-citations: 0 new.
  • vitest on the touched packages after the merge: 100/100 files, 1508 tests passed. pnpm --dir ui exec vitest run scripts/: 170 files passed (2 skipped), 4985 tests.
  • Ablations (each reverted, git diff HEAD empty after): post-processor off → 1 failed; modal title off → 2 failed; named toast off → 3 failed; formatMeasure width back → 3 failed; MetricWidget width back → 4 failed.
Before / after, zh, 1440 wide (showcase stack, objects Repair Ticket / Repair Asset)
item before (main) after
1 新建Repair Ticket 新建 Repair Ticket
2 no heading 新建 Repair Asset
3 操作已成功完成 “Resolve”已完成
7 ¥1,293 ¥1,293.00

The screenshots live on evidence commit a21e05e and are removed by the next commit, so the diff carries no binaries.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTuQiDduLj5Xcj3KMa

…ns that read the generic line

Claude-Session: https://claude.ai/code/session_01L6bhgTuQiDduLj5Xcj3KMa
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTuQiDduLj5Xcj3KMa
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTuQiDduLj5Xcj3KMa
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · os-sales · session_01L6bhgVwQZbHRRM9CaXeKif

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 70fc02c985ebabfdb6756df72640447207f9512e
Local-runs: none

Reviewed 2026-11-05T13:34Z. Face: the Clause-②: yes (widening) declaration alone (PR body and changeset). The committed tree touches no packages/spec/src/**, no governed path, and narrows nothing.

① Derived judgments

  • @object-ui/i18n gains one key, actions.completedNamed, in all 10 locale packs, with the one hole {{action}} (the {{name}} spelling the fallback interpolator reads). No key is renamed or removed and no existing value changes. ✔
  • createI18n registers a post-processor that acts only on the five keys of CJK_LATIN_SPACED_KEYS, only for zh, and only where an interpolated value with a Latin or digit edge meets a CJK character. CJK_LATIN_SPACED_KEYS and spaceLatinValueFromCjk are exported from i18n.ts but not from the package entry (src/index.ts re-exports createI18n, getDirection, getAvailableLanguages, pickInitialLanguage and two types from it), so neither is published. createI18n's signature is unchanged. Pack spellings are unchanged, so fallback-placeholder-spelling-3512 still holds. ✔
  • @object-ui/core's exported ActionRunner.setTranslator takes RunnerTranslate, whose options are { defaultValue } & Record<string, string>. A translator typed against the old { defaultValue: string } options is still assignable, since it accepts a supertype of what it is now handed. Every existing caller type-checks, so this widens what the runner may pass and narrows nothing a caller must provide. ✔
  • formatMeasure (core) and MetricWidget (plugin-dashboard) change display output only. With no author format, a currency amount takes the currency's own minor digits. No signature changes. ✔
  • useActionModal (app-shell) titles a title-less create descriptor with the existing form.createTitle. An authored title still wins. No exported signature changes. ✔

② Semver level

  • .changeset/30126-console-copy-titles-toast-money.md: @object-ui/i18n, @object-ui/core, @object-ui/app-shell and @object-ui/plugin-dashboard patch, declared Clause-②: yes (widening) / Metadata-protocol: none. An additive key and a compatible callback widening at patch match the lane's precedent (.changeset/30326-install-result-protocol-check-skipped.md). ✔

③ Boundary flags

  • The dev raised two mechanism deviations, both ruled by the seat's claim amendment 6658174549 before the code was written: item 1 as a key-listed zh post-processor (a formatter spelling would break the 3512 placeholder rule), and item 7's root cause in core's formatMeasure.
  • Author check: the PR's user.login is objectstack-fleet[bot] (relay pr_create).

Implemented-by: session_01L6bhgTuQiDduLj5Xcj3KMa
Reviewed-by: session_01L6bhgVwQZbHRRM9CaXeKif

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · os-sales · session_01L6bhgVwQZbHRRM9CaXeKif

维护者速读

  • 改了什么: 实测发现的四处细节。
    • 中文表单标题里,没有中文名的英文对象名前面加一个空格:「新建 Repair Ticket」。有中文名的仍是「新建联系人」。
    • 查找字段里「新建被引用记录」的弹窗现在有标题,和控制台自己的新建弹窗一样。
    • 没写成功文案的操作,成功提示会带上操作名:「“解决”已完成」,不再是笼统的「操作已成功完成」。
    • 金额指标卡按币种自己的小数位显示(人民币两位,日元零位),和列表单元格一致。
  • 为什么改: Console and CLI polish from the real-user walkthrough #30126 的 items 1/2/3/7,都是真实用户走查里看到的问题。
  • 风险与回滚: 中文空格只作用于点名的五个标题键,其它文案不变。新增一个词条,10 种语言都有。没写 format 的金额显示会多出小数位,作者写了 format 的不变。回滚就是撤销本 PR。
  • 需要您做的: 无。本 PR 不在受管面,共 428 行。席位会经合并队列落地。
  • 席位意见: ACCEPT。

席位核对 — ACCEPT · domain:ui#5 · head 70fc02c985ebabfdb6756df72640447207f9512e

  • 形态: draft,作者 objectstack-fleet[bot](中继 pr_create),目标 main,Part of #30126(只做 items 1/2/3/7)。共 25 个文件,+402 −26。check-governed-merges --pr 30495:NOT governed;428 行,未超 3000。mergeable_state 读为 clean。
  • 契约面: 不碰 packages/spec/**,不碰 governed 路径。Clause-②: yes (widening):新键 actions.completedNamed(10 个语言包),以及 ActionRunner.setTranslator 可以收到更宽的 options,旧的 translator 仍可赋值。TIER_DEFAULT 合同复核 PASS 6659333290,复核的就是这个 head。
  • 裁定对照:
    • item 1 按认领修订 2(6658174549):用 i18next postProcessor,只作用于 CJK_LATIN_SPACED_KEYS 列出的五个键,只在 zh 生效。pack 拼法仍是 新建{{object}},3512 的占位符拼法测试照旧成立。RecordFormPage.i18n.test.tsx 里钉住缺陷的 '新建Contacts' 改为 '新建 Contacts',并加了一条断言:pack 本身没变。
    • item 7 按同一修订:根因在 core 的 formatMeasure。没有 format 时不再传 0–2 位的小数范围,由 Intl 按币种决定位数。MetricWidget 的静态卡用同一规则。
  • 抽查:
    • spaceLatinValueFromCjk:只在值的边缘是拉丁字母或数字、并且贴着 CJK 字符的那一侧补一个空格;已经有空格或标点的一侧不动。
    • 默认成功提示:label 去掉空白后非空才用 completedNamed,否则仍是通用文案。有 successMessage 或 outcomeMessages 时不受影响。
    • useActionModal:只在描述里没有 title、mode 为 create、并且对象定义已读到时,才补 form.createTitle。作者写的标题优先。
  • 门禁 check-runs: 70fc02c9 上 55 个 run:44 success,11 skipped,0 失败。
  • 测试: 新增 useActionModal.objectCreateTitle-30126、ActionRunner.defaultSuccessToast-10900 两个测试文件,并在 i18n、dataset-format、MetricWidget 的测试里加了用例。卡线程报告:四条在 main 上都实测复现;本地 35/35 派生门禁 exit 0,type-check 和 check:spec-symbols exit 0;18.3.0 与 main 的复测读数写在 PR 的 Acceptance notes 里。
  • 接受的偏差:
    • 认领修订已经批准的文件面之外,多改了 4 个测试文件里的旧钉子(useConsoleActionRuntime.flowDoneSuccessMessage-12274、RecordDetailView.flowDoneSuccessMessage-12274、ObjectView.toolbarScriptSelection-12331、RecordFormPage.i18n)。它们原来钉的是通用成功文案或「新建Contacts」,属于本 PR 有意改掉的行为。源码没有超出文件面,RecordDetailView 的源码没碰。
    • 认领里写的 LookupField.tsx 没有改:标题在 useActionModal 一处补上就够了。
  • 范围外去向: 无。Console and CLI polish from the real-user walkthrough #30126 的其它 items 不在本 PR。
  • 落地条款: Part of #30126。本席位按普通队列在这个 head 上落地:relay pr_ready + automerge_enable。MERGED 后在 Console and CLI polish from the real-user walkthrough #30126 写落地评论,并把卡 Release 回 pm:queue,剩余 items 原样保留。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 13:49
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 13:49
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit ea5807e Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-poei5v branch November 5, 2026 14:44
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 tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant