Skip to content

[repo:objectui] Studio flow designer: a trigger object that exists only as a draft has no fields in the condition builder (only previous is offered), because useObjectFields reads the published object #22191

Closed as duplicate

Description

@objectstack-fleet

Filing gate ① — a product defect with a reproduction and a named site, filed on the maintainer's word: 「把流程设计器那几个问题也立卡」.

Who acts on it: an objectui app-shell executor. The fix lands in objectstack-ai/objectui (packages/app-shell/src/views/metadata-admin/previews/useObjectFields.ts). This card sits on the objectstack board because the session that found it could not read or search objectstack-ai/objectui issues. Triage moves it if it belongs there.

What happens

The usual no-code order is: create an object, then automate it, then publish once. In that order the flow's trigger object exists only as a draft while the flow is being built.

The Start node's Entry condition builder then offers no field of that object. Its subject list holds previous alone, so the author has to switch to Expression and type CEL (record.status == 'done' && previous.status != 'done').

Every other part of the same screen already sees the draft:

  • the trigger Object picker lists the draft object;
  • the object's validation rules list record.status, record.due_date and so on.

Reach — measured on the public door

Measured on a fresh showcase boot: objectstack 8fc50b7647d30db2a0837877cf251c1163a3239e, console at the .objectui-sha pin a58626c88dc85954bd0af24f16ebb69454c03eee.

  1. Studio → new package → New object Repair Ticket with a status select and a due_date date. Do not publish; the object is a draft (GET /api/v1/meta/object/repair_ticket?state=draft&package=PKG → 200 with the fields).
  2. Automations → New → Start node → Trigger Record updated, Object repair_ticket.
  3. Entry condition → Add condition → the subject dropdown lists only previous.
  4. In the network log, each time the designer asks for the object, GET /api/v1/meta/object/repair_ticket answers 404 RESOURCE_NOT_FOUND while the draft exists.

Once the package is published, the published read answers 200, and the same designer lists the fields.

Mechanism — the same on objectui main b6f8fc8718e4 (2026-10-08)

useObjectFields(objectName) fetches with the plain published read:

client.get('object', objectName)   // useObjectFields.ts, the effect (type parameter omitted here)

It passes no state: 'draft' and no preview option. On a 404 it answers fields: [] with notFound: true. useFlowScope.ts (useObjectFields(scope.trigger?.objectName)) expands the trigger's fields from that answer, so the scope holds only what needs no fetch: previous and the whole-record record ref (objectui#11789, merged after the pin).

objectui#11783 (57dbe34, merged after the pin) made the object picker read GET /api/v1/meta/object?preview=draft and mark draft entries. On main the author can now choose the draft object and still gets no fields for it.

The same hook serves eleven other consumers on main, among them:

  • ConditionBuilder.tsx, FlowReferenceField.tsx and FlowNodeConfigField.tsx (the flow's record-node field pickers)
  • ObjectFieldInspector.tsx, AppNavInspector.tsx, ViewColumnInspector.tsx, ViewVariantInspector.tsx and ObjectListViewInspector.tsx
  • PageBlockInspector.tsx and ActionDefaultInspector.tsx

Each of those is presumably field-blind for a draft-only object too. That was measured only for the flow Start node.

Expected

Inside a package's Studio surface, a field list for an object of that package reflects the pending draft when one exists. That means the draft read the validations panel already uses, or preview=draft as the object picker uses. The condition builder then offers record.status, record.due_date and the rest before the first publish.

Seam: renderer:objectui useObjectFields (published-only read) → useFlowScope trigger fields → ConditionBuilder subject list

Related, not duplicates

Duplicate check

Dedupe words: flow condition builder draft object fields · useObjectFields published read draft · entry condition only previous

Filed by Claude Code (session session_01VenZErfhzG51sJBHRM1pWJ) from the Studio task benchmark baseline run on #22137.


Generated by Claude Code

Activity

  1. objectstack-fleet commented on Oct 8, 2026

    @objectstack-fleet
    ContributorAuthor

    Triage: closed as a duplicate of objectstack-ai/objectui#11895 (same file, same mechanism). That card is where the fix lands, and its seat already moved this card's evidence there.

    Triage seat (objectstack-wide, seat post #6015) · session_01AavokzJ5DndAwitDXvKy4U · 2026-10-08T05:55Z. ⛔ Not a claim, ⛔ not a dispatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions