diff --git a/openspec/changes/add-page-visual-editor/.openspec.yaml b/openspec/changes/add-page-visual-editor/.openspec.yaml new file mode 100644 index 0000000..2a83988 --- /dev/null +++ b/openspec/changes/add-page-visual-editor/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-12-03 diff --git a/openspec/changes/add-page-visual-editor/design.md b/openspec/changes/add-page-visual-editor/design.md new file mode 100644 index 0000000..0e1a596 --- /dev/null +++ b/openspec/changes/add-page-visual-editor/design.md @@ -0,0 +1,107 @@ +# Design: add-page-visual-editor + +## Context + +- **Design doc:** `docs/superpowers/specs/2026-12-03-page-builder-design.md`, change 3. Changes 1 and 2 are live: section types and looks, draft and live content, templates, and Duplicate. +- **Today's editor** is `app/components/pages/PageEditor.tsx`, about 415 lines. It holds all page state and actions: + - load, the draft, `show`, images uploaded on save; + - save, publish changes, discard and delete; + - mapping refusals to fields. +- **Block fields** are edited by `BlockFields.tsx`. +- **Rendering.** The public page and the preview render with `LandingPage` and `Block` in `CmsBlocks.tsx`. Custom HTML renders through `HtmlFrame`, a sealed frame loaded from a frame address that skips the nonce policy. +- **Page policy.** The baseline CSP sets no `style-src`. Scripts need the per-request nonce. + +## Goals / Non-Goals + +**Goals** +- Edit the page on the page, with Desktop and Phone views. +- Text editing in place, section actions and undo. +- Change 2's draft controls and entries kept. +- The form editor kept below 1024 px. + +**Non-Goals** +- Free placement or per-element styling. +- Version history. +- Editing on phones. +- Live rendering of unsaved Custom HTML. +- Any server or API change. + +## Decisions + +### 1. The canvas is a blank same-origin frame that the editor renders into + +The editor mounts `