Skip to content

feat: composite section blocks (section.*) - #6

Merged
odenirdev merged 10 commits into
mainfrom
feat/section-blocks
Jul 4, 2026
Merged

feat: composite section blocks (section.*)#6
odenirdev merged 10 commits into
mainfrom
feat/section-blocks

Conversation

@odenirdev

Copy link
Copy Markdown
Contributor

Composite section blocks (section.*)

Ships an engine-owned palette of composite sectionssection.hero and
section.cta — that are admitted into the page body Dynamic Zone automatically,
render as semantic HTML branded by the adopter's theme, and are overridable via
BlockRenderer. It mirrors the existing press.* reference-block mechanism into a
separatesection.* category, preserving the three-palette split
(press.* atoms / section.* sections / custom.* adopter).

What's in it

LayerChange
CMS (press-cms)Injects section.hero/section.cta under a new section category (deterministic globalId); admits them statically into the page DZ (page/schema.json). serialize-schema unchanged.
Type-syncGenerator emits SectionHero/SectionCta + the PageBody union with zero generator change — v1 fields are all flat scalar/media/enum (pinned by a test).
Web (press-web)Tolerant Hero/Cta renderers (no title → nothing; CTA/button only when both parts present — no dead links). Separate sectionBlocks registry; BlockRenderer merges { ...referenceBlocks, ...sectionBlocks, ...components } so adopters still win last and can override any section.
Themetheme.css section rules are a pure var(--press-*) token consumer — sections are born branded by Site Settings, no override required.
ReleaseCLAUDE.md documents the third palette; changeset bumps both engine packages minor.

Invariants held

  • Additive & non-breaking: press.* and custom.* untouched; press.hero stays removed.
  • PressSchema type-only on both sides; generator references no Strapi/React types.
  • Adopters get section.* for free on press upgrade — no host-template change.

Verification

  • pnpm -r test → cli 21/21, cms 24/24, web 146/146; pnpm -r typecheck clean; pnpm build (incl. cms strapi-plugin build + playground Next build) green.
  • Whole-branch review verdict: Ready to merge (zero Critical/Important). Type coherence verified across all five layers; registry-key identity byte-identical; generator/serializer change count zero.

⚠️ Before merge/release — live dogfood (Task 9, manual)

Not yet done (needs the running app): boot pnpm play, author a Hero + CTA page in the admin, confirm both render branded on :3000, and commit the regenerated apps/playground/.../generated.ts if the sync changes it. Also eyeball the hero image+content layout (single-column display:grid — add grid-template-columns if side-by-side is wanted).

🤖 Generated with Claude Code

odenirdevand others added 10 commits July 1, 2026 20:51
Approved brainstorming design for an engine-owned section palette under a
new Strapi category `section.*`, mirroring the existing press.* injection +
type-sync mechanism. v1 ships two flat sections (section.hero, section.cta);
sections with nested repeatable components (FeatureGrid, Testimonials) are
deferred to a second spec.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Widen packages/web/vitest.config.ts test.include to src/**/*.test.{ts,tsx}
so the new block-renderer.test.tsx (authored with JSX) is discovered by
vitest; prior config only matched *.test.ts.
Final-review Minor #7: match the section.hero sibling's citation and the
"comments cite Spec §…" convention. Comment-only; no behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@odenirdev
odenirdev merged commit 490bdc7 into mainJul 4, 2026
1 check passed
odenirdev added a commit that referenced this pull request Jul 4, 2026
main's squash of PR #6 (section blocks) is content-identical to commit
42fd5df, already an ancestor of this branch, so every conflict resolves
to the branch side; the merge tree is byte-identical to pre-merge HEAD.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@odenirdev