fix(plugin-detail): record:related_list 的 filter 接通查询,Add 按钮门与 picker 对话框对齐 (objectstack#7118, #3895) - #3981
Merged
Conversation
…ataSource (objectstack#7118, objectui#3895)
`RecordRelatedListProps.filter` was declared by the spec and published as a
registry input while nothing read it: `RelatedList` built its query from
`{ [referenceField]: parentId }` alone, so an authored filter passed every gate
and was dropped — the list answered with every child of the parent. It is now
AND-combined with the parent condition (never substituted for it: "additional"
criteria may only narrow), lowered through the repo's single filter sink so both
the spec's `ViewFilterRule[]` vocabulary and the AST `ElementDataSourceGate`
composes are accepted without a second dialect. With nothing authored the query
is byte-identical to before. `RECORD_RELATED_LIST_DATA_SOURCE` gains
`filter: true`, so a saved view named through `dataSource: { object, view }` no
longer contributes columns/sort/limit while its filter is discarded, and #6953's
honest reverse assertion flips to the positive one its own comment predicted.
The legacy raw-URL fallback path cannot express an operator, so a declared filter
there is refused with a console explanation rather than dropped: answering wider
than the metadata asked is the class this wiring removes.
Separately, the Add button now requires `dataSource`, matching the dialog it
opens and the callback it ends in. Without it the button rendered and did
nothing at all when clicked — real in hosts that bind no `RecordContext`
(Studio designer previews, context-free embeds), since the renderer passes
`dataSource={ctx?.dataSource}`.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Collaborator
Author
|
PM 验收(session_01GTRjn8xBqp75dk7kFupVRt):通过,转 ready 并挂 auto-merge。objectstack#7118 + objectui#3895 结对落地。 核验记录(head
concerns 采信:wire 形状沿共享层既定组合形(#3431 实测背书),若真实后端拒绝属共享层性质非本 PR;types 镜像宽松与 FLS 客户端不查两条边界判断合理。os#7119 上的 sink 约束评论(ObjectGrid 跳过 sink 的唯一消费者)已成为该决策箱卡的实施约束 —— 有价值的移交。 Generated by Claude Code |
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 objectstack-ai/objectstack#7118
Fixes #3895
两单同文件(
packages/plugin-detail/src/RelatedList.tsx),拆开必然串行,故一 PR 双 Fixes。基5bfaabde0(PR #3969 的 objectstack#6953 落地)。一、objectstack#7118 —
record:related_list.filter声明了却无人读前提复核(先验证,再实施)
issue 正文的事实在基 sha 上逐条成立:
packages/plugin-detail/src/index.tsx:323声明{ name: 'filter', type: 'array', label: 'Filter', description: 'Additional filter criteria' };RelatedList的取数处只有const filter = { [referenceField!]: parentId },props 里没有任何列表自身作用域的 filter 通道;renderers/record-related-list.tsx的RECORD_RELATED_LIST_DATA_SOURCE故意不含filter,PR fix(sdui): PageComponentSchema.dataSource 逐 block 接线,record_picker 不再丢 view (objectstack#6953) #3969 为此钉了一条诚实的反向断言。作者按已发布的
inputs写 filter,得到该父记录下的全部子行 —— 不报错、os validate绿、SDUI prop walk 也绿(已声明键不触发unknown-prop)。objectstack#4413 的形状。方向枚举与选择(AGENTS.md #0.1)
决定:接通。 两案在两条轴上的分析:
filter是 spec 的键 ——@objectstack/spec的json-schema/ui/RecordRelatedListProps.json明确声明它,item 形状是完整的ViewFilterRule,描述 "Additional filter criteria for related records"。给它一个读点即是让实现追上契约。inputs条目不能消除这条声明:spec 仍然声明、渲染器仍然不读,缺陷一字未改,只是变得更难被发现(反而制造 spec↔registry 的反向不一致,正是 #3808 为add/relationshipValueField修掉的方向 —— 声明面与运行时互相矛盾且无人报告)。真正的"撤声明"是在 objectstack 仓按 ADR-0049 退休一个 spec 公共属性,超出本 PR 文件面,也是一次公共契约删除。dataSource: { object, view }里 saved view 的 filter 不再被丢弃 —— 列表不可能再比它引用的 view 更宽(objectstack#5576 立下要禁止的方向)。lookupFilters之类把作者约束降级成用户可编辑建议的路子(#3831 已论证过这是错的)。成本上 A 也不贵:合成用仓库既有的单一 filter 汇聚点
mergeFilterNodes,不新增任何转换方言。实现
RelatedList新增filterprop(spec 的ViewFilterRule[],或ElementDataSourceGate合成出的 AST 节点),与{ [referenceField]: parentId }在mergeFilterNodes下 AND 合成。父关系条件不可协商:"additional" 只能收窄本父记录的子集,永远不能放宽。filter: [](designer 的"未配置")视作未声明。RECORD_RELATED_LIST_DATA_SOURCE加filter: true;PR fix(sdui): PageComponentSchema.dataSource 逐 block 接线,record_picker 不再丢 view (objectstack#6953) #3969 那条反向断言翻转为它自己注释里预告的正向断言。filter[字段]=值,连操作符都表达不了):声明了 filter 就拒绝取数并说明原因,而不是静默丢掉 —— 答得比 metadata 要求的更宽,正是本单要消除的那一类。inputs的type与实际形状):type: 'array'与 spec 的z.array(ViewFilterRuleSchema)一致,无需改;description 补上成员词汇与合成规则(ComponentInput是平的,数组入参的元素形状只能写在自己的 prose 里)。二、objectui#3895 — Add 按钮不判
dataSource方向按分诊席 2026-08-09 的晋级评论既定(方向 1,不重开)。
add链上三个消费点原本两判一不判:对话框判dataSource、handleAddRecords判、按钮不判。于是无 adapter 的宿主里按钮照常渲染,点击把pickerOpen置 true 而对话框根本不存在 —— 没有任何可见反应,也没有任何提示。补上同一条件即可,与 #3838 同一原则往前一格:能力不具备就不呈现 affordance。可达宿主是真实的一类:
renderers/record-related-list.tsx传dataSource={ctx?.dataSource},任何未绑定RecordContext的挂载(Studio designer 预览、无上下文嵌入)都是undefined。所以第一条钉子走渲染器而不是组件 —— 门只在真会产生缺失 adapter 的挂载形态上才值得钉。反向验证(先预判方向,再跑;变异均未提交)
dataSource2 failed / 2 passed—— 红的正是withholds the Add button…与renders neither button nor dialog…queryFilter = parentScope(断开合成)3 failed / 12 passed,红的三条与预判逐条一致filter: true2 failed / 6 passed,同预判第二个变异不会动到
RecordRelatedListRenderer.elementDataSource.test.tsx,这是预判的一部分而不是漏洞:该文件钉的是渲染器那一跳(什么值到达RelatedList的 props),组件内部查询合成的变异按定义碰不到它 —— 所以才需要第三个变异专门钉那一跳。另:两条无-dataSource 钉最初因 i18n 未挂载而假绿(默认按钮渲染的是原始 key
detail.add,选择器/^Add$/两个方向都匹配不到 —— 绿是因为什么都没匹配上)。已把add.label显式写进 fixture 并按该名字选择,负向钉不再空转;这一点写在测试文件的注释里。消费半径扫查
addprop 在仓内只有 plugin-detail(测试)与本渲染器使用;metadata-admin designer 的record:related_listinspector 不含add,deriveRelatedLists既不产add也不产filter。故本改动的 fixture 面不外溢 —— 仍按规程连apps/console的 binding-reach 一起跑了。验证输出
文档与 changeset
content/docs/guide/data-source.md的逐 block 覆盖表:record:related_list的filter由 "— (see below)" 改为 ✅,两处缺口记录减为一处(object-form),并写明合成是与父关系 AND 而非替换。packages/plugin-detail/README.md:补filter的语义/词汇/兜底路径行为,以及 Add affordance 的门。@object-ui/plugin-detailpatch。边界
只动 plugin-detail(
RelatedList.tsx、renderers/record-related-list.tsx、index.tsx的一条 input description、测试)+ 两处文档 + changeset。未碰共享层本体(packages/react的 gate、packages/core的 filter sink 一行未改),未碰 objectstack#7121 在飞的 block 外壳,未碰releases/。Generated by Claude Code