fix(views): write the measured related-list mechanism to source (#944) - #957
Merged
Merged
Conversation
`src/views/event_attendee.view.ts` justified its grid and form with a mechanism it stated as fact — "the related list renders THIS view's columns, and the quick-create modal renders THIS form … for the same reason `crm_campaign_member` has them" — and it was this repo's only written account of that rendering path. `crm_campaign_member` ships no view metadata at all, so the cited precedent was a counter-example. Measured against the shipped Console (17.0.0-rc.3), the mechanism is the wrong half. A detail-page related list takes its columns from the child's lookup field (`relatedListColumns`, authored nowhere here), then falls back to the child object's `highlightFields` minus the lookup the panel is scoped by, capped at six, with all-empty columns dropped; only with neither does it reach a heuristic over the field map — never the child's list view, and never declaration order. The form half is real: the Console merges a view bundle's `form` onto the object definition and the record drawer renders its sections, but the no-form fallback already drops autonumber/formula/summary fields in create mode and sections the rest by `fieldGroups`, so the raw autonumber was never on offer. The campaign detail page's member panel is therefore not degraded: it renders Lead / Contact / Status / Response Date off `crm_campaign_member.highlightFields`, and a member view would not have changed one column of it. No metadata changes — the artifact is byte-identical (14 views, 1921.4 KB). `test/view-references.test.ts` pins what is load-bearing for every object reached only through a parent (the two junctions, the two line items): `highlightFields` must exist, resolve, and survive dropping the panel's own scope field. Refs #944.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
yinlianghui
marked this pull request as ready for review
August 6, 2026 13:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #944
结论:二选一里错的是注释,不是缺元数据
issue 说得对——
event_attendee.view.ts:10拿crm_campaign_member当「已成立的先例」,而后者全仓零 view,两者必有一错。按派发的 measure-first 裁定先测,结果是注释所述的机制本身就不成立,于是走修法 B:改注释、不补 view。三项测量
① 文档承诺(三语一致)。
content/docs/marketing/campaign-members.mdx(及.zh-Hans/.zh-Hant第 85-92 行)在《Standard list views》一节向读者承诺:营销活动详情页的 Members 选项卡上有 All Members / Responded / Bounced-Unsubscribed / Converted to Opportunity 四个标准列表视图。这四个视图在元数据里一个都没有——而且下面的测量说明,即便补上最小 grid,它们也不会出现在那个面板上。该缺口与本单修法无关,已另行留档(见文末)。② 注释自述的机制,逐句对着 17.0.0-rc.3 的 Console 产物测。 两句断言各有下场:
relatedListColumns(本仓一处都没写),其次退到子对象的highlightFields去掉该面板的作用域字段,上限 6 列,并丢弃在所有已取行上都为空的列;只有两者皆无才落到字段表启发式(name 类字段靠前、审计列靠后,rich_text/html/json排除)。从头到尾不读子对象的 list view,也不是「按声明顺序渲染全部字段」。form合并到它持有的对象定义上,关联列表的 New / 行编辑抽屉渲染其sections;而没有 form 时抽屉也不裸:create 模式下它先丢掉autonumber/formula/summary(以及 hidden / readonly)字段,再按对象自己的fieldGroups分节。attendee_number从来没被端上来过。③ dist 产物现状。 基线
pnpm build产出 14 个 view,crm_campaign_member无任何 view 声明(crm_event_attendee有,记录形如{ list, form })。由此推出的影响判定(与 issue 正文相反)
crm_campaign_member声明了highlightFields: ['crm_campaign', 'crm_lead', 'crm_contact', 'status', 'response_date'],面板会去掉自己的作用域字段crm_campaign,所以营销活动详情页的成员关联列表今天渲染的是 Lead / Contact / Status / Response Date——是策展过的,不是退化态。补一个 grid view 一列都改变不了。快速新建弹窗同理:autonumber 已被 create 模式剔除,分节走fieldGroups。也就是说,修法 A(补
CampaignMemberViews)在关联列表这一半没有任何可测的业务拉力,唯一真实的一半(form 分节)今天由对象自己的fieldGroups承担且结果合理;把 grid 补进来只会多出一块「声明了但没人渲染」的表面——正是这条错注释已经制造过一次的那类误导。按仓库的 startup-focus 取舍,不建。本 PR 改了什么
src/views/event_attendee.view.ts:重写文件头注释,把上面测到的两条路径写进源码(哪一半 live、哪一半不读、无 view 时的真实回退),并明确crm_campaign_member不是反例而是「不需要」的证据。注释改动,零元数据变更。test/view-references.test.ts:新增守卫,钉住真正承重的东西。派生集合 = 只能经父记录抵达的crm_对象(持有指向crm_的 required lookup 且无导航项)= 两个 junction + 两个 line item,四个对象都必须声明highlightFields、其中每项都要解析得到真字段、并且在去掉任一父 lookup 后仍剩至少一列且不以 autonumber 打头。反向验证(方向先判后跑)
预判为红:唯一能真把成员面板打回退化态的改动,就是删掉
crm_campaign_member.highlightFields。删之实测——新守卫的两条断言同时报红:随即还原。
六道门(worktree
hotcrm-944,均在共享 verify 锁内串行)pnpm validatefield-group-shadowed,非本单)pnpm typecheckpnpm lintpnpm hygienegrep -naP自扫,无命中pnpm builddist/objectstack.json1921.4 KB(注释不进产物,符合零元数据变更的预期)pnpm test -- --maxWorkers=2Test Files 70 passed,Tests 1611 passed / 1 skipped既有测试语义零变化:本 PR 只新增一个 describe 块,未改动任何既有断言;
views清单类对账(i18n_views标签、tabs 可达性)因未新增 view 而无需更新。边界
未起 dev server,无浏览器实测条件——上述机制结论来自对 17.0.0-rc.3 Console 产物中
RecordDetailView关联列表派生、RelatedList列回退链、MetadataProvider的 view→object 合并、以及 form 渲染器 create 模式字段过滤这四处的静态测量,如实标注。未碰content/docs/、releases/、@objectstack/*版本;#715(字段组被 highlightFields 提升)机制不同未混改,#597(成员生命周期)不预判。文档承诺缺口(测量 ①)与
EventAttendeeViews.list的消费面问题按 Prime Directive #10 另行立单,不在本 PR 内修。Generated by Claude Code