Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

ADR-0034 step 3: runtime draft/publish UI chrome (flag-gated) #1515

Closed

Description

@os-zhuang

Part of ADR-0034 (docs/adr/0034-unified-runtime-metadata-persistence.md). Follows the merged seam work (#1513) and ObjectView wiring (#1514).

Goal

When VITE_RUNTIME_EDIT_VIA_META is on, the runtime editors save a per-item draft (via persistRuntimeMetadata(..., mode:'draft')). They currently have no way to publish that draft or to surface that unpublished changes exist. Add the draft/publish chrome to the three runtime config panels, mirroring studio's ResourceEditPage.

Scope

Add, gated by isViaMeta() from packages/app-shell/src/views/runtime-metadata-persistence.ts (so flag OFF = no UI change at all):

  • Publish button → calls publishRuntimeMetadata(type, name, { metadataClient }) (already exists in the seam).
  • "Unpublished changes" indicator (read pending draft via metadataClient.get(type, name, { state: 'draft' })).
  • Discard draft → metadataClient.reset(type, name, { state: 'draft' }) (confirm the exact discard API in data-objectstack/src/metadata-client.ts).
  • On panel open, resume an existing draft (get(..., { state:'draft' })) so a half-finished edit is restored.

Files

  • packages/app-shell/src/views/ViewConfigPanel.tsx + host ObjectView.tsx
  • packages/app-shell/src/views/ReportConfigPanel.tsx + host ReportView.tsx
  • packages/app-shell/src/views/DashboardConfigPanel.tsx + host DashboardView.tsx
  • Reuse studio chrome/affordances from views/metadata-admin/ResourceEditPage.tsx and the engine.edit.* i18n keys (engine.edit.publish, engine.edit.draftPending, engine.edit.discardDraft, …).

Acceptance criteria

  • Flag OFF (default): zero UI change — none of the new affordances render; existing Save behaviour is byte-identical.
  • Flag ON: Save writes a draft (existing seam); Publish promotes it (visible to other users + a new version); the indicator reflects a pending draft; discard removes it; reopening resumes the draft.
  • pnpm turbo run build --filter=@object-ui/app-shell + pnpm -w vitest run packages/app-shell/src/views green; lint clean.

Notes / risks

  • The flag-ON path cannot be e2e-verified without a backend — verify in a real environment (see the verification issue). Keep everything behind isViaMeta().
  • Default to per-item Publish; the batch "publish app" already exists in studio (/packages/:id/publish-drafts).

Activity

  1. xuyushun441-sys commented on Jun 6, 2026

    @xuyushun441-sys
    Contributor

    Done — runtime draft/publish chrome shipped in #1533 (merged). Verified against the showcase backend (save→draft→publish→version, resume-on-open, discard). Flag later removed entirely in #1534.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions