docs: archive add-page-sections
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
This commit is contained in:
1 parent
d2711a5aa9
commit
7075058824
9 files changed
+82
-2
No files matched your search
+1
-1
@@ -155,7 +155,7 @@ Run the three in order before the new services-system, gateway and mobile-api go
|
||||
| `openspec/changes/archive/2026-12-03-add-lead-notifications/sql/01-notification-columns.sql` | Turns the unused `service-system`.`notification` table into the staff bell: converts it to utf8mb4 and adds the recipient, company, type, link, collapse and read columns and two indexes. DDL. |
|
||||
| `openspec/changes/archive/2026-12-03-add-lead-notifications/sql/02-notification-labels.sql` | Adds the bell's labels in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. |
|
||||
| `openspec/changes/archive/2026-12-03-add-page-anchor-links/sql/01-anchor-labels.sql` | Adds the "Link name" labels and updates the link hint and the bad-link message, in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. No DDL: link names live in the page's blocks JSON. |
|
||||
| `openspec/changes/add-page-sections/sql/01-section-labels.sql` | Adds the labels for the new page sections (feature cards, steps, trust strip, call to action), section looks and icons, in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. No DDL: sections live in the page's blocks JSON. |
|
||||
| `openspec/changes/archive/2026-12-03-add-page-sections/sql/01-section-labels.sql` | Adds the labels for the new page sections (feature cards, steps, trust strip, call to action), section looks and icons, in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. No DDL: sections live in the page's blocks JSON. |
|
||||
|
||||
Run them in order before the new services-counter, services-system and mobile-api go live: the new services read the new columns on every event lead and company query. `01` to `03` need a user that may alter tables. `99-rollback.sql` in the same folder removes the module and drops the two tables and the columns, which deletes every page, image, page address and campaign tag.
|
||||
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -8,7 +8,7 @@ Public landing pages per company, built by staff from blocks in the back office
|
||||
|
||||
### Requirement: A Page Is An Ordered List Of Typed Blocks
|
||||
|
||||
A page SHALL belong to one company and have a slug, a title, an optional meta description, a status (Draft or Published), a "hide header" flag that defaults to off, and an ordered list of zero to 30 blocks. The block types SHALL be HERO, RICH_TEXT, IMAGE_TEXT, FAQ, FORM and HTML. Blocks SHALL be returned in the order they were saved, and a valid save SHALL replace all of a page's blocks.
|
||||
A page SHALL belong to one company and have a slug, a title, an optional meta description, a status (Draft or Published), a "hide header" flag that defaults to off, and an ordered list of zero to 30 blocks. The block types SHALL be HERO, RICH_TEXT, IMAGE_TEXT, FAQ, FORM, HTML, FEATURES, STEPS, TRUST and CTA. Blocks SHALL be returned in the order they were saved, and a valid save SHALL replace all of a page's blocks.
|
||||
|
||||
#### Scenario: Blocks read back in order
|
||||
|
||||
@@ -26,6 +26,11 @@ A page SHALL belong to one company and have a slug, a title, an optional meta de
|
||||
- **WHEN** staff save a page with "hide header" on and blocks HTML, FORM
|
||||
- **THEN** reading the page returns "hide header" on and the HTML block with its HTML unchanged
|
||||
|
||||
#### Scenario: New section types read back
|
||||
|
||||
- **WHEN** staff save a page with blocks FEATURES, STEPS, TRUST and CTA
|
||||
- **THEN** reading the page returns those four blocks in that order with their cards and fields
|
||||
|
||||
### Requirement: Page Fields Are Validated Server-Side
|
||||
|
||||
A page save SHALL be refused with the offending field path, writing nothing, when the slug does not match `^[a-z0-9]+(-[a-z0-9]+)*$`, is longer than 80 characters or is used by another page of the same company, ignoring case; or when the title is blank or longer than 120 characters; or when the meta description is longer than 160 characters.
|
||||
@@ -333,3 +338,78 @@ A click on a `#name` link inside a Custom HTML block SHALL scroll the page, with
|
||||
|
||||
- **WHEN** a different window posts a same-page link request to the page
|
||||
- **THEN** the page does not scroll
|
||||
|
||||
### Requirement: Card Sections
|
||||
|
||||
A FEATURES, STEPS or TRUST block SHALL have 2 to 6 cards, with titles of at most 80 characters and texts of at most 300. FEATURES SHALL have a heading, an optional intro and cards with an icon from the fixed list, a title and a text. STEPS SHALL have a heading and numbered cards with a title and a text. TRUST SHALL have only card titles. A save breaking these rules, or using a card field its type lacks, SHALL be refused on that field.
|
||||
|
||||
#### Scenario: Feature cards show their icons
|
||||
|
||||
- **GIVEN** a published page with a FEATURES block of three cards with icons `wifi`, `tv` and `lock`
|
||||
- **WHEN** a visitor opens it
|
||||
- **THEN** the page shows the heading and three cards, each with its icon, title and text
|
||||
|
||||
#### Scenario: Unknown icon
|
||||
|
||||
- **WHEN** a page is saved with a FEATURES card whose icon is `rocket-launcher`
|
||||
- **THEN** the save is refused on field `blocks[0].cards[0].icon`
|
||||
|
||||
#### Scenario: Too few cards
|
||||
|
||||
- **WHEN** a page is saved with a STEPS block of one card
|
||||
- **THEN** the save is refused on field `blocks[0].cards`
|
||||
|
||||
#### Scenario: Steps are numbered
|
||||
|
||||
- **GIVEN** a published page with a STEPS block of three steps
|
||||
- **WHEN** a visitor opens it
|
||||
- **THEN** the steps show the numbers 1, 2 and 3 in order
|
||||
|
||||
### Requirement: Call-To-Action Band
|
||||
|
||||
A CTA block SHALL have a heading of at most 120 characters, an optional text of at most 300, and a button with both a label and a link following the button link rule. A save without the button SHALL be refused on the button field.
|
||||
|
||||
#### Scenario: A CTA needs its button
|
||||
|
||||
- **WHEN** a page is saved with a CTA block that has a heading and no button
|
||||
- **THEN** the save is refused on field `blocks[0].buttonLabel`
|
||||
|
||||
### Requirement: Section Looks
|
||||
|
||||
Any block MAY carry a look: Default, Muted, Dark or Accent. Default, or no look, SHALL render as before. Muted, Dark and Accent SHALL render the block as a full-width band in that colour with text readable on it; Accent SHALL use the company's accent colour, or the default primary colour when the company has none. Any other look SHALL be refused on that block's look field.
|
||||
|
||||
#### Scenario: A dark band
|
||||
|
||||
- **GIVEN** a published page whose CTA block has the Dark look
|
||||
- **WHEN** a visitor opens it
|
||||
- **THEN** the CTA shows as a dark full-width band with light text
|
||||
|
||||
#### Scenario: Existing pages unchanged
|
||||
|
||||
- **GIVEN** a page saved before this change, whose blocks have no look
|
||||
- **WHEN** a visitor opens it
|
||||
- **THEN** it renders as it did before
|
||||
|
||||
#### Scenario: Unknown look
|
||||
|
||||
- **WHEN** a page is saved with a block whose look is `NEON`
|
||||
- **THEN** the save is refused on field `blocks[0].look`
|
||||
|
||||
### Requirement: Hero Image Is Optional
|
||||
|
||||
A HERO block MAY have no image; it then shows its heading, text and button on its look's background. When it has an image, the image SHALL still belong to the page's company.
|
||||
|
||||
#### Scenario: Hero without an image
|
||||
|
||||
- **WHEN** a page is saved with a HERO block that has a heading and no image
|
||||
- **THEN** the save succeeds
|
||||
|
||||
### 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.
|
||||
|
||||
#### 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
|
||||
Reference in new issue
Block a user