Skip to content

fix(app-shell): show a form view's served warnings on its Studio canvas - #29433

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

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #29311

Clause-②: no
Metadata-protocol: none

Claim 6578174431, surface amendment 6578279049.

维护者速读

  • 改了什么:在 Studio「界面」里打开一个表单视图时,如果某个分区写了对象上不存在的字段,画布顶部现在会出现黄色提示块「1 warning(s) — review recommended.」,逐条写出分区名(如 Overview)和服务端给出的原话(字段 "no_such_field" 不是对象上的字段,运行时会被静默跳过)。没有警告时什么都不显示,也不拦保存。
  • 为什么改:服务端从 meta door: a form view naming a field its object lacks publishes with _diagnostics valid, because the door validates the Zod shape only and never runs the lint's FORM_FIELD_UNKNOWN #29196 起已经在读取应答里给出这条警告,但 Studio 读取视图时把 _diagnostics 和其他读取装饰一起剥掉了,画布拿不到,作者仍以为表单完好、字段会出现。
  • 风险与回滚:只改显示:界面支柱加载时多保存一份服务端结论,画布只读不写;编辑缓冲区仍是剥掉装饰后的正文,所以保存请求里永远不带 _diagnostics(测试和实测都确认)。作者改掉被警告的那个值后,这条警告会随即消失(该支柱自动保存后不重新读取)。回滚即 revert 本 PR。
  • 先看:StudioDesignSurface.tsx 里 InterfacesPillar 的叶子加载(setLeafVerdict)和 leafDiagnostics;ViewPreview.tsx 的 FormViewWarnings;draftVerdict.ts 的 verdictEntriesStillShown。
  • 两分钟验证:在可写包里用 API 存一个表单视图草稿,分区字段写 no_such_field,然后打开 /studio/包ID/interfaces?surface=view:视图名:画布上方出现黄色提示,写着 Overview 和字段名;改一下标签,保存请求里没有 _diagnostics。
  • 需要你做的:无,席位落地。

What changes

  • The Interfaces pillar keeps the served verdict of the open leaf. Its load took the body through extractDraftBody, which strips _diagnostics with the other read decorations, and handed the canvas no verdict. The load now keeps the verdict the same way the Data pillar's object load does (editedItemDiagnostics: the pending draft's _diagnostics read before the strip, else the layered read's), beside the body it judged, in leaf-keyed state. It never enters the edit buffer, so no save carries _diagnostics.
  • The canvas gets it through the existing preview contract. A memo turns it into MetadataPreviewProps.diagnostics (verdictEntriesStillShown, a new pure helper beside serverHoldAt in draftVerdict.ts). This pillar does not read the leaf again after an autosave, so an entry is dropped once the value at its path in the buffer differs from the value the verdict judged (a renamed or removed field reference); an entry with no path is kept.
  • ViewPreview's form route shows the warnings in the canvas's existing PreviewMessage warn block under the existing engine.edit.diagnostics.warnTitle heading. Each entry is named by the section it points into (config.sections.N…: the section's label in the designer locale, else its name; any other path as written), followed by the server's message as served. Errors are left to the editor that holds the verdict. No new i18n key, no new control.
  • Page, dashboard and report previews in the same pillar now receive diagnostics too; none of them reads the prop today, so they render as before.

Tests

  • ViewPreview.formWarnings-29311.test.tsx (new, real ViewPreview): a warning into a section names the section by its label with the server message; a label-less section is named by its name and a path into no section is shown as written; an empty or absent list draws no block; an error-only list draws none.
  • InterfacesPillar.formViewWarnings-29311.test.tsx (new, the off-nav deep-link harness): a pending draft's warning reaches the canvas at its path; with no draft, the layered read's verdict is handed; empty warnings or no _diagnostics hands nothing; editing the judged field drops the warning and the autosave's body carries no _diagnostics (and carries the edit).

Acceptance notes

  • File surface differs from the dispatch's first list, by the seat's amendment 6578279049. ObjectFormDesigner.tsx, ObjectFormCanvas.tsx and FieldStub.tsx design an object's fields and field groups, not a form view; a form view (view, viewKind: 'form') opens in the Interfaces pillar, whose canvas is the registered view preview, ViewPreview. None of the three is touched.
  • A published form view with no pending draft shows no warning yet. getMetaItemLayered computes its _diagnostics from the schema alone (computeMetadataDiagnostics), without the form-layout pass the single-item read runs since meta door: a form view naming a field its object lacks publishes with _diagnostics valid, because the door validates the Zod shape only and never runs the lint's FORM_FIELD_UNKNOWN #29196. Measured on the showcase: the active read of a published form view serves the warning, its ?layers=true read serves { valid: true }. Studio and the metadata item editor read that layered answer when no draft is pending. Reported to the seat for the server lane; once the layered read carries the warning, this canvas shows it with no UI change (the no-draft branch is pinned above).
  • In the metadata item editor (ResourceEditPage), which already lists warnings in its banner and passes the same diagnostics to this preview, the warning now also shows on the form canvas, as FlowPreview does for its problems.
  • The form view inspector shows the stored body type as simple (not found) in its View type picker (visible in the screenshots, before and after). Not touched here.

Verification

Live, on the showcase (Vite source console, scratch package over REST)

A form view draft showcase_project.r29311_intake whose Overview section lists name, no_such_field, status, saved with PUT /api/v1/meta/view/NAME?mode=draft&package=com.qa.r29311. Its draft read serves _diagnostics: { valid: true, warnings: [{ path: 'config.sections.0.fields.1', message: … }] }. Opened at /studio/com.qa.r29311/interfaces?surface=view:showcase_project.r29311_intake, 1440x1000:

main (StudioDesignSurface.tsx, ViewPreview.tsx at the base) this branch
warn block on the canvas none 1 warning(s) — review recommended. / Overview: showcase_project.r29311_intake: field "no_such_field" is not a field on object "showcase_project" — it is silently skipped and never renders on the form
Label edit, autosave one PUT …?mode=draft with no _diagnostics and no _draft in its body; the warning stays (its field is unchanged)
published copy (r29311_active), no draft none none (layered read gap above)
Ablations

Each through scripts/ablation-replace.mjs on effaaa7 (sources resolve to src, no dist leg); each restored to the HEAD blob with git diff HEAD empty.

  • The draft verdict dropped (draftDiagnostics: undefined in the leaf load): pillar file 2 failed, 2 passed (the draft case and the edit case).
  • The canvas block removed (FormViewWarnings render replaced by null): ViewPreview file 2 failed, 2 passed.
  • The staleness filter removed (verdictPreviewEntries for verdictEntriesStillShown): pillar file 1 failed (the edit case), 3 passed.
Local runs
  • New files: 2 files, 8 tests passed (effaaa7).
  • Neighbour sweep, every test file naming ViewPreview, InterfacesPillar or draftVerdict (77 files, two locked batches): 40 files / 253 tests and 37 files / 610 tests passed (effaaa7).
  • turbo run type-check --filter=@object-ui/app-shell: 65/65 tasks (effaaa7, and again on the merged head 455cacb).
  • After merging origin/main (455cacb, which brings the other Studio pillar load change, fix(app-shell): Studio pillar loads and the metadata item editor open no buffer over a draft the server refuses to read #29380): the new files, every InterfacesPillar.* and ViewPreview.* file, 20 files / 104 tests passed.
  • dispatch-gates --commands derived 34 commands; all 34 ran with exit 0 (pnpm --dir ui exec vitest run scripts/: 169 files passed, 2 skipped); --ran reconciliation 34/34, 0 NOT-MEASURED (effaaa7).
  • eslint on the touched files: 0 errors; the touched-file warnings are pre-existing (StudioDesignSurface.tsx).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jRBAJBC7ovV28sS3Go


Generated by Claude Code

The Interfaces pillar's leaf load kept no served verdict: extractDraftBody
strips _diagnostics, so the form-field-unknown warnings the view read
serves never reached the canvas. The load now keeps the verdict beside the
body it judged and hands it to the preview as its diagnostics, dropping an
entry once the author edits the value it judged. ViewPreview's form route
lists the warnings in its warn block, named by section.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRBAJBC7ovV28sS3Go
@github-actions github-actions Bot added size/m 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 2, 2026
… key

The view-cache guard refuses any app-shell file that interpolates a
`view:` template literal; build the deep-link surface by concatenation.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRBAJBC7ovV28sS3Go
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB

席位核对 — ACCEPT · domain:ui#5 · head 68cec810 · 2026-11-02T15:19Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 15:21
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 2, 2026 15:21
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 0620fe3 Nov 2, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-oritte branch November 2, 2026 16:02
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/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio form designer: show a form view's _diagnostics.warnings (a section naming a field its object lacks)

1 participant