From c346f43f0e73835075f320ad80ff7e0a366ea626 Mon Sep 17 00:00:00 2001 From: ngqile Date: Thu, 3 Dec 2026 16:19:40 +0800 Subject: [PATCH] docs: archive add-page-visual-editor Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs --- .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/landing-pages/spec.md | 0 .../sql/01-visual-editor-labels.sql | 0 .../sql/99-rollback.sql | 0 .../tasks.md | 0 openspec/specs/landing-pages/spec.md | 99 +++++++++++++++++-- 8 files changed, 93 insertions(+), 6 deletions(-) rename openspec/changes/{add-page-visual-editor => archive/2026-12-03-add-page-visual-editor}/.openspec.yaml (100%) rename openspec/changes/{add-page-visual-editor => archive/2026-12-03-add-page-visual-editor}/design.md (100%) rename openspec/changes/{add-page-visual-editor => archive/2026-12-03-add-page-visual-editor}/proposal.md (100%) rename openspec/changes/{add-page-visual-editor => archive/2026-12-03-add-page-visual-editor}/specs/landing-pages/spec.md (100%) rename openspec/changes/{add-page-visual-editor => archive/2026-12-03-add-page-visual-editor}/sql/01-visual-editor-labels.sql (100%) rename openspec/changes/{add-page-visual-editor => archive/2026-12-03-add-page-visual-editor}/sql/99-rollback.sql (100%) rename openspec/changes/{add-page-visual-editor => archive/2026-12-03-add-page-visual-editor}/tasks.md (100%) diff --git a/openspec/changes/add-page-visual-editor/.openspec.yaml b/openspec/changes/archive/2026-12-03-add-page-visual-editor/.openspec.yaml similarity index 100% rename from openspec/changes/add-page-visual-editor/.openspec.yaml rename to openspec/changes/archive/2026-12-03-add-page-visual-editor/.openspec.yaml diff --git a/openspec/changes/add-page-visual-editor/design.md b/openspec/changes/archive/2026-12-03-add-page-visual-editor/design.md similarity index 100% rename from openspec/changes/add-page-visual-editor/design.md rename to openspec/changes/archive/2026-12-03-add-page-visual-editor/design.md diff --git a/openspec/changes/add-page-visual-editor/proposal.md b/openspec/changes/archive/2026-12-03-add-page-visual-editor/proposal.md similarity index 100% rename from openspec/changes/add-page-visual-editor/proposal.md rename to openspec/changes/archive/2026-12-03-add-page-visual-editor/proposal.md diff --git a/openspec/changes/add-page-visual-editor/specs/landing-pages/spec.md b/openspec/changes/archive/2026-12-03-add-page-visual-editor/specs/landing-pages/spec.md similarity index 100% rename from openspec/changes/add-page-visual-editor/specs/landing-pages/spec.md rename to openspec/changes/archive/2026-12-03-add-page-visual-editor/specs/landing-pages/spec.md diff --git a/openspec/changes/add-page-visual-editor/sql/01-visual-editor-labels.sql b/openspec/changes/archive/2026-12-03-add-page-visual-editor/sql/01-visual-editor-labels.sql similarity index 100% rename from openspec/changes/add-page-visual-editor/sql/01-visual-editor-labels.sql rename to openspec/changes/archive/2026-12-03-add-page-visual-editor/sql/01-visual-editor-labels.sql diff --git a/openspec/changes/add-page-visual-editor/sql/99-rollback.sql b/openspec/changes/archive/2026-12-03-add-page-visual-editor/sql/99-rollback.sql similarity index 100% rename from openspec/changes/add-page-visual-editor/sql/99-rollback.sql rename to openspec/changes/archive/2026-12-03-add-page-visual-editor/sql/99-rollback.sql diff --git a/openspec/changes/add-page-visual-editor/tasks.md b/openspec/changes/archive/2026-12-03-add-page-visual-editor/tasks.md similarity index 100% rename from openspec/changes/add-page-visual-editor/tasks.md rename to openspec/changes/archive/2026-12-03-add-page-visual-editor/tasks.md diff --git a/openspec/specs/landing-pages/spec.md b/openspec/specs/landing-pages/spec.md index 0fd3b70..39f4a0d 100644 --- a/openspec/specs/landing-pages/spec.md +++ b/openspec/specs/landing-pages/spec.md @@ -209,7 +209,7 @@ Pages and page images SHALL follow the company scoping rules: staff see, edit an ### Requirement: The Page Editor -The editor SHALL offer the title, a slug filled from the title until edited, a meta description with a 160-character counter, the status and the block list. Blocks SHALL be added, moved up or down and removed. A chosen image SHALL be uploaded only when the page is saved. A FORM block SHALL pick from the company's enabled events that have not ended. +At 1024 px and wider the editor SHALL be the on-page editor. Below 1024 px it SHALL be the form editor. Both SHALL offer the title, a slug filled from the title until edited, a meta description with a 160-character counter, the status, adding, moving and removing blocks, and images uploaded only on save. A FORM block SHALL pick from the company's enabled events that have not ended. #### Scenario: Slug follows the title until edited @@ -217,14 +217,25 @@ The editor SHALL offer the title, a slug filled from the title until edited, a m - **WHEN** staff type the title "Hotel Technology" - **THEN** the slug becomes `hotel-technology` +#### Scenario: Narrow window keeps the form + +- **WHEN** staff open a page in a window 900 px wide +- **THEN** the form editor shows, with Preview + ### Requirement: Saving And Deleting In The Editor -Server field errors SHALL show next to their fields, keeping all entered values. After a save the editor SHALL offer a link to view the page. Deleting a page SHALL ask first, and unsaved edits SHALL be guarded. +Server field errors SHALL show at their fields, keeping all entered values. After a save the editor SHALL offer a link to view the page. Deleting a page SHALL ask first. With unsaved edits, reloading, closing and following an in-app link SHALL ask first. #### Scenario: Server error at its field - **WHEN** staff save a HERO button link `javascript:alert(1)` -- **THEN** the error shows next to that button link and every entered value stays +- **THEN** the error shows at that button link and every entered value stays + +#### Scenario: Leaving by an in-app link + +- **GIVEN** staff changed a heading and did not save +- **WHEN** they click Pages in the menu +- **THEN** the editor asks before leaving, and Cancel keeps them on the page with the change ### Requirement: Custom HTML Runs Sealed @@ -276,13 +287,20 @@ The frame SHALL grow to fit its content, between 100 and 20000 pixels, using hei ### Requirement: The Custom HTML Block In The Editor -The editor SHALL offer "Add Custom HTML", which adds an HTML block with a monospace text box, a 200000-character counter and a note that forms inside the pasted HTML do not send and the sign-up form block collects leads. The editor SHALL also offer a "hide page header" switch for the page. +The editor SHALL offer adding a Custom HTML block, edited in a monospace text box with a 200000-character counter and a note that forms inside it do not send. On the canvas the block SHALL show its last saved version as a sealed frame, marked "Save to update" while its HTML has unsaved edits. The editor SHALL offer a "hide page header" switch. #### Scenario: Adding a Custom HTML block - **WHEN** staff add a Custom HTML block and paste HTML into it - **THEN** the block shows the pasted HTML, the character count and the note about forms +#### Scenario: Unsaved HTML on the canvas + +- **GIVEN** a saved page with a Custom HTML block +- **WHEN** staff change its HTML in the panel +- **THEN** the canvas marks the block "Save to update" +- **AND** after Save the canvas shows the new HTML + #### Scenario: Hiding the header - **WHEN** staff turn on "hide page header" and save @@ -412,13 +430,13 @@ A HERO block MAY have no image; it then shows its heading, text and button on it ### Requirement: New Sections In The Editor -The page editor SHALL offer adding FEATURES, STEPS, TRUST and CTA blocks, editing their fields, adding, removing and reordering cards, and choosing any block's look. Refusals SHALL show at the field they name, including card fields. +Both editors SHALL offer adding FEATURES, STEPS, TRUST and CTA blocks, editing their fields, adding, removing and reordering cards, and choosing any block's look. Refusals SHALL show at the field they name, including card fields. #### Scenario: A refused card title shows at its field - **GIVEN** staff editing a page with a FEATURES block - **WHEN** the save is refused on field `blocks[0].cards[1].title` -- **THEN** the message shows under the second card's title field +- **THEN** the message shows at the second card's title field ### Requirement: Published Pages Keep A Separate Draft @@ -483,3 +501,72 @@ Duplicate SHALL open the editor with a copy of the page's current content (its d - **GIVEN** INS page `hotel` titled "Hotel day" - **WHEN** staff press Duplicate on it and save - **THEN** a new draft INS page `hotel-copy` titled "Hotel day (copy)" exists with the same sections + +### Requirement: The Page Canvas + +The on-page editor SHALL show the page on a canvas, rendered as visitors see it, with a Desktop view (1280 px wide, scaled to fit) and a Phone view (390 px wide). Changes SHALL show on the canvas as they are made, before saving. Links and buttons on the canvas SHALL NOT navigate, and the sign-up form SHALL show its preview note. + +#### Scenario: Phone view uses the phone layout + +- **GIVEN** a page with a FEATURES block of three cards +- **WHEN** staff switch to Phone +- **THEN** the cards stack in one column on the canvas + +#### Scenario: A change shows before saving + +- **WHEN** staff change a FEATURES card title in the side panel +- **THEN** the canvas shows the new title at once + +### Requirement: Edit Text On The Page + +Clicking a heading, short text, button label, card title or text, or FAQ question or answer on the canvas SHALL edit it in place as plain text, with the server's length limit shown when close. Rich text SHALL be edited in place with bold, italic, link, lists and alignment, and links SHALL follow the page link rule. An empty field SHALL show a faded cue naming it, and empty rich text SHALL keep room to click into. Clicking an image spot SHALL open the file picker. + +#### Scenario: Edit a heading in place + +- **WHEN** staff click the hero heading on the canvas and type "Hotel week" +- **THEN** the canvas and the side panel show "Hotel week" + +#### Scenario: An unsafe link is refused in rich text + +- **WHEN** staff add the link `javascript:alert(1)` in a Text block on the canvas +- **THEN** the link is not added and the toolbar says why + +### Requirement: Section Selection And Actions + +Clicking a section on the canvas SHALL select it, outline it and show its settings in the side panel. With none selected, the panel SHALL show the page settings. A selected section SHALL offer drag, up, down, duplicate and delete. "Add section" between sections and at the end SHALL offer every block type. Up and down SHALL work from the keyboard. A section that is added, duplicated or moved SHALL be brought into view on the canvas. + +#### Scenario: Duplicate a section + +- **WHEN** staff select the second section and press Duplicate +- **THEN** a copy appears as the third section and is selected + +#### Scenario: Add a section between two + +- **WHEN** staff press Add section between the first and second sections and choose Steps +- **THEN** a Steps section appears second and is selected + +#### Scenario: Add a section from the side panel + +- **GIVEN** the canvas shows the top of a long page +- **WHEN** staff press Add Text in the side panel +- **THEN** the canvas scrolls to the new Text section at the end, which shows a faded "Content" cue to type into + +### Requirement: Undo And Redo + +The on-page editor SHALL undo and redo page changes, up to 50 steps, by buttons and by Ctrl+Z and Ctrl+Shift+Z. The keys SHALL work wherever focus is in the editor, including after the focused control is removed or disabled, except inside a field outside the editor. Typing in one field SHALL be one step. Saving SHALL NOT clear the history. + +#### Scenario: Undo a delete + +- **GIVEN** staff deleted the FAQ section +- **WHEN** they press Ctrl+Z +- **THEN** the FAQ section is back in its place with its content + +### Requirement: Refusals On The Canvas + +When a save or publish is refused on a block field, the editor SHALL select that block, outline it, scroll it into view and show the message at the field in the side panel. A refusal on a page field SHALL show in the page settings. + +#### Scenario: A form without an event + +- **GIVEN** a page from the Event sign-up template +- **WHEN** staff save without choosing the form's event +- **THEN** the form section is selected and outlined and the panel shows the message at the Event field -- 2.54.1