Repository navigation
fix(app-shell): show a form view's served warnings on its Studio canvas - #29433
Merged
Merged
Conversation
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
… 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
Contributor
Author
|
domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB 席位核对 — ACCEPT ·
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steedos · project thread
Fixes #29311
Clause-②: no
Metadata-protocol: none
Claim 6578174431, surface amendment 6578279049.
维护者速读
_diagnostics和其他读取装饰一起剥掉了,画布拿不到,作者仍以为表单完好、字段会出现。_diagnostics(测试和实测都确认)。作者改掉被警告的那个值后,这条警告会随即消失(该支柱自动保存后不重新读取)。回滚即 revert 本 PR。StudioDesignSurface.tsx里 InterfacesPillar 的叶子加载(setLeafVerdict)和leafDiagnostics;ViewPreview.tsx的FormViewWarnings;draftVerdict.ts的verdictEntriesStillShown。no_such_field,然后打开/studio/包ID/interfaces?surface=view:视图名:画布上方出现黄色提示,写着 Overview 和字段名;改一下标签,保存请求里没有_diagnostics。What changes
extractDraftBody, which strips_diagnosticswith 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_diagnosticsread 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.MetadataPreviewProps.diagnostics(verdictEntriesStillShown, a new pure helper besideserverHoldAtindraftVerdict.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 existingPreviewMessagewarn block under the existingengine.edit.diagnostics.warnTitleheading. 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.diagnosticstoo; none of them reads the prop today, so they render as before.Tests
ViewPreview.formWarnings-29311.test.tsx(new, realViewPreview): 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; emptywarningsor no_diagnosticshands nothing; editing the judged field drops the warning and the autosave's body carries no_diagnostics(and carries the edit).Acceptance notes
ObjectFormDesigner.tsx,ObjectFormCanvas.tsxandFieldStub.tsxdesign 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 registeredviewpreview,ViewPreview. None of the three is touched.getMetaItemLayeredcomputes its_diagnosticsfrom 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=trueread 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).ResourceEditPage), which already lists warnings in its banner and passes the samediagnosticsto this preview, the warning now also shows on the form canvas, asFlowPreviewdoes for its problems.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_intakewhose Overview section listsname,no_such_field,status, saved withPUT /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:StudioDesignSurface.tsx,ViewPreview.tsxat the base)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 formPUT …?mode=draftwith no_diagnosticsand no_draftin its body; the warning stays (its field is unchanged)r29311_active), no draftAblations
Each through
scripts/ablation-replace.mjson effaaa7 (sources resolve tosrc, no dist leg); each restored to the HEAD blob withgit diff HEADempty.draftDiagnostics: undefinedin the leaf load): pillar file 2 failed, 2 passed (the draft case and the edit case).FormViewWarningsrender replaced by null): ViewPreview file 2 failed, 2 passed.verdictPreviewEntriesforverdictEntriesStillShown): pillar file 1 failed (the edit case), 3 passed.Local runs
ViewPreview,InterfacesPillarordraftVerdict(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).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, everyInterfacesPillar.*andViewPreview.*file, 20 files / 104 tests passed.dispatch-gates --commandsderived 34 commands; all 34 ran with exit 0 (pnpm --dir ui exec vitest run scripts/: 169 files passed, 2 skipped);--ranreconciliation 34/34, 0 NOT-MEASURED (effaaa7).StudioDesignSurface.tsx).🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jRBAJBC7ovV28sS3Go
Generated by Claude Code