Skip to content

[SDUI][P0] Wire PageDesigner → record page persistence (draft/publish) #1541

@xuyushun441-sys

Description

@xuyushun441-sys

Context

Part of the SDUI runtime roadmap. The rendering engine (SchemaRenderer + registry) and record-detail synthesis (buildDefaultPageSchema) are done, and runtime draft→publish persistence already works for views/reports/dashboards via the ADR-0034 seam (packages/app-shell/src/views/runtime-metadata-persistence.ts). The PageDesigner (packages/plugin-designer/src/PageDesigner.tsx) can visually compose a component tree but its output is not persisted for record pages.

Goal

Close the write-side loop for record pages: edit a record PageSchema visually in the browser and save/publish it through the same draft/publish seam.

Scope

  • Add 'page' (record PageSchema) as an artifact type to runtime-metadata-persistence.ts (persist/read/discard/publish), mirroring view/report/dashboard.
  • Wire PageDesigner output → persistRuntimeMetadata('page', ...).
  • Resolve the assigned page on load (usePageAssignment) including unpublished drafts (readRuntimeDraft).
  • Round-trip: assign → edit → draft → publish → re-render via SchemaRenderer.

Acceptance

  • Editing a record page in the browser persists a draft (invisible to others)
  • Publish promotes the draft to the active page + version bump
  • Discard reverts to the previous published/synthesized page
  • Live e2e: open a record, edit its page, publish, reload → change persists

Notes

Dashboards/reports are the working reference pattern. Pairs with #1542 (RuntimeDraftBar).

Metadata

Metadata

Assignees

No one assigned

    Labels

    designerenhancementNew feature or requestsduiServer-Driven UI runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions