Repository navigation
fix(ui): the page designer canvas draws an authored record:details select and location the way the record page does - #27253
Merged
Conversation
…ma when no dataSource answers The page designer canvas mounts the runtime record:details under a record context that holds the bound object's schema but no dataSource, so DetailView never learned the field types: an authored bare-name section drew a select's stored code and a location as [Object]. Under recordFromHost the host's schema now stands in until a dataSource answers; nothing new is fetched. Claude-Session: https://claude.ai/code/session_01JQwxbYUSW5btC4i3GbWXGe Co-authored-by: Claude <noreply@anthropic.com>
…nd in DetailView Adds the canvas test (full-create seed, real record:details), the DetailView controls (a dataSource answer wins; no context or no recordFromHost is unchanged) and the plugin-detail patch changeset. Claude-Session: https://claude.ai/code/session_01JQwxbYUSW5btC4i3GbWXGe Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:页面设计器画布上,
Generated by Claude Code |
This was referenced Oct 28, 2026
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 Warren · project thread
Fixes #27177
Clause-②: no
Metadata-protocol: none
维护者速读
record:details现在把select显示成选项标签、把location显示成坐标,不再是原始值amer和[Object],与运行时记录页一致。record:details,但 Studio 不给 dataSource,DetailView只能从 dataSource 拿对象定义,于是只写字段名的条目没有类型,画成原始值;对象定义其实已在画布的记录上下文里。recordFromHost且 dataSource 尚未答复时借用上下文里的对象定义;有 dataSource 时它的答复照旧优先,不新增任何请求,没有上下文或不走recordFromHost的DetailView输出不变(测试钉住);回滚即 revert 本 PR。ui/packages/plugin-detail/src/DetailView.tsx(hostObjectSchema那三行)、ui/packages/app-shell/src/views/metadata-admin/previews/PagePreview.authoredDetailsValues-27177.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/previews/PagePreview.authoredDetailsValues-27177.test.tsx packages/plugin-detail/src/__tests__/DetailView.hostObjectSchema-27177.test.tsx,预期 5 个测试全绿。What changes
DetailViewtakes field types from the host's object schema when the host supplies the record.DetailViewlearned field types only fromdataSource.getObjectSchema. UnderrecordFromHost(whichrecord:detailssets) it now reads the record context'sobjectSchemaas well, and uses it until a dataSource answer arrives:objectSchema = dataSourceObjectSchema ?? (recordFromHost ? hostObjectSchema ?? null : null). A dataSource answer still wins, nothing new is fetched, no prop is added, and aDetailViewwith no record context, or one that reads its own record, draws as before..changeset/27177-detail-host-object-schema.md,patchfor@object-ui/plugin-detail.Why
The card's premise holds: on the Design canvas a
fullrecord page whoserecord:detailsnames its fields drew aselectas its stored code and alocationas[Object]. The dispatch order assumed a canvas-side value-render site underviews/metadata-admin/previews/; measuring disproved that.PagePreviewwrapsPageBlockCanvasinRecordContextProviderwith the bound object's/metaschema and no dataSource (as every Studio preview does), and the canvas mounts the runtimerecord:detailsrenderer itself, so the triage ruling ("the canvas reuses the runtime's field renderers; it does not get its own formatter") was already true. What the canvas lacked was the field metadata: the full-create seed writessections[].fieldsas bare names, a bare-name entry carries notype, andDetailSectionresolves the type fromobjectSchema, which stayed null without a dataSource. The slotted default looked right because its synthesized sections carry typed field objects; the record page looked right because it has a dataSource. The seat ruled the route on the card (order amendment 6468231446): fix it inDetailView, no new prop, no stub dataSource.Human Minimum
packages/specholds no runtime logic. (packages/specnot touched.)pnpm lintpasses (ESLint on the three changed source and test files: 0 errors; the repo-wide run is CI's).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Tests
ui/packages/app-shell/src/views/metadata-admin/previews/PagePreview.authoredDetailsValues-27177.test.tsx(2): the full-create seed names its detail fields by bare name (premise pin); on the real Design canvas (realPageBlockCanvas, record context,record:details,DetailViewand cell renderers; only the two endpointsPagePreviewreads are doubled) the boundrecord:detailsbody drawsAmericasforsales_region: 'amer'and37.7749, -122.4194for alocation, neverameror[Object]; CONTROL inside it: a plaintextfield reads as stored.ui/packages/plugin-detail/src/__tests__/DetailView.hostObjectSchema-27177.test.tsx(3): with no dataSource, arecordFromHostview under a record context draws the option label and the coordinates; CONTROL: with a dataSource, its answer wins over the host schema and is read once (no record read); CONTROL: with no record context, or withoutrecordFromHost, the view draws the raw value exactly as before.Acceptance notes
@object-ui/plugin-detail, outside the order's original file surface; the seat widened the surface toDetailView.tsxplus the changeset before the first edit (order amendment 6468231446).DetailViewwith no context still draws a bare-nameselectraw. That is the behaviour of a host that hands no object schema at all, unchanged on purpose.Verification
All readings on head
d8123be0(branch tip after mergingorigin/main) unless noted.New tests and wider suites
pnpm --dir ui exec vitest run packages/plugin-detail/under the verify lock: Test Files 325 passed, 1 skipped (326); Tests 2971 passed, 18 skipped; VERDICT command-exit 0.pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/previews/under the verify lock: Test Files 150 passed (150); Tests 1683 passed (1683); VERDICT command-exit 0.pnpm --filter @object-ui/plugin-detail type-checkandpnpm --filter @object-ui/app-shell type-checkeach exit 0 (after the closure build--filter '@object-ui/app-shell^...', VERDICT command-exit 0, and a@object-ui/plugin-detailrebuild after the merge).anylines and the test doubles'as any, as in the sibling tests).pnpm --dir ui run check:new-line-citations: 0 new citations.Ablation (restored, blob equal to HEAD, git diff HEAD empty)
Run with
node scripts/ablation-replace.mjson the committed fix; the anchor hit once and the mutation landed on disk (blob b9030ab7 to 2d33b607). Both test files resolve@object-ui/plugin-detailand@object-ui/reactto source through the vitest alias, so no dist leg.const objectSchema = dataSourceObjectSchema ?? (recordFromHost ? hostObjectSchema ?? null : null);replaced byconst objectSchema = dataSourceObjectSchema;turns 2 tests red (the canvas test, the no-dataSource DetailView test); the premise pin and both controls stay green.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives 34 families on this change set. Each ran ond8123be0with its exit code captured before any pipe: 34 of 34 exit 0.dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED.dispatch-gates --tier: no path-derived mandate.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbYUSW5btC4i3GbWXGe