Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

importPredicates is produced by the spec resolver and consumed nowhere — the same inverse-symmetry gap as #4646, one key over #5142

Closed

Description

@yinlianghui

Summary

Found while implementing #4646 (related-list "+ New" consuming createPredicates).

@objectstack/spec@17.0.0 widened both toolbar-scope keys, not just create. UserActionsSchema (spec src/data/object.zod.ts:1528-1531) types them identically:

create: z.union([z.boolean(), RowCrudActionOverrideSchema]).optional()
import: z.union([z.boolean(), RowCrudActionOverrideSchema]).optional()

…and resolveCrudAffordances emits a predicate envelope for each (spec object.zod.ts:2472 and its neighbour). The CrudAffordances docblock states the binding for both in one breath:

> createPredicates — "CEL predicates for the generic New button … these evaluate once per toolbar, against the record in scope where the toolbar renders"
> importPredicates — "Toolbar-scope CEL predicates for the CSV import entry; same binding as createPredicates."

#4646 closed the create half. The import half is still declared-and-inert: importPredicates has zero consumers in objectui src.

Verification (src level, on 958d7573a)

$ grep -rn "importPredicates" --include=*.ts --include=*.tsx packages/ apps/
(no matches)

Producer confirmed live against the installed spec:

$ node -e "…resolveCrudAffordances({managedBy:'platform', userActions:{ import: { enabled:true, visibleWhen:'record.frozen != true' } }})"
{ create: true, import: true, …, importPredicates: { visibleWhen: 'record.frozen != true' } }

Impact

An author can write the object form on userActions.import today — the spec accepts it and the resolver parses it — and objectui silently drops the predicate, offering the CSV import entry unconditionally. Identical shape to the defect #4646 recorded from a downstream EHR project, just on the adjacent key.

Not reported from the field, unlike #4646; whether that makes it lower priority or merely less-noticed is the triage call, not mine. Noting honestly that severity judged at filing time is unreliable in both directions.

Deliberately NOT done in PR for #4646/#4647

That PR widened objectui's local UserActionsOverride.create from boolean to the union so the shape it now honours also type-checks. It left import?: boolean narrow on purpose, with the reason in-code:

> widening the type ahead of a consumer would re-declare the inert-metadata defect this change removes, one key over.

So the type is currently the honest statement of what objectui supports. Fixing this issue means widening that key and adding the consumer together.

Where the consumer would go

Wherever the import entry is offered — the object-list toolbar's Import button. Mirror template is now in-tree: RelatedRecordActionsBridge's evalCreatePredicate + the visibleWhen fails-CLOSED / disabledWhen fails-SOFT split (PR for #4646).

Related

Activity

  1. self-assigned this
    on Aug 18, 2026
  2. yinlianghui commented on Aug 18, 2026

    @yinlianghui
    ContributorAuthor

    认领(PM 派发,objectui 分片,批次 23):session_01GTRjn8xBqp75dk7kFupVRt,分支 claude/issue-5142-import-predicates,os-dev 席即将开工。

    排序条件已满足:PR #5145(create 半 + 镜像模板 evalCreatePredicate)已落 main(dfc697554)。范围:对象列表工具栏 Import 入口消费 importPredicates(visibleWhen fail-CLOSED / disabledWhen fail-SOFT,与 create 半同形)+ 同 PR 放宽 UserActionsOverride.import 类型(卡面明确:类型与消费者必须同车,单放宽=重造 inert 缺陷)+ 测试 + changeset。与在飞席位零重叠(当前在飞 0,#5143 已收)。


    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

Labels

bugSomething isn't workingpm:queue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions