diff --git a/openspec/changes/add-page-sections/design.md b/openspec/changes/add-page-sections/design.md
index 00183a0..4bba038 100644
--- a/openspec/changes/add-page-sections/design.md
+++ b/openspec/changes/add-page-sections/design.md
@@ -20,7 +20,7 @@ Design: `docs/superpowers/specs/2026-12-03-page-builder-design.md`, change 1. Bl
## 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.
-- `HTML` blocks with a look: the band surrounds the frame; harmless.
+- `HTML` blocks 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
diff --git a/openspec/changes/add-page-sections/tasks.md b/openspec/changes/add-page-sections/tasks.md
index 1447063..a62c23b 100644
--- a/openspec/changes/add-page-sections/tasks.md
+++ b/openspec/changes/add-page-sections/tasks.md
@@ -9,7 +9,7 @@ Design: `design.md` and `docs/superpowers/specs/2026-12-03-page-builder-design.m
## 2. Portal
-- [ ] 2.1 Model and renderer: types, `emptyBlock`, `BLOCK_LABELS`, icon map; `CmsBlocks` renders the four new types and the looks (full-width bands, readable text, Accent from the company colour); Default unchanged.
+- [x] 2.1 Model and renderer: types, `emptyBlock`, `BLOCK_LABELS`, icon map; `CmsBlocks` renders the four new types and the looks (full-width bands, readable text, Accent from the company colour); Default unchanged.
- [ ] 2.2 Editor: add buttons, fields and card lists (add, remove, move) for the new types, the look select on every block, inline card errors; labels in `defaultMessages.ts` and `zh_CN.seed.json`, `npm run i18n:sql`, `sql/01-section-labels.sql` and `sql/99-rollback.sql`.
- Verify (2.1 to 2.2): `cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint`
diff --git a/solvway-admin-portal/app/components/pages/CmsBlocks.sections.test.tsx b/solvway-admin-portal/app/components/pages/CmsBlocks.sections.test.tsx
new file mode 100644
index 0000000..df69a48
--- /dev/null
+++ b/solvway-admin-portal/app/components/pages/CmsBlocks.sections.test.tsx
@@ -0,0 +1,77 @@
+import { render, screen, within } from "@testing-library/react";
+import { describe, it, expect } from "vitest";
+import { LandingPage, type PublicBlock } from "./CmsBlocks";
+
+// add-page-sections: card sections, the CTA band, section looks and the image-less hero.
+const company = { code: "INS", name: "INS Sdn Bhd", logoImageId: null, accentColor: "#FFEE00" };
+const page = (blocks: PublicBlock[]) => ({ slug: "hotel", title: "Hotel day", blocks });
+
+describe("LandingPage: sections", () => {
+ it("shows feature cards with their icons, titles and texts", () => {
+ render();
+ expect(screen.getByRole("heading", { name: "What we do" })).toBeInTheDocument();
+ expect(screen.getByText("One partner.")).toBeInTheDocument();
+ const items = screen.getAllByRole("listitem");
+ expect(items).toHaveLength(2);
+ expect(within(items[0]).getByRole("heading", { name: "Managed WiFi" })).toBeInTheDocument();
+ expect(items[0].querySelector("svg.lucide-wifi")).not.toBeNull();
+ expect(items[1].querySelector("svg.lucide-tv")).not.toBeNull();
+ });
+
+ it("numbers steps in order", () => {
+ render();
+ const list = screen.getByRole("list");
+ expect(list.tagName).toBe("OL");
+ const items = within(list).getAllByRole("listitem");
+ expect(items.map((li) => li.textContent)).toEqual(["1SurveyWe visit.", "2InstallWe fit it.", "3SupportWe stay."]);
+ });
+
+ it("shows a trust strip of short items", () => {
+ render();
+ expect(screen.getAllByRole("listitem").map((li) => li.textContent)).toEqual(["Certified with LG", "Local support"]);
+ });
+
+ it("shows a call-to-action band with its button, and drops an unsafe one", () => {
+ render();
+ expect(screen.getByRole("heading", { name: "Ready?" })).toBeInTheDocument();
+ expect(screen.getByRole("link", { name: "Get a quote" })).toHaveAttribute("href", "#signup");
+ expect(screen.queryByRole("link", { name: "Evil" })).not.toBeInTheDocument();
+ });
+
+ it("draws a non-default look as a full-width band and leaves default blocks as before", () => {
+ render();
+ const band = (name: string) => screen.getByRole("heading", { name }).closest("[data-look]");
+ expect(band("Dark")).toHaveAttribute("data-look", "DARK");
+ expect(band("Dark")).toHaveClass("bg-foreground", "text-background");
+ expect(band("Accent")).toHaveClass("bg-primary", "text-primary-foreground");
+ expect(band("Muted")).toHaveClass("bg-muted");
+ expect(band("Plain")).toBeNull();
+ expect(band("Junk")).toBeNull();
+ // On an accent band the button flips, so it never matches the band's colour.
+ expect(within(band("Accent") as HTMLElement).getByRole("link", { name: "Go" })).toHaveClass("bg-background", "text-foreground");
+ });
+
+ it("shows a hero without an image as text on its look's background", () => {
+ render();
+ expect(screen.getByRole("heading", { name: "No picture" })).toBeInTheDocument();
+ expect(document.querySelector("main img")).toBeNull();
+ expect(screen.getByRole("link", { name: "Join" })).toBeInTheDocument();
+ // On a band the hero takes the band's colours; its own grey box would put light text on a light background.
+ expect(screen.getByRole("heading", { name: "No picture" }).closest("section")).not.toHaveClass("bg-muted");
+ });
+});
diff --git a/solvway-admin-portal/app/components/pages/CmsBlocks.tsx b/solvway-admin-portal/app/components/pages/CmsBlocks.tsx
index 5cdd65f..95ab27e 100644
--- a/solvway-admin-portal/app/components/pages/CmsBlocks.tsx
+++ b/solvway-admin-portal/app/components/pages/CmsBlocks.tsx
@@ -1,5 +1,5 @@
import type { CSSProperties, ReactNode } from "react";
-import { anchorId, contrastText, imageSrc, isSafeLink, type CmsBlock } from "@/app/lib/cmsPages";
+import { ICONS, LOOKS, anchorId, contrastText, imageSrc, isSafeLink, type CmsBlock, type Look } from "@/app/lib/cmsPages";
import type { RegistrationInfo } from "@/app/lib/services/publicRegistration";
import { SafeHtml } from "./SafeHtml";
import { LandingForm } from "./LandingForm";
@@ -20,12 +20,21 @@ export interface Branding {
const PROSE = "space-y-3 text-base leading-relaxed [&_a]:text-primary [&_a]:underline [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_h2]:text-2xl [&_h2]:font-semibold [&_h3]:text-xl [&_h3]:font-semibold [&_ol]:list-decimal [&_ol]:pl-5 [&_ul]:list-disc [&_ul]:pl-5";
+// add-page-sections: non-default looks are full-width bands. On an accent band the button flips to stay visible.
+const BANDS: Record, string> = {
+ MUTED: "bg-muted text-foreground",
+ DARK: "bg-foreground text-background",
+ ACCENT: "bg-primary text-primary-foreground",
+};
+const bandOf = (look: unknown) => (LOOKS.includes(look as Look) && look !== "DEFAULT" ? (look as Exclude) : null);
+
function ButtonLink({ block }: { block: CmsBlock }) {
if (!block.buttonLabel || !isSafeLink(block.buttonUrl)) return null;
const external = /^https:/i.test(block.buttonUrl!);
+ const colours = bandOf(block.look) === "ACCENT" ? "bg-background text-foreground" : "bg-primary text-primary-foreground";
return (
+ className={`inline-flex h-11 items-center rounded-md px-5 text-sm font-medium hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none ${colours}`}>
{block.buttonLabel}
);
@@ -40,7 +49,7 @@ function Block({ block, index, company, slug, preview }: { block: PublicBlock; i
switch (block.type) {
case "HERO":
return (
-
+
{block.heading ?
{block.heading}
: null}
@@ -83,6 +92,60 @@ function Block({ block, index, company, slug, preview }: { block: PublicBlock; i
);
+ case "FEATURES":
+ return (
+
+
: null}
+
+
+ );
default:
return null;
}
@@ -90,6 +153,17 @@ function Block({ block, index, company, slug, preview }: { block: PublicBlock; i
const WIDTH = "mx-auto w-full max-w-5xl px-4";
+/** A block in the page width; with a non-default look, inside a full-width band of that colour. */
+function Section({ block, children }: { block: PublicBlock; children: ReactNode }) {
+ const band = bandOf(block.look);
+ if (!band) return
{children}
;
+ return (
+
+
{children}
+
+ );
+}
+
/**
* A whole landing page: the company header (logo, accent), the title as the only h1, then the blocks. Custom HTML
* blocks run full width; with hideHeader the header goes and the title is for screen readers only.
@@ -124,7 +198,7 @@ export function LandingPage({ company, page, banner, preview, frameBase }: {