OpenSpec change add-page-drafts-and-templates (page builder, change 2 of 3).
What
Draft and live split. When staff save a published page, the changes go to a new cms_page.draft JSON column, and visitors keep seeing the live version. The editor then shows a banner with Publish changes and Discard changes; Discard asks first. After a save, the banner scrolls into view.
Publish checks the draft again: the blocks, and that the slug is still free.
Saving a page with status Draft takes it offline and drops the draft.
Preview shows the draft, including Custom HTML frames. The pages list marks such pages "Unpublished changes".
Starter templates. New page first offers Blank, Event sign-up or Service showcase. A template fills the editor with placeholder sections and a sign-up form named signup with no event set.
Duplicate, on the list and in the editor, opens /pages/new?from=<id>. The copy is a new draft of the same company, titled "
OpenSpec change `add-page-drafts-and-templates` (page builder, change 2 of 3).
## What
- **Draft and live split.** When staff save a published page, the changes go to a new `cms_page.draft` JSON column, and visitors keep seeing the live version. The editor then shows a banner with **Publish changes** and **Discard changes**; Discard asks first. After a save, the banner scrolls into view.
- Publish checks the draft again: the blocks, and that the slug is still free.
- Saving a page with status Draft takes it offline and drops the draft.
- **Preview** shows the draft, including Custom HTML frames. The pages list marks such pages "Unpublished changes".
- **Starter templates.** New page first offers Blank, Event sign-up or Service showcase. A template fills the editor with placeholder sections and a sign-up form named `signup` with no event set.
- **Duplicate**, on the list and in the editor, opens `/pages/new?from=<id>`. The copy is a new draft of the same company, titled "<title> (copy)" with slug "<slug>-copy". Nothing is stored until Save.
- **APIs.** services-counter adds `/counter/cmsPage/publish` and `/counter/cmsPage/discard`. mobile-api adds `POST /api/admin/pages/{id}/publish` and `/discard`, scoped to the caller's company.
- **Labels:** 18 new, in English and zh_CN.
## SQL
1. `sql/01-page-draft.sql`: run before the new services-counter starts.
2. `sql/02-draft-template-labels.sql`: run after deploy.
3. Rollback: `sql/99-rollback.sql`. It drops every unpublished draft.
See `docs/deployment.md` §12.
## Verification
- `mvn -T 1C -pl solvway-services-counter -am verify`: 377 tests pass.
- `mvn -T 1C -pl solvway-mobile-api -am verify`: 997 tests pass.
- Portal: vitest 1924 pass, `tsc` clean, lint has the 4 old warnings only.
- `openspec validate --strict`: valid.
- Live Playwright check on disposable pages, deleted afterwards, at 1280 and 360 px:
- Both templates were refused without an event, then saved.
- Edited a published page: the visitor still saw the old version while Preview showed the draft. The list showed "Unpublished changes".
- Publish changes made the edit live. Discard asked first, then restored the live content.
- Duplicate saved a new draft copy.
- A slug clash was refused at the Slug field and the banner stayed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
OpenSpec change
add-page-drafts-and-templates(page builder, change 2 of 3).What
cms_page.draftJSON column, and visitors keep seeing the live version. The editor then shows a banner with Publish changes and Discard changes; Discard asks first. After a save, the banner scrolls into view.signupwith no event set./pages/new?from=<id>. The copy is a new draft of the same company, titled "