Skip to content

console: the create/edit form's section tab strip ignores _sections translations that the detail page applies #5408

Closed as not planned

Description

@yinlianghui

The record create/edit form groups fields into sections and renders them as a
tab strip. That strip displays the untranslated section labels in every
locale — even when the bundle carries a complete _sections block that the
detail page for the same object resolves correctly.

Observed (17.0.0-rc.2, HotCRM)

New Case form: tab strip reads Case • / SLA / Resolution in all four locales.
The same object's _sections translations exist and work elsewhere — the case
detail page renders 工单信息 / 状态与SLA under zh-CN from
objects.crm_case._sections.*. So this is not a missing key or an incomplete
bundle: the form renderer simply never consults _sections for its tab strip,
while the detail-page renderer does.

(As of objectstack-ai/hotcrm#697 all four HotCRM locales carry all 85 declared
section headings, so any locale is now a ready-made reproduction: every
translated heading appears on the detail page and stays English on the form
tabs.)

Why this is distinct from neighbouring issues

Expected: the form section tab strip resolves headings through the same
_sections lookup the detail page uses (objects.<o>._sections.<key>.label,
falling back to the authored label).

Downstream: objectstack-ai/hotcrm#683 (part 1).

Activity

  1. self-assigned this
    on Aug 5, 2026
  2. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    认领:objectui 分片 PM 循环第 1 轮扩批(batch 3→5,维护者提速指令)
    会话:session_01GTRjn8xBqp75dk7kFupVRt
    分支:claude/issue-5408-form-section-tabs-i18n(代码落地 objectui 仓,按 repo:objectui 路由)
    Worktree:objectui-issue-5408
    域:objectui 分片(plugin-form)
    文件面:packages/plugin-form/src/(ObjectForm/TabbedForm/ModalForm 的 section→tab 标签路径)+ 只读复用 packages/i18n 的 _sections 解析工具(detail 页同款,不改其行为)+ 相应测试 + .changeset/*.md(越界即停,报告说明)

    前提核验(origin/main @ 68b6a28):_sections 读取方在 packages/i18n/src/utils/spec-translations.ts / useObjectLabel.ts 与 plugin-detail;packages/plugin-form 全包零 _sections 命中,tabbed 路径(ObjectForm.tsx:209、TabbedForm.tsx:410)直接用 authored label —— issue 断言成立:渲染两半只接了 detail 一半。


    Generated by Claude Code

  3. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    PM 复核:前提证伪,按重分诊结论关闭(objectui 分片 PM session_01GTRjn8xBqp75dk7kFupVRt;dev 返回 premise_still_valid: false,证据已逐条核实)。

    证伪要点(objectui origin/main @ 68b6a28,file:line 证据):表单 section 标签早已走 detail 页同款解析器 —— ObjectForm.tsx:165-167(五个 form-type 分支)、:966-968(stacked divider)、ModalForm.tsx:588/:684,调的都是 detail 页 record-details.tsx:199 的同一个 useObjectLabel().sectionLabel(objectName, section.name, authored)。实测 zh-CN bundle 带 _sections 时 tab strip 渲染译文。渲染器两半没有分岔。我派发词里「plugin-form 零 _sections 命中」是字面 grep 的坑(解析在 @object-ui/i18n 内部),该错误归 PM,公开更正于此。

    你观察到的症状是真的,成因在元数据侧:_sections 按 section 的 name 建索引,而 HotCRM crm_case 的 form view 三个 section 只有 label 没有 name(Case/SLA/Resolution,正是那条 strip);detail 页 section 带 name(info/status/description)所以出译文。量化:hotcrm @ 0899b4f 全部 14 个 view 文件 70/70 个 form section 无 name —— 结构上永远无法被任何翻译键命中,且 schema/lint/覆盖率(含 #5405 落地后)三处都不告警。

    去向(三件事,各有其锚):

    1. 平台守卫缺口 → lint: a form section with a label but no name can never be translated and nothing warns — 70/70 HotCRM form sections are in that state #5417(lint:label-without-name 告警;domain:devx + pm:queue,Blocked-by cli: the i18n coverage walker never collects objects.<o>._sections — a bundle can ship every section heading in English and lint zero warnings #5405)—— 这是防复发的那一半;
    2. hotcrm 元数据修复 → hotcrm#683(给 form section 补 name,至少 crm_case 三处与 zh-CN _sections 既有键对齐;该仓不在本会话范围,请维护者侧推进);
    3. 渲染器护栏 → objectui PR fix(spec): enforce ViewFilterRule operator enum with legacy-alias normalization #3373(6 条 pin 钉住 form 侧 _sections 解析与 detail parity —— 此前该行为零测试覆盖,谁改坏都不会红;已验收,Refs 本单不关闭本单)。

    维护者如认为诊断有误可直接重开。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions