Skip to content

Related-list toolbar “+ New” does not consume userActions.create predicates — spec 17.0.0 shipped the declaration half, the renderer half is missing (createPredicates produced but never consumed) #4646

Description

@baozhoutao

Summary

@objectstack/spec@17.0.0 widened userActions.create from a plain boolean to z.union([z.boolean(), RowCrudActionOverrideSchema]) (spec src/data/object.zod.ts:1529, the #7692 family). The docblock defines the semantics: the create toolbar affordance is evaluated once against the record of the scope it sits in — on a record page's related list, that is the host parent record. The spec CHANGELOG entry for that change states explicitly:

"The renderer half — the related-list toolbar honouring create.visibleWhen — is objectui's downstream card and is not part of this change."

This is that downstream card: as of @objectstack/console@17.0.0 (stable), the renderer half does not exist.

Evidence (17.0.0 stable, dist-level survey)

So for create, someone produces the predicates and nobody consumes them — the exact inverse-symmetry gap the spec CHANGELOG called out.

Motivating scenario (observed in a downstream EHR project)

A parent record enters a frozen state (published / deprecated):

  • Row-level Edit/Delete on the related list correctly grey out / hide via their predicates. ✅
  • The related-list toolbar “+ New” stays fully enabled. ❌ The user fills in the entire child form, submits, and only then gets a server-side 409 rejection.

This is precisely the motivation scenario described in the spec CHANGELOG entry for the userActions.create widening. (No security surface — the server gate holds — but the UI walks the user into a form that is guaranteed to fail, while sibling affordances on the same rows are correctly gated.)

Expected

The related-list toolbar consumes userActions.create.visibleWhen / disabledWhen, evaluated once against the host parent record (per the spec docblock), on top of the existing o.create && can(childObject, 'create') check — mirroring how editPredicates / deletePredicates are already consumed on the same surface.

Related

Activity

  1. added theissue type on Aug 17, 2026
  2. os-zhuang commented on Aug 17, 2026

    @os-zhuang
    Contributor

    Triage: pm:queue, type Bug. The spec CHANGELOG for the userActions.create widening names this exact downstream card; the renderer half is missing (createPredicates produced, zero consumers, vs ~15 consumption sites for edit/delete). Declared≠enforced restoration on a surface with the plumbing in hand (parentId available; mirror editPredicates consumption, evaluated once against the host parent record per the spec docblock). Serial note: shares the RecordDetailView/list-toolbar surface with #4647 — dispatch serially or to one dev.


    Generated by Claude Code

  3. self-assigned this
    on Aug 18, 2026
  4. yinlianghui commented on Aug 18, 2026

    @yinlianghui
    Collaborator

    认领(与 #4647 合单)(PM 派发,objectui 分片,批次 23):session_01GTRjn8xBqp75dk7kFupVRt,分支 claude/issue-4646-toolbar-action-gates,os-dev 席即将开工。

    按分诊席 serial note(两卡共享 RecordDetailView/list-toolbar 面)采合单先例:一席双卡,PR 用 Fixes #4646 + Fixes #4647。本卡半:related-list toolbar「+ New」消费 createPredicates(对 host parent record 求值一次,per spec docblock),镜像同面 editPredicates 的既有消费形。当前在飞席位为零,无文件冲突。


    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

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions