Skip to content

FilterBuilder 值落在选项集之外时值控件显示空 —— 文本值切到 picklist 列后行仍带着该值 #4874

Closed

Description

@yinlianghui

发现于 #4781 的实施,回传立单。又一处 #4768 / #4781 家族的「控件显示空、行却带着看不见的值」,这次成因是值域而不是类型。

事实

packages/components/src/custom/filter-builder.tsx(origin/main 65e88e6):带 options 的 select/lookup 列,其值控件是一个受控的 Select,value={String(condition.value || "")}。Radix 的 SelectValue 只认已挂载的 SelectItem,值不在 options 里就什么都不渲染 —— 与 #4768 里 operator trigger 显示空是同一个机制。

复现:筛选面板加一行 → 字段选文本列 → 值输入 acme → 字段改成一个 picklist 列(选项 won / lost)→ 值控件显示空,行里仍是 value: "acme",照样持久化、照样下发查询。

实测(jsdom):切换后 onChange 最后一次给出的行 value 为 "acme",值 trigger 的文本为空串。

与 #4781 的边界

#4781 已落的类型重整刻意不覆盖这一条:select/lookup 属于文本族,"acme" 在类型上是装得下的,被清掉的只有类型装不下的值。这里要答的是「值在不在该列的选项集里」,是值域问题。

定语义前要先答的

lookup 类字段的候选值可能是远程/异步的(LookupValuePicker 走远程搜索,options 常常为空或未到位)。照本地 options 一律清空,会把一个完全合法的 lookup id 清掉 —— 这个风险决定了不能照抄 #4781 的做法:

倾向 A + C 的组合(静态选项列清空,远程列显示为临时项),但这是公共行为,建议按 #4781 的路子交维护者裁定。

参考

Activity

  1. added theissue type on Aug 17, 2026
  2. os-zhuang commented on Aug 17, 2026

    @os-zhuang
    Contributor

    Triage: needs-user-decision, type Bug. The #4781 mother ruling does not carry over: it decided the type-domain half and explicitly left this value-domain half out of scope, and its rationale (clear what the type cannot hold) does not answer the remote/async lookup case — clearing on local options membership would delete perfectly valid lookup ids. Real semantic difference ⇒ new decision, not an inherited one.

    Decision facets:

    Recommendation: A + C combined, per the card. Escalated rather than auto-adjudicated because it changes user-visible clearing behaviour on a public control and the sibling precedent was maintainer-ruled.


    Generated by Claude Code

  3. os-zhuang commented on Aug 17, 2026

    @os-zhuang
    Contributor

    Maintainer ruling (2026-08-17, recorded by PM session session_01NYgmGheCzM6NrHZN436Cxf). The maintainer accepted the decision-inbox report's recommendations in full, verbatim: 「同意」. For this card:

    Ruled: A + C combined (as the filer and triage recommended):

    This closes the FilterBuilder family: operator (#4768), type domain (#4781), value domain (this card). Label flipped needs-user-decision → pm:queue in the same stroke.


    Generated by Claude Code

  4. self-assigned this
    on Aug 17, 2026
  5. yinlianghui commented on Aug 17, 2026

    @yinlianghui
    CollaboratorAuthor

    认领(objectui 分片 PM 座席,批次 21)。Session session_01GTRjn8xBqp75dk7kFupVRt,分支 claude/issue-4874-filter-value-domain,os-dev 子代理实施。

    实施依据 = 楼上维护者裁定(05:03Z,A+C 组合,B 维持否决):静态 options 在位 → 切列时成员判定、不匹配清到该族空形;远程/异步列(lookup 远程搜索、options 缺席或未到位)→ 保值并可见(Select 临时项),永不因本地非成员猜测清掉合法 lookup id、永不隐形。文件面:packages/components/src/custom/filter-builder.tsx + 测试,与在飞 #4989(plugin-form)/#4917(renderers/basic)不相交。同族先例:#4768(operator 显空)、#4781(类型域,其空形定义沿用)。


    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

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions