Repository navigation
fix(app-shell): Studio's form view canvas honours layout horizontal and the other form view keys - #29759
Merged
Conversation
The form view preview built its object-form schema from type, sections and fields and dropped layout, so a horizontal view drew stacked in Studio Design and Run. Forward it; vertical and absent are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSTfFyWwerNYfs13mT
Read layout through resolveFormViewChrome, the console form hosts' mapping, and pass columns, defaultTab, tabPosition, allowSkip and showStepIndicator as the record page does. Pin each on the built schema and defaultTab on the drawn tab strip. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSTfFyWwerNYfs13mT
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m 席位核对 · ACCEPT · 2026-11-03T03:55ZHead-sha:
|
This was referenced Nov 3, 2026
Closed
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 #29676
Clause-②: no
Metadata-protocol: none
Claim 6593560214, surface amendment 6593906746.
维护者速读
layout画字段:horizontal时标签在输入框左侧同一行,vertical或未设置时标签在上方,和以前一样。画布同时会用上视图的columns、defaultTab、tabPosition(分页表单)、allowSkip、showStepIndicator(向导表单)。type、sections、fields,其余键全部丢掉。作者在属性面板里选了 horizontal,画布毫无变化,而终端用户的表单页其实已经按 horizontal 画了,两边看到的不一样。layout走的是控制台表单宿主自己用的同一个映射(resolveFormViewChrome),所以两边读法一致。回滚即 revert 本 PR。ViewPreview.tsx的buildFormPreviewSchema;新测试ViewPreview.formLayout-29676.test.tsx。config.layout: 'horizontal'的表单视图并发布,打开/studio/包ID/interfaces?surface=view:视图名:设计和运行两种模式下,"Project Name" 标签都在输入框左边同一行;手机宽度下仍是上下排列(断点设计如此)。What changes
buildFormPreviewSchema(the form view canvas, shared by Studio Design and Run) forwards the form view keysObjectFormreads. It built theobject-formschema fromtype,sectionsandfieldsonly, so a view stored withconfig.layout: 'horizontal'drew every label above its control in Studio while the console's form page drew it beside.layoutis read throughresolveFormViewChrome, the mapping the console's form hosts (RecordFormPage, the New/Edit modal) already use, so the canvas and the runtime read the key one way. Only itslayoutis taken: the canvas draws no submit or cancel and seeds no create values.columns,defaultTab,tabPosition,allowSkipandshowStepIndicatorare passed as authored, asRecordFormPagepasses them:columnsto the field grid,defaultTab/tabPositionto the tabbed layout,allowSkip/showStepIndicatorto the wizard. A tabbed view now opens on its authored tab in Studio.titleanddescriptionare deliberately not forwarded. Measured in@object-ui/plugin-form: onlyDrawerForm,ModalFormandMasterDetailFormreadschema.title/schema.description. The canvas foldsdrawer/modaltosimple(toInlineFormType), andsimple,tabbedandwizardread neither key, so forwarding them would be a pin on a value nothing draws. Drawing a form's heading and description on the canvas would need new canvas markup, so it is listed under Acceptance notes rather than done here.buildFormPreviewSchemais now a named export, so the test can pin it directly. No other module reads it. It adds onereact-refresh/only-export-componentswarning of the same kind the file's existingresolveObjectNameexport carries.components/src/renderers/form/form.tsx, console forms: form-view keys that save and publish are not rendered —buttons,layout: "horizontal",drawerSide/drawerWidth;defaultsapply only on the full-page /new; a tabbed form with subforms losesdefaultTab/tabPosition#26843) is unchanged; it was already correct.Why
Studio's form view inspector offers Layout, so an author could pick
horizontal, publish it, and see nothing change on the canvas, even though end users got it (#29672 acceptance[1]). Declared and enforced at runtime, but misdrawn where it is authored.Tests
ViewPreview.formLayout-29676.test.tsx(new, realViewPreview,@object-ui/plugin-formregistered):horizontaldraws the field item with the renderer's label-column grid (sm:gridplus the two-column template) in Run, in Design (editing), and on atabbedview.verticaland no layout draw the stacked item, with nosm:grid.layoutthrough the console hosts' mapping (horizontalkept,verticalkept, unset becomes the renderer defaultvertical), and carriescolumns,defaultTab,tabPosition,allowSkipandshowStepIndicatoras authored.mode: 'create').defaultTab: 'details'opens the Details tab on the drawn tabbed form (aria-selected).Acceptance notes
title/descriptionshow on the console's/formspage (its own heading and description) but not on the Studio canvas, whose inline layouts read neither key. Out of scope here (see What changes); noted, not filed.smbreakpoint a horizontal form stacks by design, on the canvas and on the console's form page alike (measured at 390 px below).layout. The console's/forms/NAMEpage draws horizontal beside (measured), andRecordFormPageand AppContent's New/Edit modal forward it throughresolveFormViewChrome(pinned by the console forms: form-view keys that save and publish are not rendered —buttons,layout: "horizontal",drawerSide/drawerWidth;defaultsapply only on the full-page /new; a tabbed form with subforms losesdefaultTab/tabPosition#26843 tests).Verification
Live, on the showcase (dev --fresh, Vite source console, scratch package over REST)
Three published form views on
showcase_project(layout: horizontal,vertical, unset), each with one two-column section (Project Name, Status). Label and control positions fromgetBoundingClientRectat 1440 px, x,y in px:/forms/NAME/forms/NAMEThe label's y sits inside the control's height because the grid aligns the label on the control's first text line (
items-baseline). At 390 px the horizontal view stacks on both surfaces (Studio label 34,351 · control 34,369; console label 33,165 · control 33,185).Ablations (ablation-replace.mjs on 623f76a, src-resolved; each restored blob == HEAD, git diff HEAD empty)
layout: resolveFormViewChrome(replaced bylayout: undefined && resolveFormViewChrome(gives 4 failed / 5 passed (the three horizontal renders and the layout schema pin).defaultTab: body.defaultTab,replaced bydefaultTab: undefined,gives 2 failed / 7 passed (the schema pin and the drawn tab).columns: body.columns,replaced bycolumns: undefined,gives 1 failed / 8 passed.Local runs
ViewPrevieworresolveFormViewChrome(18 files, locked, 2 workers): 443 tests passed (1718156).turbo run type-check --filter=@object-ui/app-shell: 65/65 (623f76a).dispatch-gates --commandsderived 35 commands; all 35 exit 0 (1718156), incl.check-sdui-manifestand its self-test,check:type-check-debt(locked), andpnpm --dir ui exec vitest run scripts/(170 files passed, 2 skipped, at--maxWorkers=2).--ranreconciliation 35/35, 0 NOT-MEASURED.origin/mainagain (0d3b9c0, 9 commits, none touching these files; rebuilt 118/118): the 18-file neighbour sweep, 443 tests passed, and the app-shell type-check, 65/65.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses. (eslint on the touched files, 0 errors; the repo-wide lint is CI's.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jSTfFyWwerNYfs13mT
Generated by Claude Code