Repository navigation
fix(studio): conditional formatting refuses == on a list field while typing - #36785
Merged
Merged
Conversation
…typing The view conditional formatting editor did not hand the CEL lint the object's field definitions, so record.LISTFIELD == 'x' (a rule that never matches any row) was accepted silently. The editor takes fieldDefs and both mount sites pass each field's type and multiple. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXAtnodnKm6tuyEbxU
Contributor
Author
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读条件格式里,对「多选/列表」字段写 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
This was referenced Nov 23, 2026
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.
Requested by Warren · project thread
Fixes #36459
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
CelPredicateFieldhas taken the object's field definitions (fieldDefs: name,type,multiple) since the field inspector's list-equality work: it reads the list-valued fields throughisMultiValueFieldand hands them to the lint asmultiValueFields, so the engine refusesrecord.LISTFIELD == 'x'(list-equality) with the membership rewrite. The view conditional formatting editor mounted oneCelPredicateFieldper rule but never passedfieldDefs, so no field was judged a list there and such a rule linted clean, saved, and never matched a row.ConditionalFormattingEditortakes an optionalfieldDefsprop and hands it to every rule'sCelPredicateField. Omitted, the lint is what it was.ViewVariantInspector(metadata admin view page) builds it from theuseObjectFieldscatalog it already reads;ListViewMoreSection(Studio list-view panel) builds it from the loadedfieldCatalogit already receives, which already carriesmultiple.error, so it counts in the editor's existing blocking-issue report: the host's Save (metadata admin) and autosave hold (Studio panel) stay shut until the rule is rewritten.No spec, rule shape or server change.
ConditionalFormattingEditoris not in@object-ui/app-shell's published exports, so no export changes (Clause-② no). Changeset:@object-ui/app-shellpatch.Card item 2 (should the view save refuse the same shape) is dropped by the seat; see Acceptance notes.
Tests
New file
ui/packages/app-shell/src/views/metadata-admin/ConditionalFormattingEditor.listEquality-36459.test.tsx, against the real@objectstack/formulaengine:record.tags == 'vip'andrecord.tags != 'vip'on aselectdeclaredmultiple: trueshow the "holds a list" finding with theinrewrite and report 1 blocking issue;'vip' in record.tagsis clean (0 blocking);record.stage == 'open'on a single-valueselectis clean;objectFieldsOverride) and the Studio list-view panel (fed a loadedfieldCatalog) both show the finding; the panel reports 1 blocking issue.Reverse verification at
7c65f8b9, throughscripts/ablation-replace.mjs(anchor hit 1 → 0, blob changed, restored blob == HEAD,git diff HEADempty): with thefieldDefs={fieldDefs}pass-through deleted fromConditionalFormattingEditor, the 4 refusing cases fail and the 2 clean cases pass.Local runs under the verify lock (head 7c65f8b)
The full
@object-ui/app-shellsuite and every other family run in CI (Test UI,Type Check UI); their check-runs are the verdict.Acceptance notes
maina view'sconditionalFormatting[].conditionis not CEL-linted at save at all (validate-expressionslints a field's ownconditionalFormatting; theviewwrite path runs the bulk-confirm text pass only), so refusing it there would be a new gate. Not filed.Verification
Read first:
ConditionalFormattingEditor.tsx: the newfieldDefsprop and its pass-through toCelPredicateField.ListViewMoreSection.tsx:fieldDefsbuilt fromfieldCatalogonly when it is loaded (riskiest hunk:undefinedwhile loading means no list judgement until the catalog arrives).ViewVariantInspector.tsx:celFieldDefsfrom the same catalog the field name list comes from.Two-minute check: in Studio, open a list view of an object with a multi-select field, add a conditional formatting rule and type
record.FIELD == 'x'for that field: the box shows "holds a list" with theinrewrite and the view does not save; type'x' in record.FIELD: the finding clears.Generated by Claude Code