Skip to content

fix(plugin-list): a sourced list shows each condition once, and a lookup chip names its record - #35744

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-35727-sourced-list-one-condition-tag
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-35727-sourced-list-one-condition-tag

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Fixes #35727

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户看到的变化:从记录「↗」打开的列表(数据页),条件只在页面顶部的「筛选条件」标签里出现一次;列表自己的条件行不再重复一个带锁、印着原始 id 的标签,也不再多出一个灰掉的「重置」。保存视图里锁定的关联字段条件,改为显示记录名称。
  • 为什么做:列表筛选重做这条线上的一项,替从关联页签跳到列表的用户去掉重复的条件和多余的「重置」。
  • 出错会怎样:最坏是数据页上某个条件看不到标签,或关联记录名读不到时退回显示 id;筛选本身照常生效,撤回这个改动即可复原。
  • 要你做什么:无

What changes

  • Host-owned conditions (the seam). ListView takes a new host prop, hostDrawnConditionFields (a list of field names). Conditions of schema.filter on those fields still constrain the query exactly as before; the condition row (ConditionChipRow, new prop hostDrawnFields) simply draws no locked chip for them. The data page passes its address-condition fields there, so a sourced open shows each condition once, as the page's own 「Filtered by」 tag.
    • Why this seam rather than a separate "host filter" channel: the view filter (authoredFilter) feeds the fetch, the page-reset signature, the export, the self-querying child views, the empty-state copy and Save-as-view. Moving the address conditions out of schema.filter would have to re-thread every one of those readers; naming which fields the host draws changes only what the chip row renders, and the query path is byte-identical. It is a host prop, never a schema key: which surface draws a condition is the page's layout, not anything an author writes.
  • Lookup chips name the record. A locked chip for a lookup condition (and the reader's own lookup filter chip, same code path) shows the referenced record's name, read the way the lookup value picker reads it: the target's records by id through the list's data source (find(target, { $filter: { id: { $in: ids } } })), named by the lookup's displayField else the target's name field (referencedRecordTitle). It falls back to the id only when the name cannot be read. One read per target, re-run only when the targets or ids change (keyed on content, not on array identity).
  • One Reset. The condition row's 「Reset」 is drawn only while the reader has something of their own to reset (a filter, a changed sort, a filter-bar selection, the queue toggle) — it is no longer drawn disabled. ConditionChipRow's resetDisabled prop is gone; ListView passes onReset only when the conditions differ from the view.
  • Data page: only the props passed to ListView changed — one added prop, hostDrawnConditionFields={urlFilters.map(([field]) => field)}, plus its comment, right after rowOpensRecord={recordServed}. The page's tag row is untouched (it belongs to the open PR fix(record-page): the related tab offers only open-in-list and one add entry; a multi-pick add is all or none #35725 for the related tab, which adds the page's own Reset and names the tag).

Read first, by risk:

  1. ui/packages/plugin-list/src/conditions/ListConditionControls.tsx — useLookupValueNames (the one read the chip row now makes) and the hostDrawnFields filter on viewChips.
  2. ui/packages/plugin-list/src/ListView.tsx — the ConditionChipRow call site (onReset={conditionsDifferFromView ? handleResetConditions : undefined}).
  3. ui/packages/app-shell/src/views/ObjectDataPage.tsx — the one added ListView prop.

