Skip to content

fix(admin): persist Draft/Published status to ui-schema.json on edit#82

Merged
aqib-rx merged 1 commit into
feat/unified-schema-pipelinefrom
feat/ui-schema-dual-write
Jun 4, 2026
Merged

fix(admin): persist Draft/Published status to ui-schema.json on edit#82
aqib-rx merged 1 commit into
feat/unified-schema-pipelinefrom
feat/ui-schema-dual-write

Conversation

@aqib-rx
Copy link
Copy Markdown
Collaborator

@aqib-rx aqib-rx commented Jun 4, 2026

The collection/single edit builders dropped the status flag when writing ui-schema.json: the field-change path omitted it from the manifest settings and the settings-only path never wrote the file at all. As a result migrate:create (which builds UI-built entities' desired snapshot solely from ui-schema.json) never saw Draft/Published and omitted the status column, drifting generated migrations from the live DB.

Add a shared settings-to-manifest adapter that always forwards status (explicit true/false so it can be turned off), and call it from both save paths in both edit pages. Document the dev-write full-replace contract and pin it (plus the UI status-forwarding) with regression tests.

Summary

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would change existing behavior)
  • Documentation update
  • Refactor / chore (no user-facing change)

Related issues

Changeset

This repo uses Changesets. If your PR changes any publishable package under packages/*, you must include a changeset:

pnpm changeset

Then commit the generated .changeset/*.md file.

  • I added a changeset (or this PR only touches non-publishable code: docs, tests, internal tooling, apps/*)
  • I selected the correct semver bump (patch / minor / major)

The changeset-check CI job will fail if a publishable package is modified without a changeset.

Test plan

  • pnpm lint
  • pnpm check-types
  • pnpm build
  • Manually verified the change

Checklist

  • I read CONTRIBUTING (if it exists)
  • My commits follow the Conventional Commits spec (enforced by commitlint)
  • I targeted the main branch
  • I updated relevant documentation

Screenshots / recordings

Notes for reviewers

The collection/single edit builders dropped the `status` flag when writing
ui-schema.json: the field-change path omitted it from the manifest settings
and the settings-only path never wrote the file at all. As a result
migrate:create (which builds UI-built entities' desired snapshot solely from
ui-schema.json) never saw Draft/Published and omitted the `status` column,
drifting generated migrations from the live DB.

Add a shared `settings-to-manifest` adapter that always forwards `status`
(explicit true/false so it can be turned off), and call it from both save
paths in both edit pages. Document the dev-write full-replace contract and
pin it (plus the UI status-forwarding) with regression tests.
@aqib-rx aqib-rx merged commit 39a22f0 into feat/unified-schema-pipeline Jun 4, 2026
2 checks passed
@github-actions github-actions Bot added scope: core nextly scope: admin @nextlyhq/admin labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: admin @nextlyhq/admin scope: core nextly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant