Skip to content

crm_lead 有三套互不相同的字段分组(fieldGroups 10 / 详情页 5 / 表单 6),详情页的 Details 标签页够不到 notes、重复管理与沟通偏好 #806

Description

@yinlianghui

Restart-when: node -p "require('@objectstack/console/package.json').version" in this repo prints a version above 17.4.0 (the first console build whose objectui pin contains objectui PR #8584, merge 81a51db)
Restart-probe: re-check by ABLATION, never by version arithmetic — rewrite lead_detail_page's record:details sections to bare { group: 'FIELDGROUP_KEY' } entries in dist/objectstack.json, boot, open a crm_lead record. Control leg: the same node mutated to the enumerated fields form must render, or the rig is broken rather than the platform.

来源:#792(PR #804)实施过程中的顺带发现。#792 让我把 leads 的「记录存储的内容」表按 fieldGroups 重写、并把「9 个区块」改成实际数量;改成 10 之前先核了一遍这句话的主语,发现它在 crm_lead 上任何数字都不成立。文档那一句已在 PR #804 里改掉(不再说「详情界面有 N 个可折叠区块」),剩下的是元数据侧的问题,故单独立单。基线 origin/main = 131daf9。

事实:三套分组

声明处 分组数 分组名
src/objects/lead.object.ts:17-28 fieldGroups 10 Identity / Company Information / Contact Information / Qualification / Assignment / Address / Additional Info / Communication Preferences / Conversion / Duplicate Management
src/pages/lead_detail.page.ts:147-178(type: 'record', object: 'crm_lead')的 record:details 5 Lead Information / Contact / Lead Detail / Address / Description
src/views/lead.view.ts:197 起的 form.sections(均 collapsible: true) 6 Contact Information / Lead Classification / Company Information / Address / Additional Information / Privacy

crm_lead 是文档化对象里唯一自带记录页的:crm_account / crm_contact 等没有 record:details 覆盖,详情页按对象的 fieldGroups 渲染,所以「区块表 = 详情页可折叠区块」这条文档约定在别处成立、只在 leads 上断了。

影响(元数据侧,不只是文档)

lead_detail.page.ts 的 Details 标签页只列了 18 个字段中的一部分,下面这些在详情页上够不到:

  • notes(Notes,richtext 工作备注)——description 有独立分区,notes 没有;
  • duplicate_of_type / duplicate_of_lead / duplicate_of_contact / duplicate_status——Duplicate management: soft lead dedupe instead of the hard unique email constraint #598 的整套重复管理。疑似重复线索视图把人带到记录上之后,记录页上看不到它疑似重复了谁、也看不到重复状态,只能进编辑表单(lead.view.ts 的 DUPLICATE_LINK_FIELDS)才看得到;
  • do_not_call / email_opt_out——正要打电话的人在详情页上看不到「禁止致电」;
  • is_converted / converted_*——转化结果只在字段组里有,详情页没有分区承载。

next_followup_date 与 last_contacted_date 同样不在 Details 分区里,而 🔥 Hot Leads 视图正是按前者排序的。

对照 #715(crm_campaign_member 的字段组被高亮条吃掉、组在详情页永不渲染,lint field-group-shadowed 报出来的那条):这里是相反方向的同一类问题——页面自带分区,于是对象的字段组在详情页整体失效,而 lint 目前不报。

可能的处理方向(需要决定,别直接猜)

  1. 让 lead_detail.page.ts 的分区回到对象的 fieldGroups(删掉 properties.sections,让详情页按字段组渲染)——恢复全仓一致的约定,代价是失去这页手工编排的取舍。
  2. 保留手工编排,但补齐缺失字段(至少重复管理 + 沟通偏好 + notes)——保留编排意图,但每加一个字段就要手工同步一次,正是本类漂移的来源。
  3. 认定「详情页只放常用字段」是有意的,那就该有 lint 或测试把「哪些字段组在详情页上无处可去」暴露出来([17.0-rc2验收] crm_campaign_member 的 "Basic Information" 字段组四字段全部被提升进详情页高亮条 —— 组在详情页永不渲染(lint field-group-shadowed) #715 的 field-group-shadowed 的镜像规则),并在文档里写明详情页是取舍过的。

三条对「AI 写的元数据要难写错」这条的取向不同:方案 1 让声明处唯一,方案 3 让偏离可被检出,方案 2 两者都不给。建议先在 1 与 3 之间定调。

⛔ 本单只记录,未改任何 src/**。文档侧的那半句已随 PR #804 修好,不必重复改。

Refs #715 #792 #598


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    metadataDeclarative metadata — schema, security posture, UI surfaces

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions