Skip to content

fix(studio): a refused metadata save draws a nested cause under the row its path names - #35623

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-g62vj4
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-g62vj4

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread
Fixes #35499

repo:objectstack#1 · os-sales · session_01L6bhgUjtFEFN5FLe377MBT

Clause-②: no
Metadata-protocol: none

Branch: claude/project-thread-g62vj4 — the branch this card thread's harness assigns and the only one it may push, so the repository's claude/issue-35499-* spelling is not available here (noted for the Duplicate Fix Guard).

维护者速读

  • 用户能看到什么变化:在 Studio 的元数据表单里保存被服务端拒绝时,如果原因在某个字段的更深一层(例如标签里写了不是语言代码的键、区域列表里某一项缺了子字段),红字现在会出现在那个字段下方,并带上「标签 → 键名」这样的路径;顶部汇总横幅不再重复同一条;保存按钮的提示末尾不再多出一个逗号。
  • 为什么做:这是上次「去掉空泛的输入无效提示」那次裁定里约定另开的表单一半,那次改完后约 25 个字段保存被拒时字段下没有任何红字。
  • 出错会怎样:最坏是某条原因显示的位置不够理想(落在上层字段而不是最深一层),或新建表单里子字段红字出现的时机变化;保存和拦截的判断完全不变,可以直接撤回。
  • 要你做什么:无。

What changes

One rule for every issue source (a 422 refusal, the live client pass, load-time diagnostics): an issue is drawn on the deepest row the form renders for a prefix of its path.

  1. SchemaForm groups its issues by the path's head segment (issuePathHead), not by the whole path. A row draws its exact issues as their message and a deeper issue led by the trail of the rest of the path, in the describeIssuePath shape: Label → not_a_locale: …, Areas → main → navigation: ….
  2. A row whose face is a nested form hands down the issues whose next segment names a row that nested form renders (splitRowIssues, prefix trimmed); the rows it renders are computed by the same function the nested body renders by (flatFormRowKeys), so the two cannot disagree. Anything else stays on the host row with its trail. Collection faces (repeater / object rows, record maps, code and CEL widgets) do not descend.
  3. Hidden and canvas-owned keys mount no row, so their issues stay in the banner exactly as before.
  4. The inline register is unchanged (a top-level row, mounted and not deferred). drawnInline and the banner filter now test the issue path's head against it, the key the form places by, so one mistake is one message (objectstack#27865) on a nested path too. A nested-form host row hands its own show-state to the nested rows (create-form deferral), so a handed-down issue is never hidden while its head counts as drawn.
  5. The refusal summary behind the Save button's reason skips the root slice's empty label, and a refusal held only at the root says the root entry's message — no leading or trailing comma. The refusal error line needed no change (it never joins labels).

Kept as ruled: issues.length stays out of the Save gate; err.body is not re-read; a path that does not localise still gates nothing (9073cf018); the server side of the #35400 ruling is not reopened.

Files to read first, by risk:

  1. ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx — the FieldRow placement hunk (nestedRows / splitRowIssues / lines) and the DeferIssueDisplayContext.Provider around a nested-form control.
  2. ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx — drawnInline, the banner errs filter, and the heldLabels summary.
  3. ui/packages/app-shell/src/views/metadata-admin/issuePath.ts — issuePathHead, issuePathRest, splitRowIssues.

Size: +178 / −52 in the three source files (+543 / −52 over 6 files with the two pin files and the changeset).

Tests

New card-named pins, one per design step plus the one-message pin:

  • SchemaForm.nestedIssuePlacement-35499.test.tsx — step 1 (trail under the head row, exact path as its message), step 2 (hand-down to the nested row; an unrendered next segment stays on the host; columns.0.field stays on the repeater row with Columns → #1 → field), step 3 (a hidden key draws nowhere and is never registered), step 4 (create form: touching a nested row reveals the host and the handed-down issue at the same moment).
  • ResourceEditPage.nestedRefusal-35499.test.tsx — the real page over a real parsed MetadataError: the objectstack#27865 one-message pin on three nested paths (each drawn once, no banner, no error line); a head no row renders keeps its banner line beside a nested cause drawn inline; step 5's two Save-reason cases (root only; root beside a located slice).

Existing pins moved: none. The whole metadata-admin directory ran green at a27d2d16 (the source at its final state; later commits touch only the two new test files): 757 files.

Test readings
  • New pins, final head 9af962ee, inside the ui/scripts/ run below: both files green: with them Test Files 173 passed | 2 skipped (175), Tests 5103 passed | 2 skipped (5105); the derived family alone Test Files 171 passed | 2 skipped (173), Tests 5092 passed | 2 skipped (5094); both os-verify-lock: VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/ at a27d2d16: Test Files 757 passed (757), Tests 8155 passed | 1 skipped (8156), VERDICT command-exit 0.
  • pnpm --filter @object-ui/app-shell type-check (tsc --noEmit and tsc -p tsconfig.test.json) at 9af962ee's source: VERDICT command-exit 0.
  • Ablation (committed first, node scripts/ablation-replace.mjs): anchor const head = issuePathHead(i.path); → const head = i.path; (exact-path grouping, the old rule). Mutation landed anchor 1 -> 0, blob 670759c1a461 -> 81a140586c01; the two pin files went Tests 7 failed | 4 passed (11) — every placement and one-message case red, the hidden-key, Save-reason and harness cases green as expected; restore blob == HEAD (670759c1a461) and git diff HEAD is empty. The pins import ./SchemaForm from source, so no build sits between the mutation and the run.

Acceptance notes

Driven in the running app (showcase backend objectstack dev --seed-admin on its own port, console Vite with DEV_PROXY_TARGET), on an app the run created (dogfood_35499): Source tab body with label: { not_a_locale: 'Dogfood' }, an area missing its navigation and carrying an unknown key, and an unknown top-level key; the auto-save is refused 422 with label.not_a_locale ×2, areas.0.navigation, areas.0, and the root entry.

  • After: Label row draws both Label → not_a_locale: … lines, the Areas row draws Areas → main → navigation: … and Areas → main: …, the banner lists only (root): Unrecognized key(s) … zz_bogus, and Save reads The server refused this draft — fix Label → not_a_locale, Areas → main → navigation, Areas → main before saving.
  • Before (the same three source files at e35cf035, same run): no row lit, the banner lists the label and area causes, and Save reads … Areas → main, before saving. (stray comma).
  • Screenshots: /mnt/project-files/build-seat1/35499/ (after-form.png, after-mdf-label.png, after-mdf-areas-label.png, before-form.png, and the Source tab shots).

Measured, not changed here:

  • The server's refusal of a view whose label is { not_a_locale: 'Tasks' } is exactly label.not_a_locale (invalid_key, invalid_format), no label head; a column with an unknown key is config.columns.0 (unrecognized_keys).
  • Rows the editor mounts with the refused issues, per type: object none (its curated home inspector replaces the form, so every object issue stays in the banner); view none that receive issues — the view designer's home inspector renders its own form for the variant (description, filter, sort, searchableFields rows) with no issues and no register, so a refused view save lights no row in the designer, before and after this PR (it is named by the error line, the Save reason and the Source tab); flow name, label, type, description, nodes, edges, variables. Under this design every live-pass issue at nodes.*, edges.*, variables.* is drawn on the Nodes / Edges / Variables row with its trail and leaves the summary banner (the canvas Problems list still lists them). The view acceptance in the dispatch was therefore driven on an app, whose form does draw refusal issues.
  • No nested-form row (step 2's hand-down) mounts in the app, flow or view editors measured; that step is pinned in the unit file, not shown in the browser.
  • Create-form timing: a nested form's rows now show their issues when the host row does (a nested row's first touch reaches the host), not one nested row at a time.

Verification

Two minutes: pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/SchemaForm.nestedIssuePlacement-35499.test.tsx packages/app-shell/src/views/metadata-admin/ResourceEditPage.nestedRefusal-35499.test.tsx — expect Tests 11 passed (11).

Gate readings (local subset, final head 9af962e)

node scripts/pm/dispatch-gates.mjs --commands derived 39 families; all 39 run, each exit recorded, --ran reconciliation: 39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED. Every family exit 0. pnpm check:test-source-alias first went red on the two new pin files (lazy @objectstack/lint / @objectstack/formula reached inside a clocked window); fixed by module-top imports in 9af962ee, then exit 0. The ui/scripts/ family ran with --maxWorkers=2 added (worker cap only). node scripts/pm/overlap-check.mjs before each push: VERDICT clean exit 0. CI runs the full farm.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUjtFEFN5FLe377MBT

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUjtFEFN5FLe377MBT
os-dev-report

{
 "issue": 35499,
 "status": "done",
 "branch": "claude/project-thread-g62vj4",
 "pr": "https://github.com/objectstack-ai/objectstack/pull/35623",
 "head": "9af962eefecf4d2d2fa0b24b577fc0d8425df112",
 "session": "session_01L6bhgUjtFEFN5FLe377MBT",
 "premise_still_valid": true,
 "summary": "Implemented the claim's design (steps 1-5): SchemaForm groups issues by path head and each row draws exact issues plainly and deeper ones led by the describeIssuePath trail; a nested-form row hands down issues whose next segment names a row the nested form renders (shared flatFormRowKeys), collection faces do not descend; hidden/canvas-owned keys mount no row; drawnInline and the banner filter test the path HEAD against the unchanged inline register; a nested-form host passes its show-state to nested rows so a handed-down issue is never hidden while its head is registered; the refusal summary skips the root slice's empty label and falls back to the root message. Zone-2 measurements: (1) real server refusal of a view with label {not_a_locale:'Tasks'} = two entries at label.not_a_locale (invalid_key, invalid_format), no label head; unknown column key = config.columns.0 unrecognized_keys. (2) rows mounted with refusal issues: object none (ObjectDefaultInspector replaces the form); view none that receive issues (the view designer's ViewVariantInspector renders its own SchemaForm with rows description/filter/sort/searchableFields, no issues prop, no register); flow name,label,type,description,nodes,edges,variables, so under the design every live-pass issue at nodes.*/edges.*/variables.* moves from the banner onto the Nodes/Edges/Variables row with its trail (canvas Problems list still lists them). (3) DeferIssueDisplayContext does reach nested forms (context inherited); without the new provider a nested row could stay deferred while its host is registered, so the provider closes the drop. The view acceptance (a)/(b) is unreachable in the view designer as measured; driven instead on a runtime app: refused save draws Label -> not_a_locale (x2) under Label and Areas -> main -> navigation / Areas -> main under Areas, banner keeps only the root entry, Save reason has no stray comma (before: no row lit, banner lists them, reason ends 'Areas -> main,  before saving').",
 "tests": "New pins SchemaForm.nestedIssuePlacement-35499.test.tsx (steps 1-4, 6 cases) and ResourceEditPage.nestedRefusal-35499.test.tsx (27865 one-message on 3 nested paths, head-without-row banner case, two step-5 Save-reason cases, harness): green at 9af962ee inside `pnpm --dir ui exec vitest run --maxWorkers=2 scripts/ BOTH_PINS` -> Test Files 173 passed | 2 skipped (175), Tests 5103 passed | 2 skipped (5105), VERDICT command-exit 0. Whole metadata-admin dir at a27d2d16 (final source; later commit test-only): Test Files 757 passed (757), Tests 8155 passed | 1 skipped, VERDICT command-exit 0; no existing pin moved. app-shell type-check (tsc --noEmit + tsconfig.test.json): VERDICT command-exit 0. Ablation via ablation-replace.mjs after commit: 'const head = issuePathHead(i.path);' -> 'const head = i.path;', mutation landed anchor 1->0 blob 670759c1a461->81a140586c01; pins Tests 7 failed | 4 passed (11) (all placement + one-message cases red; hidden-key, Save-reason, harness green as expected); restore blob == HEAD, git diff HEAD empty. Pins import source directly (no dist in the path). Browser: showcase dev backend + console vite, before/after screenshots in /mnt/project-files/build-seat1/35499/.",
 "gates": "dispatch-gates --commands derived 39 families; all recorded in ran.list; --ran: '39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED', exit 0. Every family :: exit 0 (check-adr-0087-registration x2, check-changeset-no-major, check-closing-keyword-parity x2, check-comment-mask-corpus, check-empty-changeset x2, check-sdui-manifest x2, snapshot-next --self-test, check-governed-queue-guard --self-test, release-rehearsal-clone --self-test, release-pending-publish --self-test, ui vitest scripts/, spec check:duration-unit-keys, spec check:error-code-provenance, check:adr-anchors, check:changeset-gate-self-tests, check:closed-ceremony-text, check:cross-package-test-inputs, check:dispatcher-error-vocabulary, check:driver-memory-census, check:engine-double-contract, check:gitlink-declared, check:nul-bytes, check:published-files, check:query-options-erasure, check:refd-timer-probe, check:registry-log-declared, check:rest-log-spy-declared, check:skill-identifier-liveness, check:test-source-alias, check:tier-file-adoption, check:type-check-coverage, check:type-check-debt, check:undeclared-dep-imports, check:watch-hint-literal, check:where-matcher). check:test-source-alias was exit 1 first (new pins reached lazy @objectstack/lint/@objectstack/formula), fixed in 9af962ee, re-run exit 0; ui scripts/ first run exit 99 (lock queue budget while my dir run held it), second killed by container OOM, re-run exit 0. overlap-check before each push: VERDICT clean exit 0. CI check-runs: in_progress at report time (not awaited per os-dev).",
 "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm (Clause-②: no)",
 "line_budget": "+543 / -52 over 6 files (source +178 / -52 over 3 files); reference +340 over 9; under 2x",
 "files_changed": "ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx, ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx, ui/packages/app-shell/src/views/metadata-admin/issuePath.ts, ui/packages/app-shell/src/views/metadata-admin/SchemaForm.nestedIssuePlacement-35499.test.tsx, ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.nestedRefusal-35499.test.tsx, .changeset/35499-nested-refusal-row-placement.md",
 "deviations": "(1) acceptance (a)/(b) asked for a VIEW; the view designer draws refusal issues on no row (measured), so the browser acceptance ran on a runtime app (label map + areas collection cause + root key); the nested-form hand-down (step 2) is pinned in units only, no mounted nested-form row found in app/flow/view editors. (2) the derived `pnpm --dir ui exec vitest run scripts/` family ran with `--maxWorkers=2` appended. (3) PR body: first two lines are the dispatch's attribution lines, so `Fixes #35499` is line 3 and the signature line 4. (4) no new language-pack key (Metadata-protocol: none holds). (5) EmbeddedItemEditor unchanged: it feeds the same SchemaForm, placement applies there automatically. (6) the PM's AGENTS rule 'a new pin for a component with a shared harness file goes into that file' not applied: dispatch ordered new card-named files and no shared SchemaForm/ResourceEditPage harness file exists.",
 "mcp_calls": "0",
 "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches -> pulls create #35623), post-stamped comment on PR #35623 (this report); plus git push (not REST)",
 "open_questions": [],
 "security_findings": "none",
 "out_of_scope_findings": [
  "class: a · reach: Studio view designer and object designer, refused save — the home inspectors (ViewVariantInspector's own SchemaForm, ObjectDefaultInspector) take no issues, so a refused view save at label.not_a_locale or config.columns.0 lights no row; measured: server refusal shapes via PUT /api/v1/meta/view (422 label.not_a_locale x2; config.columns.0 unrecognized_keys) and the designer's mounted rows in the running console, not driven through a refused save in the view designer UI · dedupe words: view designer refused save no row highlighted, ViewVariantInspector SchemaForm issues, default inspector refusal issues",
  "carrier: none · noted, not filed: flow editor's Nodes/Edges/Variables rows now carry every live-pass issue under them with trails instead of the banner (design consequence, in Acceptance notes)"
 ]
}

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-sales November 19, 2026 18:29
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUjtFEFN5FLe377MBT

Final head for L1: 9af962eefecf4d2d2fa0b24b577fc0d8425df112 · 2026-11-19T18:46Z
CI on this head: 39 success, 13 skipped, 0 failed or pending; mergeable_state clean. os-dev-report: 7018192154.
Out-of-scope finding filed as #35628 (registered default inspectors get no issues); this card thread takes it in series after this PR merges.
Sent to L1-a.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head 9af962eefecf4d2d2fa0b24b577fc0d8425df112 · 2026-11-19T18:49Z

  • 形态 — draft, base main, 3 commits, 6 files, +543/−52 (source +178/−52 over 3 files). Merge-base e35cf035. check-governed-merges.mjs --pr 35623: NOT governed, 0 of 6 paths. Fixes #35499, Clause-②: no, Metadata-protocol: none, @object-ui/app-shell patch. No new locale key: the trail reuses describeIssuePath. The last commit (9af962ee) touches only the two pins.
  • The claim's rule is what the code does. The rule: an issue is drawn on the deepest row the form renders for a prefix of its path.
    • SchemaFormBody groups issues by issuePathHead.
    • FieldRow calls splitRowIssues. An exact issue is drawn as its message. A deeper one is drawn led by the describeIssuePath trail.
    • A nested-form face hands down only the issues whose next segment names a row that nested form renders, with the prefix trimmed.
    • The row set comes from flatFormRowKeys. That is the same function the body now renders its flat rows by, fed the same deref'd schema, value and predicate scope. So the host and the nested form cannot disagree about who draws an issue.
    • Where the nested body resolves differently (a union or an inferred schema), the host's set is empty and the host keeps the issue. The failure is an issue drawn one level too high, never one dropped.
    • This is stricter than the claim's 「names one of the nested schema's properties」: a property hidden by a predicate does not swallow its issue. That is the right side.
  • The card's warning on double display is met. The warning was: one mistake shown twice through drawnInline and the banner filter.
    • Both now test issuePathHead(path) against the unchanged inline register, the same key the form places by.
    • A registered head is drawn somewhere. It is either kept on the host row or handed down to a nested row.
    • The new DeferIssueDisplayContext provider makes a nested row show exactly when its host row does. Without it, a handed-down issue could stay deferred while its head is registered, and that is the drop the provider closes.
    • A head no row renders is never registered, so it stays in the banner (pinned: 「Not a view key」 stays in the banner and the nested cause does not).
  • The second warning (the client walk lights top-level rows) is ruled. The seat confirmed that the flow form's Nodes / Edges / Variables rows carrying live-pass trails is the card's design call, not a narrowing. Object and view mount no row that receives issues, as measured, so the banner behaviour there is unchanged. The body's Acceptance notes state the flow consequence. Claim step 3 listed flow nodes as canvas-owned. The measurement corrected that, and the body follows the measurement.
  • Step 5 — the refusal summary drops the root slice's empty label, and when only the root is held it says the root entry's own message. Pinned both ways: 「fix Unrecognized key: "zz" before saving」, and no fix ,.
  • Pins
    • Two new files: SchemaForm 6 cases, ResourceEditPage 5 cases. The Options group case mounts a real nested-form hand-down and checks each nested cause appears once (getAllByText(...).toHaveLength(1), banner and error line null).
    • The ablation reverts grouping to the whole path: 7 of 11 cases red, and the hidden-key, Save-reason and harness cases green, as designed (os-dev-report 7018192154).
    • The ResourceEditPage head change has no separate ablation. By reading, reverting it alone would put the nested cause back in the banner, and the banner-null assertion catches that. Not measured here: no node_modules.
    • The metadata-admin directory is 8155 passed with no existing pin moved, and the type-check passes.
  • Accepted deviations
  • 范围外去向 — Studio designers: a refused save marks no field row in a type's registered default inspector (view, object, ...), because ResourceEditPage passes it no issues (follow-up of #35499) #35628 is filed. Descent into repeater rows and aria-invalid are noted in the claim as later work only if measured, and nothing is owed.
  • 门禁 — on this head: 39 success, 13 skipped, 0 failure. Mergeable clean.
  • 落地条款 — not governed and no L2 face: b1-U lands this head. A new push needs a fresh L1 only if it changes more than a main merge.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUjtFEFN5FLe377MBT

Landing · Area b1-U · 2026-11-19T18:51Z · head 9af962eefecf4d2d2fa0b24b577fc0d8425df112 · on L1-a ACCEPT 7018769397

probe reading
CI check-runs on the head 39 success, 13 skipped, 0 failed or pending; mergeable_state clean
check-governed-merges.mjs --pr 35623 NOT governed, 0 of 6 paths; 595 changed lines, under 3000

State change: ready for review + auto-merge enabled. Fixes #35499 closes the card on merge. Follow-up #35628 is taken by this card thread after the merge.

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

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants