Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
2.5 KiB
2.5 KiB
Context
Design: docs/superpowers/specs/2026-12-03-page-builder-design.md, change 1. Blocks are one JSON list per page, validated by CmsBlockValidator, passed through mobile-api as maps, rendered by LandingPage/Block in CmsBlocks.tsx, and edited by BlockFields.tsx.
Goals / Non-Goals
Goals: four new section types, a look per section, an optional hero image, form-editor support.
Non-Goals: the on-page editor and templates (changes 2 and 3); per-element colours or fonts.
Decisions
- One
cardslist for FEATURES, STEPS and TRUST: items{icon, title, text}. FEATURES uses all three (icon required, from a fixed list); STEPS uses title and text (numbered by position); TRUST uses title only. Fields a type does not use are refused, so stored JSON stays clean. Limits: 2 to 6 cards, title 80, text 300. - Icons are a fixed list of Lucide names:
wifi, phone, tv, monitor, lock, shield-check, cloud, wrench, headset, users, calendar, star. The server checks the name; the portal maps names to components, so no icon markup is stored. - CTA is heading (required), text (optional) and a button (required: a CTA without one has no purpose). Same link rule as other buttons.
- Look is an optional block field
look:DEFAULT(or absent),MUTED,DARK,ACCENT. Any block type may carry it. Non-default looks render the block as a full-width band (background across the window, content in the usual width, vertical padding);ACCENTuses the company accent withcontrastTextfor the text, falling back to the default primary colour.DEFAULTrenders as today, so existing pages are unchanged. - Hero image optional. A hero without an image already renders as plain text in the renderer; only the validator's requirement goes. A given image must still be the company's.
- Editor. Each new type gets an "Add …" button, its fields, and a card list with add/remove/move like FAQ items. The look picker is a select on every block.
Risks / Trade-offs
- A Dark or Accent band right after another band of the same look merges visually → acceptable; staff see it in the preview.
HTMLblocks ignore a look: a Custom HTML block is a full design of its own, so the editor does not offer the picker for it and the renderer draws no band.- Rollback: pages saved with new types must be edited before the previous release saves them; their new sections render as nothing under it.
Migration Plan
Deploy services-counter and the portal; run sql/01-section-labels.sql. Rollback: previous images and sql/99-rollback.sql.