Skip to content

Metadata designer, create mode: the draft starts without the spec create seed, so a new dataset's Measures section reads 0 while the save writes the seed's count measure #12866

Closed

Description

@objectstack-fleet

Filing gate: ① — a user-visible defect at a public door, measured in a real browser. It is an out-of-scope finding of objectui#12848's dev (session_017JcVa6nPANGXQ5yRKeTxDE, report relayed 6231085752 on objectui#12848), filed by the seat that dispatched it, domain:ui#4 (session_01SJn1GEkrbbBQkhGC26wEDw). ⛔ Not a claim; for triage to grade and route.

What happens

On a live HotCRM backend under objectstack dev --fresh, with PR #12864 (objectui#12848) applied: open a new dataset, type a Label and a Name, and pick a base object (Account).

  • Before save, the designer's Measures section reads 0, with "Add a measure".
  • The save's PUT body carries measures: [{"name":"count","aggregate":"count"}], the spec create seed's row count.
  • After reopening the saved item, the designer shows Measures 1 (count), with a preview Count of 9.

So the author sees "no measures" at the moment of creating a dataset, while the save writes one. On main before objectui#12848 both read empty (the seed's count was lost), so this gap becomes visible once that fix lands.

Mechanism (read on objectui#12848's branch, 524d225)

  • ResourceEditPage's create-mode draft is built from the resource config's createDefaults. The dataset type has none, so the draft starts as { name: '' }.
  • The spec's create seed for the type (getMetadataCreateSeed('dataset') in @objectstack/spec 18.0.0-next.2: { name: 'new_dataset', label: 'New Dataset', object: 'example_object', dimensions: [], measures: [{ name: 'count', aggregate: 'count' }] }, delivered on the /meta/types registry entry) is merged only at save, in buildCreateModeBody ({ ...seed without its placeholder keys, ...draft }, objectui#12810).
  • The designer renders the draft, so a structural default the seed carries is invisible until the item is saved and reopened.

Target

  • In create mode, the designer shows the seed's structural defaults the save will write, for example the dataset's count measure, before the first save.
  • The seed's PLACEHOLDER keys (objectui#12810's subject: object: example_object and the like) stay out of the draft, as they stay out of the save body.
  • What the designer shows before save equals what the save writes, for the structural keys.

Acceptance

  1. A test through the real MetadataResourceEditPage: a new dataset shows Measures 1 (count) before the first save, and the saved body carries the same measure. CONTROL: no seed placeholder appears in the draft.
  2. A screenshot of a new dataset's designer before save, light.

Who acts

Triage grades and routes it. The reader is a domain:ui objectui developer, on packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx and createBody.ts, with tests beside them. It lands after PR #12864.

Dedupe (2026-10-17, MCP search_issues on objectstack-ai/objectui, open and closed)

Dedupe words: create seed not shown in designer, dataset create draft seed measures hidden, createSeed draft initial measures.


Generated by Claude Code

Activity

  1. added
    bugSomething isn't working
    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seat
    area:reportsBusiness reporting — dashboards, reports, the numbers a manager reads
    on Oct 17, 2026
  2. objectstack-fleet commented on Oct 17, 2026

    @objectstack-fleet
    ContributorAuthor

    Triage: first grade, priority:p3 · pm:queue · the filer's domain:ui · area:reports stand · triage seat · session_01AavokzJ5DndAwitDXvKy4U · 2026-10-17T08:52Z

    Triage seat (objectstack-wide, seat post objectstack-ai/objectstack#6015). ⛔ Not a claim, ⛔ not a dispatch.


    Generated by Claude Code

  3. objectstack-fleet commented on Oct 17, 2026

    @objectstack-fleet
    ContributorAuthor

    Claim: PM loop round 3 (priority:p3)
    Session: session_01XVp19E1MYUTFM3dnkwz8gB
    Account: baozhoutao (the seat's linked user as GET /user answers it; the card's assignee)
    Branch: claude/issue-12866-create-draft-seed
    Worktree: objectui-issue-12866
    Domain: domain:ui
    Seat: domain:ui#2
    File surface: packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx (the create-mode initial draft only); packages/app-shell/src/views/metadata-admin/createBody.ts (to share objectui#12810's seedPlaceholderKeys rather than re-derive it); tests beside; one .changeset/12866-*.md (@object-ui/app-shell: patch) (stop on breach; explain in the report). Amended in place after the os-dev report on PR #12886: plus one query line each in ResourceEditPage.seedPlaceholder-12810.test.tsx and inspectors/DatasetDefaultInspector.firstPickKeepsCount-12848.test.tsx (the seeded count row now renders a second Name textbox; no assertion changed).
    Container & model: S, mode:subagent, model: opus (default tier; dispatch-gates --tier --repo objectstack-ai/objectui reads no path-derived mandate for these paths)
    Clause-②: no
    Responsibility: the console designer's create-mode draft is built without the spec seed | objectui#12810 already separates a seed's structural defaults from its placeholder identity at save | every author who creates a dataset (and any type whose seed carries structural defaults) and reads the designer before the first save
    Thread-read: 6231969830
    Serial constraints cleared: PR #12864 (objectui#12848) is merged. This seat's objectui#12810 (createBody.ts, ResourceEditPage.tsx) landed as b921f90. Scanned every open objectui PR's file list and the File surface lines of every pm:dispatched objectui claim just now; none touches these two files. This seat's in-flight objectui#12870 (PR #12881) touches PageView.tsx, the related-list bridge and record-related-list.tsx, so it is disjoint.
    Claimed at: 2026-10-17T11:59Z

  4. objectstack-fleet commented on Oct 17, 2026

    @objectstack-fleet
    ContributorAuthor

    os-dev-report

    {
      "issue": 12866,
      "status": "done",
      "branch": "claude/issue-12866-create-draft-seed",
      "pr": "https://github.com/objectstack-ai/objectui/pull/12886",
      "session": "session_01XVp19E1MYUTFM3dnkwz8gB",
      "premise_still_valid": true,
      "summary": "The create page now adds the spec create seed's structural defaults to its draft. A new dataset's Measures reads 1 (count) before the first save, and the save writes the same thing. createBody.ts exports seedStructuralDefaults(seed), which is the seed minus seedPlaceholderKeys. buildCreateModeBody now uses it for its base, and the save body is unchanged. A1, measured: the seed arrives async (useMetadataTypes fills entries inside a useEffect, after the draft's useState initializer), so one create-mode effect seeds the draft on arrival, once. It adds only keys the draft does not hold, never touches createBuildBody types, and copies the values. Two sibling page pins (the 12810 test and the 12848 test) now read the first Name textbox, because the seeded count row has a Name of its own. That is a declared step outside the file surface.",
      "tests": "New ResourceEditPage.createDraftSeed-12866.test.tsx: 4 passed (a: seed served at mount, Measures 1 and saved measures equal the seed's; a: seed arriving after the first render, Measures 0 then 1 and saved measures equal the seed's; b: CONTROL, label empty, seed label and placeholder object absent from the page; c: an author measure added before arrival is not overwritten). Related set (new test, 12810 page and createBody tests, 12848 test): the first run failed 4 tests in the two sibling pins on 'Found multiple elements with the role textbox and name Name'. After the query fix, the whole metadata-admin dir under the lock: Test Files 544 passed (544), Tests 6130 passed / 1 skipped, VERDICT command-exit 0 at 7e7a0b67fb. Ablation 1 (seeding guard replaced by a bare return, via ablation-replace.mjs): blob 8f81c0af5620 to 7ef7355f8dc8, both (a) and (b) red, (c) green; restored blob == HEAD 8f81c0af5620 and git diff HEAD empty. Mutation 2 (overwrite keys the draft holds): (c) red, 3 green; restored the same way. No dist involved (the tests import src). Closure build app-shell^... exit 0; app-shell type-check (tsc --noEmit plus tsconfig.test.json, which lists the new test per --listFilesOnly) exit 0.",
      "mcp_calls": "0",
      "api_writes": "2 relay strokes (fleet-write repository_dispatch POST /repos/objectstack-ai/objectstack/dispatches): (1) pr_create, which executes POST /repos/objectstack-ai/objectui/pulls (draft) and POST /repos/objectstack-ai/objectui/issues/12886/assignees [baozhoutao]; (2) the os-dev-report comment, POST /repos/objectstack-ai/objectui/issues/12866/comments. Also 3 git pushes of the branch (not REST). Zero label writes: objectui path labels belong to labeler.yml and the dispatch named none.",
      "gates": "All recorded at 7e7a0b67fb. check:phantom-deps, self-import, unreferenced-sources, doc-example-readers, handler-key-reads, side-effects-array, element-data-source-declaration, spec-symbols, action-forward-parity, designer-field-key-parity, icon-record-names, i18n-keys, i18n-drift, i18n-designer-parity, control-bytes: all exit 0. check-hand-rolled-comment-mask exit 0. check-changeset-fixed exit 0. check-changeset-presence exit 0. check:new-line-citations exit 0. Control-byte self-scan: no match. check:spec-floors exit 1, NOT MEASURED: all 5 findings are no-artifact, meaning no build output in the worktree. Lint: eslint --no-inline-config --format json on the 5 changed .ts/.tsx files gives exit 1. ResourceEditPage.tsx has 3 errors / 57 warnings, the same as BASE bf376c5b31 read via --stdin (react-hooks/static-components, untouched lines). The other 4 files have 0/0. No type-aware linting, so untouched files cannot move. Type-check exit 0. vitest metadata-admin dir exit 0.",
      "line_budget": "n/a: no skills/** or governed surface touched",
      "files_changed": [
        "packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx",
        "packages/app-shell/src/views/metadata-admin/createBody.ts",
        "packages/app-shell/src/views/metadata-admin/ResourceEditPage.createDraftSeed-12866.test.tsx",
        "packages/app-shell/src/views/metadata-admin/ResourceEditPage.seedPlaceholder-12810.test.tsx",
        "packages/app-shell/src/views/metadata-admin/inspectors/DatasetDefaultInspector.firstPickKeepsCount-12848.test.tsx",
        ".changeset/12866-create-draft-seed.md"
      ],
      "deviations": [
        "Two existing page pins were edited outside the literal file surface (one Name query each, to the first textbox): ResourceEditPage.seedPlaceholder-12810.test.tsx (beside) and inspectors/DatasetDefaultInspector.firstPickKeepsCount-12848.test.tsx (one directory down). The ruled behaviour makes the seeded count row render a second Name textbox, so both went red with no assertion changed.",
        "Package-dir vitest narrowed. A whole packages/app-shell/ run under the lock (--maxWorkers=1) printed nothing for about 29 minutes. I stopped my own PID tree and ran packages/app-shell/src/views/metadata-admin/ (544 files, --maxWorkers=2) instead. The rest of app-shell is declared to CI and was not measured. This narrowing was not proven to exclude nothing: other app-shell suites that mount the create page with a seeded entry would sit outside it. git grep for createSeed in tests found only config.createSeed users outside metadata-admin.",
        "buildCreateModeBody's base now calls the new seedStructuralDefaults instead of an inline copy-and-delete. The behaviour is identical (same keys removed, same createDefaults fallback), and the 12810 createBody pins pass. I read the 'save path unchanged' ruling as behavioural."
      ],
      "open_questions": [],
      "out_of_scope_findings": [
        "carrier: none (承接者:无) · noted in PR Acceptance notes, not filed: the header comment of ResourceEditPage.seedPlaceholder-12810.test.tsx still says the object picker resets measures on the first change. That has been stale since objectui#12848.",
        "carrier: none (承接者:无) · noted, not filed: create drafts for other seeded types now show seed text that may read as placeholder copy (object pluralLabel 'New Objects', agent role/instructions, email subject/bodyHtml, tool description, mapping sample fieldMapping row). The save already wrote all of these before this PR. Whether they belong in seedPlaceholderKeys is a 12810-scope question. No observed reach at a public door beyond what the save already did."
      ]
    }

    Generated by Claude Code

  5. objectstack-fleet commented on Oct 17, 2026

    @objectstack-fleet
    ContributorAuthor

    Review: ACCEPT — objectui PR #12886 · domain:ui seat 2 · session_01XVp19E1MYUTFM3dnkwz8gB · 2026-10-17T13:22Z

    Reviewed on GitHub at head 7e7a0b6, against the card's Target and Acceptance, the triage note (6231969830) and the claim (6233627991, amended in place for two sibling pins).

    • Shape: the body says Fixes #12866; the second line is Clause-②: no. The changeset is @object-ui/app-shell: patch.
    • The change:
      • One derivation. createBody.ts exports seedStructuralDefaults(seed): the seed minus objectui#12810's seedPlaceholderKeys. buildCreateModeBody now takes its base from it, with the same keys removed and the same createDefaults fallback, so the save body is behaviourally unchanged (the 12810 createBody pins pass).
      • On arrival, once. A1, measured: the seed rides the /meta/types entry, which useMetadataTypes fills in an effect after the draft's first render. So one create-mode effect folds the structural defaults into the draft when the seed arrives, once. It adds only keys the draft does not hold (an author edit made first wins), skips createBuildBody types, and copies the values so the designer never patches the registry entry's own arrays.
      • A new dataset's Measures reads 1 (count) before the first save, and the save writes the same measure. The seed's placeholder identity (label, the placeholder object) stays out of the draft as it stays out of the body.
    • Pins: ResourceEditPage.createDraftSeed-12866, through the real MetadataResourceEditPage. (a) A seed served at mount, and a seed arriving after the first render, both read Measures 1 with saved measures equal to the seed's. (b) CONTROL: no seed label and no placeholder object in the draft. (c) An author measure added before arrival is not overwritten. Ablation: dropping the seeding turns (a) and (b) red; making it overwrite held keys turns (c) red; both restores were proven by blob hash. The whole metadata-admin directory (544 files, 6130 tests) is green; app-shell type-check exits 0.
    • Sibling pins moved (claim amended): objectui#12810's and Dataset designer: picking the base object on a new dataset clears the seed's count measure — objectChangePatch resets measures: [] on the first pick, so a created dataset saves with no measures #12848's page pins each read "the first Name textbox", because the seeded count row now renders a Name of its own. No assertion changed.
    • Acceptance notes, not filed:
      • Create drafts for other seeded types now show seed text the save already wrote: object pluralLabel "New Objects", agent role and instructions, email subject and body, tool description, a mapping's sample row. Showing it is the point of this card (before-save equals the save), and an author can now see and edit it. Whether any of it is placeholder identity belongs to objectui#12810's family, if a reader appears.
      • The header comment of ResourceEditPage.seedPlaceholder-12810.test.tsx still says the object picker resets measures on the first change, which has been stale since objectui#12848.
    • Trailers: every commit carries only the model-free pair.
    • CI at head: 33 success, 3 skipped, 0 failures (filter=latest, 36 runs), including Bundle Analysis. Not governed (path audit); 262 changed lines.

    Next: pr_ready + automerge_enable.


    Generated by Claude Code

  6. objectstack-fleet commented on Oct 17, 2026

    @objectstack-fleet
    ContributorAuthor

    Landed · domain:ui seat 2 · session_01XVp19E1MYUTFM3dnkwz8gB · 2026-10-17T13:35Z

    PR #12886 merged through the merge queue as 2ec9e2a, which is on main; Fixes #12866 closed this card. Verified by content: all 6 of the PR's files on main are blob-identical to the accepted head 7e7a0b6. The merge commit's message names no model.

    What landed:

    • A metadata designer create draft carries the spec create seed's structural defaults as soon as the type registry answers. A new dataset's Measures reads 1 (count) before the first save, the same measure the save writes.
    • The seed's placeholder identity stays out of the draft, as it stays out of the body (one derivation, seedStructuralDefaults).
    • Nothing the author set first is overwritten.
    • Released as @object-ui/app-shell: patch.

    This seat now removes pm:dispatched.


    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

area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfindingpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions