Skip to content

fix(ui): the view / page-block filter editor offers a multiple: true field membership only - #36182

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36169-filterbuilderfield-multiple
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36169-filterbuilderfield-multiple

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #36169

Clause-②: no
Metadata-protocol: none

维护者速读

  • 在工作室里给视图、页面和页面里的关联列表写筛选条件时,"多选"字段(例如可选多人的负责人字段)的运算符下拉框现在只给"包含 / 不包含 / 为空 / 不为空",不再给保存后一定被服务端拒绝的"等于 / 属于";单选字段不变。
  • 属于"多值字段筛选"这组修复,补上条件编辑器那次修复没覆盖到的视图与页面筛选编辑器。
  • 影响在工作室或应用内视图设置里写筛选的管理员;只改界面给出的选项,已存的筛选原样不动,可以直接撤回。
  • 要你做的一件事:无。

What changes

A select / lookup / user field declared multiple: true stores a list. Studio's view and page-block filter editor (FilterBuilderField, the filter-builder widget) built its field list without multiple, so the shared FilterBuilder treated such a field as single-value and offered Equals / Is any of, which the data door refuses on a list (400 INVALID_FILTER, measured on that door by the condition-editor half of this family, PR #36165). FilterBuilderField now forwards each field's multiple exactly as PR #36165 did for the other editors, and the builder offers jsonColumnFilterOperators' set (Contains, Does not contain, Is empty, Is not empty). No operator table is copied: the set is operatorsForField's answer.

Measured where the field list is built (the dispatch assumed two call sites in one file): FilterBuilderField has three call sites in two files, and its field list is built in five places. Each now carries the served multiple:

Host Surface Field list built by
generic metadata editor a page's interfaceConfig.filterBy, tab presets (filter-mode), any form row with widget: filter-builder objectCatalogOf in ResourceEditPage.tsx (extracted from the inline loader so it can be pinned)
Studio list-view inspector a list view's Filter row ObjectListViewInspector.tsx field catalog
view-variant inspector a view variant's filter ViewVariantInspector.tsx widget context
in-app view configuration panel the same inspector, fed an override catalog mapObjectFields in ViewConfigPanel.tsx
page block inspector record:related_list block filter FilterRulesField in PageBlockInspector.tsx (already reads useObjectFields, which carries multiple since PR #36165)

Read-back of a stored equals / in rule on a list column: this editor has no Source fallback (unlike datasetFilterCondition). It hands the stored rule to the builder as stored; the builder mounts the row's own operator beside the offered set (offeredOperatorsForRow), so the rule opens as an Equals row the author can change to Contains, and opening it writes nothing. Pinned.

Read first, by risk:

  1. ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx — objectCatalogOf: the loader body moved verbatim into an exported function, plus the multiple projection. Check the record and array branches still read name the same way.
  2. ui/packages/app-shell/src/views/metadata-admin/widgets.tsx — the fbFields forward and ObjectFieldOption.multiple.
  3. ui/packages/app-shell/src/views/ViewConfigPanel.tsx — mapObjectFields is now exported (marked internal, for the pin).

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/widgets.filterBuilderMultiple-36169.test.tsx — expect 12 passed.

Tests

New file named for the card, widgets.filterBuilderMultiple-36169.test.tsx (no shared harness file exists for FilterBuilderField; its other pins are card-named files):

  • the widget: a multiple: true user / lookup / select column's real operator dropdown equals operatorsForField's labels (the four); CONTROLS: single-value user / select columns keep Equals and stay inside their type bucket;
  • read-back: a stored equals rule on owners opens as its row, writes nothing, and its dropdown lists Equals plus the four;
  • every host: objectCatalogOf (record and array forms) and mapObjectFields mark exactly the multiple: true columns; the view-variant inspector, the page block's related-list filter and the Studio list-view inspector (real MetadataClient over a served object) each offer a list column the four.
Reverse verification (one mutation per site, on the committed fix)

Each multiple projection was deleted in turn with scripts/ablation-replace.mjs (anchor hit 1 to 0, blob moved), the file ran, and the tool restored it (git checkout HEAD, blob equals HEAD, git diff HEAD empty):

  • FilterBuilderField forward: 7 failed / 5 passed (the passing five: the helper's own answer, the two single-value controls, the two catalog unit pins);
  • objectCatalogOf: 5 failed (the four widget cases built from that catalog, and its unit pin);
  • mapObjectFields: 2 failed (its unit pin, the view-variant case fed by it);
  • ViewVariantInspector: 1 failed (its case);
  • PageBlockInspector: 1 failed (its case);
  • ObjectListViewInspector: 1 failed (its case).

The first attempt at the ViewVariantInspector and PageBlockInspector mutations deleted the closing brackets with the spread and failed to transform ("no tests"): void, not counted; redone with an anchor on the spread alone.

Affected suites

At 903d9ca0 (the final head b8e29a32 adds one module-top import to the new test file): pnpm --dir ui exec vitest run --maxWorkers=2 over the existing suites of every edited component (widgets*, ResourceEditPage*, ViewConfigPanel*, PageBlockInspector*, ViewVariantInspector*, ObjectListViewInspector*, ListView*, StudioDesignSurface.listViewInspector*, viewFilterOrGroup*, WidgetContext*, SchemaForm*) → Test Files 137 passed (137), Tests 933 passed (933). The new file at b8e29a32: 12 passed (12). The full @object-ui/app-shell suite is CI's (Test UI).

Acceptance notes

  • Reach, borrowed not re-measured: the refusal of $eq / $in on a list column at the data door is PR fix(ui): condition editors offer a multiple: true field only what its evaluator answers #36165's measurement on the same door (showcase, SqlDriver). This PR measures the Studio offer only (the pins above); no backend was booted.
  • Sibling drop, not fixed here: the generic editor's catalog (objectCatalogOf), the view-variant inspector and the page block's FilterRulesField also leave out each field's options, which the list-view inspector carries (the objectstack#27515 picklist value picker). On those hosts a picklist column gets a free-text value box. Not this card's mechanism (multiple), not measured in a running app; listed in the report.
  • ObjectFieldOption gains an optional multiple; the field-ref / field-multi pickers read name, label and type only, so they are unchanged.

Verification

Local gates

All 39 families from node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack exited 0, each exit code captured before any pipe. check:test-source-alias first exited 1 (the new test reached the lazy @objectstack/lint import through ResourceEditPage); fixed with a module-top import and re-run on the final head: exit 0. check:type-check-coverage, check:type-check-debt, check:undeclared-dep-imports, check:cross-package-test-inputs and check:nul-bytes re-run on the final head: exit 0. --ran reconciliation: 39 derived, 39 run, 0 NOT-MEASURED (a derived zero, every family recorded an exit code). After the @object-ui/app-shell^... closure was built, pnpm --filter @object-ui/app-shell run type-check exited 0 at 903d9ca0 (the src program and tsconfig.test.json); the final head adds only a side-effect import to the test. ui/scripts/check-new-cross-file-line-citations.mjs: 0 new citations.


Generated by Claude Code

… field membership only

FilterBuilderField forwards each field's declared multiple to the shared
FilterBuilder, and every host that builds its field list carries it.

Claude-Session: https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1

Final green head · area a4-D · 2026-11-21T20:32Z
Head: b8e29a32e8a56882b59b1044314ce152cb91f4bf
CI: 39 success, 13 skipped, 0 failed; check-expected-skips.mjs --pr 36182 OK; mergeable clean; check-governed-merges: NOT governed, 447 changed lines; l1-face CLEAN.
Declarations: Clause-②: no · Metadata-protocol: none — no contract record owed unless L1 reads a narrowing.
Owed: L1 (L1-b). Dev report: comment 7068584276 on #36169. File-surface note for L1: five field-list builders beyond widgets.tsx carry a one-line multiple projection (dev deviation 1); the area reads them as inside "the field list its callers pass".

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-21T20:34Z

席位核对 — ACCEPT · head b8e29a3

  • Shape: l1-face.mjs --pr 36182 is clean at b8e29a3: open, draft, base main.
    • The first line is Fixes #36169, and the PR delivers the whole card: every host that builds FilterBuilderField's field list now carries multiple. No closing keyword binds any other card.
    • The declarations are Clause-②: no · Metadata-protocol: none, so Skills-docs and dogfood are not owed.
    • The changeset is patch on @object-ui/app-shell and @object-ui/console, the same pairing as 12 app-shell changesets on main. Check Changeset is green.
  • File surface (area question): inside claim 7067651302. The claim reads "widgets.tsx (FilterBuilderField and the field list its callers pass)". The five files outside widgets.tsx are exactly the callers that build that list, and each edit is a projection of one key. I checked that no other consumer changes behaviour:
    • ResourceEditPage.tsx: the inline catalog closure becomes objectCatalogOf. This is a pure move apart from the multiple key: same array and record branches, same name filter, same action list. Its other readers, the field-ref and action pickers in widgets.tsx, never read multiple. The only .multiple read in widgets.tsx is the new one in FilterBuilderField, and the fieldSpec?.multiple reads in ResourceEditPage are picker specs, not this catalog.
    • ViewConfigPanel.mapObjectFields flows into ViewVariantInspector through objectFieldsOverride, then useObjectFields. Inside it, multiple is read only by the new filter-catalog projection. FieldsListEditor does not read it, and no ConditionBuilder is fed by this override.
    • ViewVariantInspector, PageBlockInspector and ObjectListViewInspector each change only their filter-catalog map.
    • mapObjectFields is exported @internal for tests. app-shell is private, so no published API changes.
    • This differs from fix(ui): condition editors offer a multiple: true field only what its evaluator answers #36165's useObjectFields.ts, which changed ConditionBuilder's behaviour. Here no amendment is owed.
  • Change: ObjectFieldOption.multiple? is added, and FilterBuilderField forwards multiple === true to the shared FilterBuilder. operatorsForField / jsonColumnFilterOperators then answer Contains, Does not contain, Is empty and Is not empty. No operator table is copied.
  • Pins and controls: widgets.filterBuilderMultiple-36169.test.tsx has 12 tests in 3 describes.
    • The builder answers the JSON-column set per list-valued column.
    • A stored equals rule on a list column opens as its row, writes nothing and can be changed.
    • Each host is pinned: objectCatalogOf in record and array form, mapObjectFields, the view-variant filter, the page-block related-list filter and the Studio list-view filter. The single-value control keeps Equals.
    • The reverse legs are from the dev's report 7068584276, and I did not re-run them. One site at a time: the forward 7 ✗, objectCatalogOf 5 ✗, mapObjectFields 2 ✗, and the three inspectors 1 ✗ each. The two first mutations that did not compile were declared void and redone, and each file was restored to its HEAD blob.
    • The affected 137 suites ran at 903d9ca. The only commit since is a 3-line test-file change, and Test UI (all run shards), Type Check UI and Lint UI are green at b8e29a3.
  • Changeset, read sentence by sentence: it names the four filter surfaces and the five hosts, which matches the diff. Single-value fields keep their operators, and a stored Equals rule still opens, which the pins show. "No metadata key, value or default changes" is true.
  • Gates: 39 success, 13 expected skip, 0 unexpected skip, 0 failed and 0 pending. Lint & Repo Gates and TypeScript Type Check are both success. The PR is not governed.
  • Landing: not governed and not narrowing, so the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1

席位核对

Landing · area a4-D · 2026-11-21T20:35Z · head b8e29a32e8a56882b59b1044314ce152cb91f4bf

Reading Value
L1 ACCEPT 7068858904 (L1-b, this head); file surface ruled inside claim 7067651302
Contract none owed: Clause-②: no, no narrowing, no packages/spec/src/**, no governed path
Check-runs 39 success, 13 expected skip (check-expected-skips.mjs OK), 0 failed, 0 pending; mergeable clean
Governed check-governed-merges --pr 36182: NOT governed, 447 changed lines
Main K = 4 first-parent commits past base; git merge-tree against origin/main clean
Overlap overlap-check: merges cleanly with origin/main, #36181 and #36089

Ready + auto-merge now. Fixes #36169: merging closes the card.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 20:35
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 865df27 Nov 21, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36169-filterbuilderfield-multiple branch November 21, 2026 20:55
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
… on a list field (objectstack-ai#36185)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XP3RHGWUG7UH3fNa4tBa9UC)_

Part of objectstack-ai#36167 — the builder half. The card's Done-when also names
`validateExpression` refusing a list compared with a scalar; that half
narrows an accept set and is not built here: the seat picked option A on
the card (7068927390), and area a4-C claimed it (7068951634) under its
own `Part of objectstack-ai#36167`.

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 在 Studio 里给多值字段(多选、标签、多选人员或多选关联)写条件时,操作符从「等于 / 不等于」换成「包含 / 不包含 / 为空 /
不为空」;单值字段不变。
- 属于 Studio 条件编辑器:多值字段上的「等于」永远不成立、作者毫无提示,这次让编辑器只给出能真正命中的写法。
- 已保存的「多值字段 等于 某值」条件会改为在表达式框里原样打开,不会被改写;若有问题,作者看到的是表达式框而非行编辑器,可直接撤回本改动。
- 要你做的:决定是否另做「保存时拒绝多值字段与单值比较」的那一半(见卡片报告里的待决问题)。

## What changes

- `ConditionBuilder` (the Studio CEL condition builder behind hook,
validation-rule, action visibility, page-block and flow entry
conditions) now offers a **list subject** (a `multiselect` /
`checkboxes` / `tags`, or a `select` / `lookup` / `user` declared
`multiple: true`) exactly what the shared filter builder offers it:
contains, does not contain, is empty, is not empty. `==` / `!=` /
ordering are no longer offered there. Which operators a list takes is
read from `jsonColumnFilterOperators` (through the new
`listSubjectOperators`), not restated; a small table only translates
those names onto the builder's own operator values.
- Contains writes `S != null && V in S`, does not contain writes `S ==
null || !(V in S)`. That is the spelling the flow edge's rows shipped;
it now lives in one module, `inspectors/cel-list-membership.ts`
(`listMembershipCel` / `readListMembership` / `listSubjectOperators`),
and `flow-edge-condition-rows.ts` writes through it too (its output is
byte-for-byte unchanged; its existing pins hold).
- A row moved onto a list subject leaves `equals` for `contains`; moved
off a list, membership becomes `equals`. An operator offered on both
sides (is empty / is not empty) stays, re-spelled for the new field.
- A stored condition whose row uses an operator its subject is not
offered (for example `record.labels == 'frontend'` on a list, or
membership on a single-value field) opens in the raw expression editor
exactly as stored: never rewritten, nothing emitted.
- New studio locale key `engine.inspector.condition.op.notContains` (en,
zh).

## Tests

- New pin `ConditionBuilder.listSubject-36167.test.tsx` (27 tests): each
of six list subjects offers the shared builder's list set and nothing
else; three single-value controls keep equals / not equals and get no
membership; the written CEL equals what the flow edge's `rowsToCel`
writes for the same row and is evaluated by `celEngine` (member true,
non-member false, `[]` and `null` null-safe both ways); stored
membership round-trips; stored `==` / `!=` on a list and membership on a
single-value field open raw and verbatim; an instrument control shows
the replaced `==` answering a constant.
- Fixture triage: three existing pins
(`ConditionBuilder.typedEmptyOps-11894`, two cases;
`ObjectValidationsPanel.typedEmptyOps-11894`, one case) seeded a list
subject's row as `S == 'x'` only to reach its operator dropdown. That
seed now opens in the raw editor, so it became the membership row; what
each case pins (the empty check on a list, and that `multiple` reaches
the builder) is unchanged and still needs the flag to reach the builder.

## Acceptance notes

- Re-measured under `celEngine` (objectstack tree at this branch): `'a'
in S` with `S = null` faults (no such overload for `string in` a null
dyn), with `S = []` answers false; `S == 'a'` is false for `['a','b']`
and for `null`; `S.contains('a')` faults on a list. Hence the null guard
on both membership spellings.
- A stored `S == null` / `S != null` on a list subject also opens raw
now (the builder's own spelling for it is is empty / is not empty).
Unchanged bytes, by the round-trip rule.
- The schema-driven condition widget's catalog (`ResourceEditPage`'s
object fetch) dropped `multiple` on this branch's base. objectstack-ai#36182 (merged
to `main` as 865df27) closes it: the fetch now goes through
`objectCatalogOf`, which carries `multiple: true`, and the condition
widget hands that catalog to `ConditionBuilder` unprojected, so after
this PR lands a `select` / `lookup` / `user` declared `multiple: true`
is a list subject at that mount too. `multiselect` / `checkboxes` /
`tags` are lists by type alone. The hook, page-block, action, flow-entry
and validation-panel mounts carry `multiple`.
- `node scripts/pm/overlap-check.mjs` reports a textual overlap with
draft PR objectstack-ai#35923 on the studio en / zh catalogues (different keys). Not
merged around.

## Verification

Read first (risk order):
1.
`ui/packages/app-shell/src/views/metadata-admin/inspectors/ConditionBuilder.tsx`:
`initFrom` (the new offered-operator check that sends a stored row to
the raw editor) and `withOfferedOp` on a subject change.
2.
`ui/packages/app-shell/src/views/metadata-admin/inspectors/cel-list-membership.ts`:
the shared spelling and reader.
3.
`ui/packages/app-shell/src/views/metadata-admin/inspectors/flow-edge-condition-rows.ts`:
now writes through the shared module.

Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/inspectors/ConditionBuilder.listSubject-36167.test.tsx`
— expect 27 passed.

Local readings at `ef21bbcb31` (objectstack tree):

<details><summary>Tests, type-check, ablation</summary>

- `ConditionBuilder.listSubject-36167.test.tsx`: 27 passed. All
`inspectors/ConditionBuilder*`, `flow-edge-condition-rows*`,
`FlowEdgeInspector*` suites: 22 files, 262 tests passed (two locked
runs; five suites first failed to collect on an unbuilt
`@objectstack/client`, passed once it was built).
- Mount-site suites (`ObjectValidationsPanel*`, `FlowNodeConfigField*`,
`HookDefaultInspector*`, `ActionDefaultInspector*`,
`PageBlockInspector.visibleWhen*`, `FlowNodeInspector.entryCondition*`,
`widgets*ondition*`): 33 files, 323 passed, 1 failed before triage (the
`ObjectValidationsPanel.typedEmptyOps-11894` list seed); after triage
that file passes, run with `packages/i18n/` (106 files, 1967 passed) and
with `ui/scripts/` (175 files, 5126 passed).
- `pnpm --filter @object-ui/app-shell type-check` and `pnpm --filter
@object-ui/i18n type-check`: exit 0 (lock VERDICT command-exit 0).
- Ablation (one-off, restored byte-identical to the HEAD blob): deleting
the list branch of `opChoicesFor` through `scripts/ablation-replace.mjs`
(anchor 1 to 0) turns the new pin 19 failed / 8 passed of 27; the 8 are
the single-value controls, the instrument control and the raw-open
cases.
</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` (diff-derived, 38
families) all exit 0 at `ef21bbcb31`; `--ran` reconciliation: 38
derived, 38 run, 0 NOT-MEASURED (a derived zero). `pnpm --dir ui
check:new-line-citations`: 0 new. ESLint on the changed files: 0 errors
(warnings pre-existing). CI runs the full farm.
</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1)_

<!-- signed: repo:objectstack#4 · os-project-manager ·
session_01FEkQ5okniknzVVR3KTSVr1 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

studio: the view / page-block FilterBuilderField builds fields without multiple, so a multi-value field offers = / $in

1 participant