Skip to content

object-timeline / record:line_items 的查询没有 filter/sort 读点:dataSource.view 解析成功却贡献为零(列表可能比它引用的 view 更宽) #7137

Closed
objectstack-ai/objectui
#4009

Description

@yinlianghui

发现于 objectstack#7121 的实施过程(objectui 分支 claude/issue-7121-datasource-remaining-blocks,基线 5bfaabde0)。#7121 的验收范围是「把 PageComponentSchema.dataSource 映射到每个 block 真读的键」;本单是这两个 block 根本没有 filter/sort 读点这件事本身,属于 #7121 之外的独立缺口,单独立单。

与 objectstack#7118 同形(record:related_list 声明了 flat filter 却无人读),只是这两块连声明都没有 —— 用户可见的后果完全一样:命名了 saved view,却得到比该 view 更宽的一批行,不报错。

事实(逐条给了读点)

object-timeline —— packages/plugin-timeline/src/ObjectTimeline.tsx

整条取数就是一句(第 159-162 行):

const results = await dataSource.find(schema.objectName, {
    options: { $top: 100 },
    ...(expand.length > 0 ? { $expand: expand } : {}),
});

没有 $filter、没有 $orderby,窗口是硬编码的 100(不是作者声明的上限)。全文件对 schema.filter / schema.sort / schema.limit / pagination 零引用(已 grep 确认)。

record:line_items —— packages/plugin-form/src/LineItemsPanel.tsx

取数(第 92-95 行):

const res = await dataSource.find(schema.childObject, {
  $filter: { [schema.relationshipField]: parentId },
  $top: 500,
});

只按父关系过滤,$top 固定 500;同样对 schema.filter / schema.sort / schema.limit 零引用。(这一块的 columns 是 GridColumn[]({ field, type, options, computed, expr, … }),不是字段名投影,所以 view 的 columns 在这里是形状不对而不仅是「更宽」,这一条已在 #7121 的实现里写清。)

后果

#7121 已把 dataSource.object 接到这两块(gantt/map/pivot 连 filter/sort 一起接了),于是现在:

#7121 里对这两条各钉了一条诚实的反向断言(确认查询里确实没有 filter/orderby),所以缺口一旦被补上,那两条钉子会翻红,提醒同时更新映射与文档。

建议范围(两条路,请维护者定向)

  1. 给取数补读点:timeline 的 find 加 $filter: schema.filter / $orderby: convertSortToQueryParams(schema.sort)(与同仓 gantt/map/calendar 的写法一致),并把固定 $top: 100 换成 schema.limit ?? 100;line_items 在父关系过滤之外 AND 上 schema.filter。补完后 #7121 的映射只需各加 filter: true / sort: true / limit,绑定即自动生效。
  2. 或明确豁免:若判定 timeline 永远只渲染固定窗口、line_items 永远只按父关系取数,就在 spec / 文档层把这两块声明为「不支持 view 的 filter/sort 贡献」,并把 PageComponentSchema.dataSource 在剩余 object-bound public block 上仍无人消费:object-gantt / object-timeline / object-map / object-pivot / object-master-detail-form / embeddable-form(按 spec 写仍渲染出空) #7121 的覆盖表从「缺口」改写成「设计如此」。

倾向 1:两块都已经是 object-bound 的列表形态,filter/sort 是这类 block 的常规能力,而「命名了 view 却得到更宽的答案」正是 AI 生成的 metadata 最藏得住的一类错误。

去重

Activity

  1. added
    repo:objectuiSeam card: cross-repo ordering with objectui is the substance (pure objectui fixes live in objectui)
    pm:queueReady for the PM dispatch loop
    on Aug 9, 2026
  2. yinlianghui commented on Aug 9, 2026

    @yinlianghui
    ContributorAuthor

    PM 分诊轮(objectui 分片,session_01GTRjn8xBqp75dk7kFupVRt):晋级 pm:queue —— object-timeline / record:line_items 的查询无 filter/sort 读点,dataSource.view 解析成功却贡献为零、列表可能比引用的 view 更宽,与 os#7118 同形。方向由实施者按 #7118 先例论证(「补读点」优先审视:timeline 的 find 补 $filter/$orderby、line_items 的父 FK 与 authored filter AND 合成 —— 经唯一 sink;确不适用再「明确豁免 + 文档」)。前置:PR3982 合入后派(同文件面)。


    Generated by Claude Code

  3. self-assigned this
    on Aug 9, 2026
  4. yinlianghui commented on Aug 9, 2026

    @yinlianghui
    ContributorAuthor

    【PM 认领】objectui 分片(session_01GTRjn8xBqp75dk7kFupVRt),批次 7。派 os-dev 实施,代码落 objectui 仓,分支 claude/issue-7137-timeline-lineitems-filter-sort。

    方向裁定(契约机械类,PM 代裁,维护者可否决):按路线 1 补读点 —— timeline 加 $filter/$orderby/schema.limit ?? 100,line_items 在父关系过滤上 AND schema.filter,写法对齐同仓 gantt/map/calendar 既有形态;这是机制对齐不是新能力。配套:#7121 映射各补 filter/sort/limit 键、data-source.md 覆盖表两行「no read site」改写、#7121 钉的两条诚实反向断言按其注释预期翻红后同步更新。


    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

Labels

pm:dispatchedDispatched to a dev agent by /pm-dispatchpm:queueReady for the PM dispatch looprepo:objectuiSeam card: cross-repo ordering with objectui is the substance (pure objectui fixes live in objectui)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions