Repository navigation
fix(app-shell): the Studio CEL editor refuses == / != on a list field while typing - #36441
Conversation
Claude-Session: https://claude.ai/code/session_01QsR2jREBdDtYvSLn38xUCg Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jREBdDtYvSLn38xUCg Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jREBdDtYvSLn38xUCg Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jREBdDtYvSLn38xUCg Final head: |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH 席位核对L1 (L1-e) on head Owed
Read and accepted
A delta ACCEPT on the next head follows if it adds only the helper merge, the corrected sentence and the card line. |
… the draft check Claude-Session: https://claude.ai/code/session_01QsR2jREBdDtYvSLn38xUCg Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH 席位核对L1 (L1-e) delta on head
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jREBdDtYvSLn38xUCg K = 21 ( |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jREBdDtYvSLn38xUCg Landing: L1-e delta ACCEPT 7079466549 (head ef81978; the move to |
Requested by Steedos · project thread
Fixes #36219
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
CelPredicateFieldtakes a new optionalfieldDefsprop (each field'sname,type,multiple). It reads them throughmultiValueFieldsOf(clientValidation.ts), the object draft check's own derivation overisMultiValueField(@objectstack/spec/data), and puts the list-valued names into the lint hint asmultiValueFields.celAuthoring.tsalready spread that key intovalidateExpression, so it needed no change, andpackages/formulais untouched.The editor hands over
multiValueFieldsonly, notfieldTypes, so it judges list fields exactly as the save-side draft check does. AddingfieldTypeswould also turn on the type-soundness advisories, which the save path does not pass either. That is a separate behaviour and is not in this card.Shared point vs. threading.
CelPredicateFieldknows onlyobjectNameand field names. Loading the object catalog inside it (useObjectFields) would read the saved object, while the object designer edits an unsaved draft, so the editor would judge stale fields. The mounts already hold the right definitions (the draft'sview.entries, the condition builder'sfields), so each inspector mount passes them. The list-field derivation exists once:multiValueFieldsOfinclientValidation.ts, now exported and taking{ name, type, multiple }definitions. The draft check calls it with itsview.entriesmapped to that shape, andCelPredicateFieldcalls it withfieldDefs, so the editor and the save judge the same fields as lists. It lives there and not incelAuthoring.tsbecause that module deliberately carries no import at load, and the helper needsisMultiValueField.Every
CelPredicateFieldmount (app-shell, non-test, at this head)inspectors/ObjectFieldInspector.tsxformula (expression,role="value")fieldDefs={celFieldDefs}inspectors/ObjectFieldInspector.tsxstored expressioninspectors/ObjectFieldInspector.tsxvisibleWheninspectors/ObjectFieldInspector.tsxreadonlyWheninspectors/ObjectFieldInspector.tsxrequiredWheninspectors/ConditionBuilder.tsxraw CEL boxfieldDefs={fields}(the catalog the builder already holds,type+multiple, hidden fields included)ConditionalFormattingEditor.tsx(view conditional formatting,scope="record")multiValueFields. Noted below.PermissionMatrixEditor.tsxfieldwhen(RLS CHECK, flattened)faultOutcome: 'run-fails', which this lint never sends, so the hint would change nothingPermissionAdvancedFacets.tsxRLSUSINGPermissionAdvancedFacets.tsxRLSCHECKTests
New file
ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.listEquality-36219.test.tsx, against the real@objectstack/formula. It drives the inspector'svisibleWhenmount:record.stage == 'qa'on aselectdeclaredmultiple: trueholds Save (the blocking count is 1) and shows the`record.stage` holds a listrefusal.record.single == 'qa'on a plainselectis clean (count 0, no refusal).Runs (head ef81978)
ObjectFieldInspector.celGate,ObjectFieldInspector.hostBanner-12681(it mocksclientValidationby spreading the original),CelPredicateField.testand everyclientValidation*test file, under the lock:Test Files 16 passed (16) · Tests 252 passed (252).pnpm --filter @object-ui/app-shell run type-check: TYPECHECK_EXIT=0, lock VERDICT command-exit 0.Earlier head 349fc44:
ObjectFieldInspector.celGate,CelPredicateField.test,clientValidation.listEquality-36167):Test Files 4 passed (4) · Tests 41 passed (41), lock VERDICT command-exit 0.scripts/ablation-replace.mjs, anchorfields: fieldNames, multiValueFields, clause→fields: fieldNames, clause, x1 → x0, blob 442c5c89c717 → c3bf3117bfe8): the multiple-select case went red at the blocking-count wait (line 74) and the scalar control stayed green,Tests 1 failed | 1 passed (2). Restored: blob == HEAD (442c5c89c717) andgit diff HEADis empty. There is nodist/leg because the test resolves app-shell from source.pnpm --filter @object-ui/app-shell run type-check(bothtsc --noEmitandtsc -p tsconfig.test.json, so it covers the test) after building the@object-ui/app-shell^...closure: TYPECHECK_EXIT=0, lock VERDICT command-exit 0.Acceptance notes
ConditionalFormattingEditor.tsxlintsrecord.FIELDatscope="record"and would acceptfieldDefsthe same way. I left it alone because it is outside this card's inspector ruling, and no save-side check that this card could compare against refuses the shape there. carrier: ui: conditional formatting accepts == on a list field, so the rule is stored and never matches #36459CelPredicateFieldis not exported from@object-ui/app-shell's published surface: the package isprivate: true. Adding an optional prop therefore changes no built.d.tsthat anything outside the package reads.Verification
Read first:
CelPredicateField.tsx, themultiValueFieldsOfhelper and the hint line in the debounced lint effect (the risk is the effect's dependency keymultiKey); then thecelFieldDefsline inObjectFieldInspector.tsx.Two-minute check:
cd ui && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.listEquality-36219.test.tsx --maxWorkers=1. Expect 2 passed.Generated by Claude Code