Two-minute check: open the showcase Contacts data page with filter[account]= set to any account id (or an account's Contacts tab → 「↗」). Expect one 「筛选条件 · 客户」 tag at the top, no row of chips under the view bar, and the record count matching that account. Add a 阶段 filter: its chip, 「+ 添加筛选」 and one enabled 「重置」 appear.

Tests

All at merged head eae54db249 (after merging origin/main at 03bce5c22a).

  • List level, ConditionChipRow (listConditions.test.tsx): a host-drawn field gets no locked chip while the view's other conditions keep theirs (with a CONTROL without the prop); all-host-drawn and nothing else ⇒ the row draws nothing; a locked lookup chip reads Account: = Globex and the read is find('account', { $top: 1, $filter: { id: { $in: ['a1'] } } }); the reader's lookup chip reads Account: Globex, Initech; a failing read keeps the id. The Reset pin now asserts no Reset is drawn when the host passes none.
  • List level, real ListView (ListView.harness.test.tsx, new block ListView.hostDrawnConditions-35727), zh and en each: a host-drawn condition is no locked chip and no Reset and the record query still carries it; a saved view filtered on a lookup locks Account:= Globex / Account: = Globex, never the id, and draws no Reset; once the reader adds a condition, exactly one Reset (重置 / Reset). ListView.conditionRow-35549.test.tsx: the locked-chip case now asserts no Reset rather than a disabled one.
  • Data-page level, real page with the real ListView (ObjectDataPage.sourcedOpenOneTag-35727.test.tsx), zh and en: filter[account]=acc_1 draws one page tag, zero locked chips, no list Reset, and the record query still carries acc_1; CONTROL: no address condition ⇒ no tag and an unfiltered read.
Run readings
  • Touched suites: pnpm --dir ui exec vitest run --maxWorkers=2 over plugin-list/src/conditions/, ListView.harness, ListView.conditionRow-35549, ListView.clearFiltersChips-29052, ListView.emptyStateClearFilters-28908 and the seven ObjectDataPage.* tests → Test Files 12 passed (12), Tests 246 passed (246), lock VERDICT command-exit 0.
  • pnpm --filter @object-ui/plugin-list run type-check → exit 0 (after turbo run build --filter='@object-ui/app-shell^...', 68/68 tasks).
  • pnpm --filter @object-ui/app-shell run type-check → exit 0.
  • pnpm --dir ui exec vitest run scripts/ → Test Files 171 passed | 2 skipped, Tests 5092 passed | 2 skipped.
Ablations (one per changed behaviour; each via scripts/ablation-replace.mjs, mutation proven on disk, restored to the HEAD blob)
  1. Drop the data page's hostDrawnConditionFields prop → both data-page cases red (a locked chip appears); CONTROL stays green.
  2. Replace the hostDrawnFields filter with a pass-through → 6 red (two ConditionChipRow cases, the four host-drawn ListView cases).
  3. Disable the lookup-name branch of describeConditionValue → 4 red (two ConditionChipRow name cases, the zh/en saved-view lookup cases).
  4. Always pass onReset → 3 red (the zh/en saved-view cases and the 35549 locked-chip case). The data-page no-Reset case stays green under this one by design: with every condition host-drawn and nothing of the reader's, the row draws nothing at all.

Acceptance notes

  • Before/after in the browser (showcase, 1280×800, zh-CN, Contacts data page with filter[account] = Northwind's id):
    • before at origin/main 5ecf937470: page tags 1 (「客户 = Pf5mgR55cgCKt58S」), locked chips 1 (「客户:= Pf5mgR55cgCKt58S」), list Reset 1 (drawn, disabled), 「+ 添加筛选」 1;
    • after: page tags 1, locked chips 0, list Reset 0, condition row empty; 26 records either way. Adding a 阶段 filter: 「阶段:新建」, 「+ 添加筛选」, one enabled 「重置」, 24 records. A reader 客户 filter reads 「客户:Northwind」.
  • On main alone the sourced data page now shows no Reset at all (the page tag's × still clears the condition); the open PR fix(record-page): the related tab offers only open-in-list and one add entry; a multi-pick add is all or none #35725 for the related tab adds the page's single Reset and names the page tag. Whichever of the two lands second merges main; overlap-check against main and against that PR's branch both answer clean.
  • The Reset rule is general, not only on the data page: every list now draws 「Reset」 only while it has something of the reader's to reset (previously drawn disabled). The e2e scenario in list-condition-row-35549.spec.ts presses Reset only after adding a sort and a filter, so it is unaffected.
  • A user-type lookup with no declared reference still prints its id in a chip: the value picker defaults such a field to users inline, and this change reads only a declared referenceTo rather than copying that default.
  • The plugin-list README documents some ListView host props (rowOpensRecord, page); the new hostDrawnConditionFields is documented on the prop's own JSDoc and in the changeset, not in the README, which is outside this card's file surface.
  • The data-page test holds its permission and auth stand-ins as stable objects: the page keys its address conditions on canRead, so a fresh function per render (as the sibling tests' stand-ins return, harmless there because they stub ListView) re-reads the records without end.

Verification

  • node scripts/pm/dispatch-gates.mjs --commands (tree f64696e915, re-derived identical at the final tree): 38 families, all run locally, all exit 0 after one fix — check:test-source-alias first flagged the new data-page test for reaching a dynamic import('@objectstack/lint'); the test now pays that load at module top, and the gate is green. --ran reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. The one vitest run scripts/ run that was killed by the box's memory limit was re-run alone and passed.
  • pnpm check:new-line-citations → 0 new citations. Control-byte self-scan over the diff: no hits. eslint over the changed files: 0 errors.
  • Every family CI runs on this PR (Lint & Repo Gates, Type Check UI, Test UI, Build & E2E UI, and the rest) is read from this PR's check-runs, not re-run here.

Generated by Claude Code

…lookup chip names its record

The data page draws its address conditions as its own tags; the list now
takes the fields it draws (hostDrawnConditionFields) and draws no locked
chip for them while still filtering on them. A lookup condition chip reads
the referenced record's name through the data source, keeping the id only
when the name cannot be read. The condition row's Reset is drawn only while
the reader has something of their own to reset.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 从记录的相关子表点「在列表中打开」进入列表时,筛选条件只显示一次(页面上方那个带记录名的标签),列表里不再重复一个显示原始编号的锁定条件。
  • 列表里凡是按关联记录筛选的条件,不论是视图自带的还是用户自己加的,都显示记录名称;读不到名称时才显示编号。
  • 列表条件行的「重置」只在用户自己改过筛选或排序时才出现,不再显示一个灰掉的按钮;这一点对所有列表都生效。
  • 只在主干上看,页面标签仍显示编号;另一个改相关子表的改动合并后会显示记录名并只留一个「重置」,两者不冲突。
  • 席位意见:通过。分区自己合并;等自动检查跑完全绿后转为正式再合并。

席位核对

ACCEPT · head eae54db249 · Fixes #35727 (p1, under #35549 / list epic #35547) · K=0 · merge-tree vs origin/main clean; vs #35725 head e62ce9e74e clean · governed 0/8 · +544/−26, 8 files · CI 14 success, 13 skipped, 22 in progress · draft · 2026-11-20T04:53Z

Routing: no packages/spec face, Clause-②: no, not governed, under 3000 lines → the area lands it after R1.

Checked:

  • hostDrawnConditionFields → ConditionChipRow.hostDrawnFields: filters only the locked view chips whose field the host names; schema.filter is untouched, so the list still filters on them. On the data page schema.filter is the URL triples alone (ObjectDataPage ~239/395), so hiding by field name hides exactly the conditions the page already draws as tags. anyOf chips carry no single field and are kept. The memo keys on the joined names, not on the array the host rebuilds each render.
  • Lookup names (useLookupValueNames): one getObjectSchema + one find(target, { $filter: { id: { $in: ids } }, $top: ids.length }) per target, re-run only when the sorted target/id key changes; cancelled on unmount; a failed read or an unnamed record keeps the id. Same $filter shape as the existing useApproverDirectory / historyActors reads. A reader without read access on the target gets the id, never an error.
  • Reset: onReset passed only while conditionsDifferFromView; resetDisabled was module-internal and has no other reader. The changeset states the every-list change (point 1).
  • Surface: all 8 files inside claim 7029715796 (ObjectDataPage.tsx is the one props line, ~734; its tag row untouched).
  • Card "Done when": one tag per condition and name-not-id pinned at the list and at the sourced open; "removing a page tag still clears that condition" is the page's existing behaviour, untouched; the single page 「Reset」 arrives with fix(record-page): the related tab offers only open-in-list and one add entry; a multi-pick add is all or none #35725 (point 4), and the list's own Reset is now absent until the reader changes something, so together the card's "one Reset" holds.

Required before landing:

  • R1 (CI). 22 checks were still running at this head. Land only on all green; mark the PR ready when it is.

Nits (no action required):

  • Point 3: the plugin-list README not naming hostDrawnConditionFields needs no amendment here; the prop's JSDoc carries it. Fold the README line into the next card that touches that README.
  • $top: ids.length is unbounded by the page cap; a condition naming more ids than OS_DATA_MAX_PAGE_SIZE would be refused and fall back to ids. Not reachable from today's chips.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Landing · head eae54db249 · after L1-a ACCEPT 7030807631 (R1: CI green on this head) · 2026-11-20T05:10Z

Probe Reading
Checks at head eae54db249 39 success, 13 skipped, 0 failed
Governed NOT governed (0 of 8 paths, L1-a record)
Contract record not owed (UI only, no packages/spec, Clause-② no)
Dogfood battery not owed (no !, no narrowing arm)
Overlap merge-tree clean vs main and vs #35725's head e62ce9e74e; whichever lands second merges main

Status: pr_ready + automerge_enable. Fixes #35727: on MERGED the area posts the close-out. README note for hostDrawnConditionFields folds into the next card that touches the plugin-list README (L1-a nit).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 20, 2026 05:10
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44679349208 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (3/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/approval-read-over-mcp.dogfood.test.ts > an approver's agent lists the approvals waiting on them over MCP (#32442, read half) > ⭐ the query tool's tex
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: expected 'Query records from an object with opt…' to contain 'sys_approval_request'
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • test/approval-read-over-mcp.dogfood.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 14 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Re-queue once · head eae54db249 · 2026-11-20T05:33Z

The merge-group build 44679349208 failed one dogfood test: approval-read-over-mcp.dogfood.test.ts › the MCP query_records description should name sys_approval_request. Not this PR's:

  • This PR touches only ui/packages/plugin-list and the data page's ListView props; nothing under packages/mcp, approvals or the dogfood harness.
  • On origin/main (ca4ec2a2f1) packages/mcp/src/mcp-http-tools.ts still writes sys_approval_request into that description unconditionally, so main plus this PR keeps the test green.
  • The group's base b7c917f4ce is not a commit on main: it is a queue entry ahead of this one, so the changed description came from that entry (a semantic conflict in the group, triage case 3), which has since left the group without landing.

Re-armed once (automerge_enable). If it fails the same way again, the area stops and reports rather than re-queueing.

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

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants