Implements the OpenSpec change add-page-visual-editor, change 3 of the page builder.
What changes
On windows 1024 px and wider, the page editor now edits the page in place on a canvas, with a side panel next to it.
Canvas. The page renders on a canvas: Desktop at 1280 px, scaled down to fit, or Phone at 390 px.
Headings, text, button labels, cards and FAQ entries are edited on the page as plain text, with the server's length limits.
Rich text is edited in place, with a floating toolbar. A refused link says why.
Clicking an image spot opens the file picker.
Side panel. It shows the selected section's settings, or the page settings when nothing is selected.
Section tools. Drag, Move up, Move down, Duplicate and Remove. "Add section" sits between sections and offers every block type. A section that is added, copied or moved is scrolled into view.
Undo and redo. Up to 50 steps, with buttons and Ctrl+Z / Ctrl+Shift+Z. Typing in one field counts as one step.
Refusals. A refused block is selected, outlined and scrolled into view, and the message shows at its field.
Custom HTML. The block shows "Save to update" while its HTML is unsaved, and reloads after a save.
Leave guard. An in-app link asks before it drops unsaved edits.
Narrow windows. They keep the form editor. The shared usePageDraft hook keeps unsaved edits when the window is resized.
Security
The canvas iframe (CanvasFrame) is the portal's only unsandboxed frame. It holds a constant blank document, and React portals into it. This is recorded in design Decision 1 and in the proposal's Impact section. The markup sweep allow-lists exactly that file and its shape. Custom HTML still renders in sandboxed frames.
Verification
vitest: 1979 passed, exit code 0.
tsc: clean.
lint: 0 errors and the 4 old warnings.
openspec validate --strict: valid.
Live Playwright check (task 4.2), on disposable pages at 1280 px and 900 px with Desktop and Phone views. The test pages were deleted afterwards. Checked:
Implements the OpenSpec change `add-page-visual-editor`, change 3 of the page builder.
## What changes
On windows 1024 px and wider, the page editor now edits the page in place on a canvas, with a side panel next to it.
- **Canvas.** The page renders on a canvas: Desktop at 1280 px, scaled down to fit, or Phone at 390 px.
- Headings, text, button labels, cards and FAQ entries are edited on the page as plain text, with the server's length limits.
- Rich text is edited in place, with a floating toolbar. A refused link says why.
- Clicking an image spot opens the file picker.
- **Side panel.** It shows the selected section's settings, or the page settings when nothing is selected.
- **Section tools.** Drag, Move up, Move down, Duplicate and Remove. "Add section" sits between sections and offers every block type. A section that is added, copied or moved is scrolled into view.
- **Undo and redo.** Up to 50 steps, with buttons and Ctrl+Z / Ctrl+Shift+Z. Typing in one field counts as one step.
- **Refusals.** A refused block is selected, outlined and scrolled into view, and the message shows at its field.
- **Custom HTML.** The block shows "Save to update" while its HTML is unsaved, and reloads after a save.
- **Leave guard.** An in-app link asks before it drops unsaved edits.
- **Narrow windows.** They keep the form editor. The shared `usePageDraft` hook keeps unsaved edits when the window is resized.
## Security
The canvas iframe (`CanvasFrame`) is the portal's only unsandboxed frame. It holds a constant blank document, and React portals into it. This is recorded in design Decision 1 and in the proposal's Impact section. The markup sweep allow-lists exactly that file and its shape. Custom HTML still renders in sandboxed frames.
## Verification
- `vitest`: 1979 passed, exit code 0.
- `tsc`: clean.
- `lint`: 0 errors and the 4 old warnings.
- `openspec validate --strict`: valid.
- **Live Playwright check (task 4.2)**, on disposable pages at 1280 px and 900 px with Desktop and Phone views. The test pages were deleted afterwards. Checked:
- template, in-place edits, Look, add/duplicate/move/drag/delete;
- undo and redo, one step per Ctrl+Z from three places;
- a save refused for a missing event, then save and Publish changes;
- safe and unsafe rich-text links;
- the Custom HTML stale mark;
- the leave guard.
- **Fixes from the live check:**
- Ctrl+Z was ignored once focus fell out of the editor.
- Empty rich text had no room and no cue.
- Added sections stayed out of view.
## Notes
- The VisualEditor UI tests were written after the component. The `usePageDraft` tests were written red first.
- CI is expected to fail until solvway is in place.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
A toolbar button removed with its section drops focus on the canvas body, and
a button that just went disabled drops it on the page body; neither reached the
editor's key handler. Listen on both documents as a fallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: 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.
Implements the OpenSpec change
add-page-visual-editor, change 3 of the page builder.What changes
On windows 1024 px and wider, the page editor now edits the page in place on a canvas, with a side panel next to it.
usePageDrafthook keeps unsaved edits when the window is resized.Security
The canvas iframe (
CanvasFrame) is the portal's only unsandboxed frame. It holds a constant blank document, and React portals into it. This is recorded in design Decision 1 and in the proposal's Impact section. The markup sweep allow-lists exactly that file and its shape. Custom HTML still renders in sandboxed frames.Verification
vitest: 1979 passed, exit code 0.tsc: clean.lint: 0 errors and the 4 old warnings.openspec validate --strict: valid.Notes
usePageDrafttests were written red first.🤖 Generated with Claude Code
https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs