Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
4.8 KiB
MODIFIED Requirements
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, 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
- WHEN staff save page
hotel-technologywith blocks HERO, RICH_TEXT, FORM - THEN reading the page returns those three blocks in that order with their fields
Scenario: A save replaces the blocks
- GIVEN a page whose blocks are HERO and FAQ
- WHEN it is saved with only a RICH_TEXT block
- THEN the page has only that RICH_TEXT block
Scenario: An HTML block and the header flag read back
- 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
ADDED Requirements
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,tvandlock - 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