Repository navigation
feat(types): a related list's filter and add-picker filter take a view filter's any-of group - #28466
Conversation
…w filter's any-of group
The @object-ui/types mirror of record:related_list typed `filter` and
`add.picker.filter` as flat ViewFilterRule[] while the spec carriers take
ViewFilterElement (a rule or an `{ or: [...] }` group). Widen the mirror,
the RelatedList props it flows into, and the related-actions input's
resolved filter together; widening the mirror alone is a TS2322 in
record-related-list.tsx. Types only, runtime unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX3FadPoTM1W7TqHHf
|
domain:ui#4 · os-sales · session_01L6bhgWqjXeTcS3jtug46Dv 维护者速读
席位意见:ACCEPT,落地前提是 #28370 先合。旧 pin 原本就写明「等 console 能读组(#28370)后同步放宽」,这次是按 pin 自己定下的方向收口。 席位核对 — ACCEPT · domain:ui#4 · Head-sha
|
|
triage#1 · os-tesla · session_01L9qibw58ehQ2gRHP2h2Puz Contract-review-claim: |
|
triage#1 · os-tesla · session_01L9qibw58ehQ2gRHP2h2Puz Contract reviewServed-tier: ① Contract → face
② Declarations
③ Pins and ablations
④ Landing order and traps
Implemented-by: VERDICT: PASS |
Requested by Sales · project thread
Fixes #28462
Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none (a TypeScript face widens to what the spec carriers already declare; no authorable key, value or skill-taught shape moves)
Landing order: lands after the PR for #28370 (the console reader that teaches
@object-ui/core'stoFilterNodethe{ or }group). Until then a typed author could write a group the related list does not yet lower. Recorded on the card as claim amendment 6548122377.维护者速读
filter和"添加"选择器的filter,在@object-ui/types、@object-ui/plugin-detail的RelatedList属性、@object-ui/react的相关操作输入三处,类型从"只收普通规则"放宽为"普通规则或{ or: [...] }任一组"。ui/packages/types/src/record-components.ts(两个字段)、ui/packages/plugin-detail/src/RelatedList.tsx(两条 prop)、ui/packages/types/src/__tests__/related-list-filter-or-group-28462.test.ts。cd ui && pnpm exec vitest run packages/types/src/__tests__/related-list-filter-or-group-28462.test.ts,预期 18 个用例全过。What changes
RecordRelatedListComponentProps.filterand.add.picker.filter(@object-ui/types):ViewFilterRule[]→ViewFilterElement[]from@objectstack/spec/ui, the elementRecordRelatedListPropsdeclares for both keys.RelatedListProps.filter(ViewFilterElement[] | FilterNode) andRelatedListProps.add.picker.filter(ViewFilterElement[]) in@object-ui/plugin-detail.ResolveRelatedRecordActionsInput.filterin@object-ui/react(ViewFilterElement[] | FilterNode):record-related-list.tsxhands it the resolved list filter. Added to the file surface by claim amendment 6548186999. Its one implementer, app-shell'sRelatedRecordActionsBridge, passes it toexactRecordListFilter(sources: readonly unknown[]), so nothing there changes.related-list-filter-rule-array-10199andrelated-list-add-picker-filter-mirror-9964held the face at "the contract minus the group" until the console read it. They now hold the face equal to the contract.@object-ui/typescarries these keys (therecord:related_listnode is spec-owned by reference inzod-mirror-parity.test.ts), so no zod twin or parity row moves.Tests
ui/packages/types/src/__tests__/related-list-filter-or-group-28462.test.ts. For each key (filter,add.picker.filter) it compiles authored values against the real mirror source: a group alone and a group beside a rule are accepted; a nested group, a group of tuples and{ any: [...] }are refused; plus two controls. Every compiler verdict is compared with the protocol's own parse. A second leg compiles against the mirror with that one key put back toViewFilterRule[]and must flip exactly the two accepted groups. Type-level legs include@ts-expect-errorfor a nested group, and a reader that reads.fieldwithout narrowing.ui/packages/plugin-detail/src/__tests__/RelatedList.filterOrGroup-28462.test.ts: type-levelEquallegs for the twoRelatedListprops and the react input, and the authoring face flowing into all three without a cast.Acceptance notes
ornode beside the parent scope" assertion is not in this PR. The lowering is Console list query and filter builder do not read a stored view filter's any-of group #28370'stoFilterNodechange, and onmain4bc963catoFilterNodepasses a group element through unlowered. Agreed with the seat: types only here, and this PR lands after Console list query and filter builder do not read a stored view filter's any-of group #28370's PR.claude/project-thread-l8kwol(notclaude/issue-28462-*), as named in the claim.Verification
Premise on main 4bc963c: widening only the mirror reds Type Check UI
pnpm --filter @object-ui/plugin-detail type-check→ exit 2, three TS2322 insrc/renderers/record-related-list.tsx: L308 (filter: resolvedListFilter→ResolveRelatedRecordActionsInput.filter), L693 (filter={schema.filter}), L695 (add={…}→picker.filter).Type-checks and tests (head fa7ade4)
pnpm --filter @object-ui/types type-check,@object-ui/react type-check,@object-ui/plugin-detail type-check: all exit 0 (each runstsc -p tsconfig.test.json, so the new type legs are compiled).pnpm exec turbo run build --filter='@object-ui/app-shell^...'thenpnpm --filter @object-ui/app-shell type-check: VERDICT command-exit 0.cd ui && pnpm exec vitest run packages/types/ …RelatedList.filterOrGroup-28462… RelatedList.listFilter: 388 files, 10461 tests passed.cd ui && pnpm exec vitest run packages/plugin-detail/ packages/react/src/context/: 371 files passed (1 skipped), 3325 tests passed (18 skipped).Ablation (fix committed first; restore leg blob == HEAD)
RelatedList.tsxpicker prop back toViewFilterRule[](viascripts/ablation-replace.mjs, anchor 1 → 0):pnpm --filter @object-ui/plugin-detail type-checkexit 2, TS2322 atrecord-related-list.tsx(695,9). Restored: bloba60e4b47== HEAD blob,git diff HEADempty.record-components.tsadd.picker.filterback toViewFilterRule[]: the new types test → 4 failed / 14 passed (both accepted-group cases, the parse-agreement case and the flip case on the picker key). Restored: blobd57883f6== HEAD blob.Derived gates (dispatch-gates --commands at fa7ade4)
34 commands run, every one exit 0 (incl.
check-sdui-manifest.mjsand its--self-test,check:nul-bytes,check:published-files,check:type-check-coverage,check:type-check-debt,check:undeclared-dep-imports).--ranreconcile: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. Type Check UI and the other type-check lanes are CI's.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgX3FadPoTM1W7TqHHf