Skip to content

feat!: block-composable site chrome (chrome.*) - #7

Merged
odenirdev merged 16 commits into
feat/section-blocksfrom
feat/chrome-blocks
Jul 4, 2026
Merged

feat!: block-composable site chrome (chrome.*)#7
odenirdev merged 16 commits into
feat/section-blocksfrom
feat/chrome-blocks

Conversation

@odenirdev

Copy link
Copy Markdown
Contributor

Summary

Makes the site header and footer block-composable in the CMS admin — stacked on #6 (section blocks); merge that first.

  • New engine category chrome.* (chrome.navbar, chrome.footer), injected at plugin register() and admitted only into two new site-setting Dynamic Zones (header/footer) — never the page body.
  • Serializer walks all three engine DZs and follows nested component refs (chrome.navbarpress.nav-item, press.button); generator types component refs, skips relations, emits nested-only components without __component, adds HeaderBlocks/FooterBlocks unions (version-skew tolerant).
  • Controller deep-populates chrome.navbar (items.page → slug + cta); bootstrap() seeds a default composition exactly once (plugin-store flag — an editor-emptied zone is respected forever).
  • Web: mapSiteSettings hydrates the zones (brand injection + nav resolution); new Navbar/Footer renderers; chromeBlocks registry joins the merge { ...referenceBlocks, ...sectionBlocks, ...chromeBlocks, ...components } (adopter overridable); token-only theme.css chrome styles; host layout renders both zones through BlockRenderer.

BREAKING changes

  • press-cms (major):site-setting.headerNav removed; Strapi drops its data on schema sync — no automated migration. Re-enter nav links once inside the seeded Navbar block (Site Settings → Header).
  • press-web (major):SiteNav no longer exported (navbar renders links internally); ResolvedPressConfig.navResolvedPressConfig.chrome. Override chrome like any block: components={{ 'chrome.navbar': MyNavbar }}.
  • press-shared (minor):Attr gains typed component/repeatable keys (additive).

Verification

  • Full gate green: typecheck all packages; cli 21/21, cms 43/43, web 173/173; pnpm build 6/6 (cms strapi-plugin build + playground Next build).
  • Live playground checks: schema serves site-setting + both DZs (incl. dynamic custom.callout admission); press.nav-item enters the components map via nested-ref walking without being a DZ member; seed upgrade path filled header=[chrome.navbar]/footer=[chrome.footer] on an existing DB; :3000 renders both chrome blocks with the brand · year footer fallback; regenerated playground types committed.
  • Executed task-by-task with per-task spec+quality reviews and a final whole-branch review (ready to merge; the single fix-before-merge finding — a dropped test — re-added in 62c785c).

Remaining manual smoke test (before release): in the admin, add a nav item pointing at a page inside the seeded Navbar block, publish, and confirm the link renders and resolves to the page slug on :3000; a fresh-DB seed (pnpm play:create) has only unit-level coverage.

🤖 Generated with Claude Code

odenirdevand others added 16 commits July 3, 2026 19:27
Approved brainstorming output: site-setting gains header/footer dynamic
zones, a new engine-owned chrome.* palette (navbar, footer), serializer +
generator extensions for nested components, seed on bootstrap, and the
breaking removal of headerNav.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ent refs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…unions
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rNav
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e public exports
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
odenirdev added a commit that referenced this pull request Jul 4, 2026
* docs: add design spec for composite section blocks (section.*)
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>
* feat(cms): inject section.hero and section.cta components
* feat(cms): admit section.* into page DZ and serialize them
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(web): pin zero-change section generation in the type generator
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(web): add SectionHero/SectionCta types and the Hero renderer
* feat(web): add the Cta section renderer
* feat(web): merge sectionBlocks into BlockRenderer and export the palette
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.
* feat(web): theme section.hero and section.cta from press-* tokens
* docs: document section.* palette and add changeset
* docs(web): cite Spec §5.2 in the section.cta theme comment
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>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@odenirdev
odenirdev merged commit 90f8de6 into feat/section-blocksJul 4, 2026
1 check passed
odenirdev added a commit that referenced this pull request Jul 4, 2026
* docs: add design spec for composite section blocks (section.*)
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>
* feat(cms): inject section.hero and section.cta components
* feat(cms): admit section.* into page DZ and serialize them
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(web): pin zero-change section generation in the type generator
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(web): add SectionHero/SectionCta types and the Hero renderer
* feat(web): add the Cta section renderer
* feat(web): merge sectionBlocks into BlockRenderer and export the palette
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.
* feat(web): theme section.hero and section.cta from press-* tokens
* docs: document section.* palette and add changeset
* docs(web): cite Spec §5.2 in the section.cta theme comment
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>
* docs: add chrome blocks design spec (block-composable header/footer)
Approved brainstorming output: site-setting gains header/footer dynamic
zones, a new engine-owned chrome.* palette (navbar, footer), serializer +
generator extensions for nested components, seed on bootstrap, and the
breaking removal of headerNav.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(cms): add chrome.navbar and chrome.footer engine components
* feat(cms)!: site-setting chrome DZs replace headerNav; custom.* admitted into all engine DZs
* feat(cms): serialize site-setting chrome DZs and follow nested component refs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(web): generator types nested component refs and emits chrome DZ unions
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(cms)!: site-setting controller populates chrome DZs, drops headerNav
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(cms): seed default chrome composition once via plugin-store flag
* feat(web)!: ResolvedPressConfig.chrome with hydrated chrome DZs replaces nav
* feat(web)!: Navbar chrome renderer; SiteNav becomes internal NavLinks
* feat(web): Footer chrome renderer with brand-year fallback
* feat(web): chromeBlocks registry joins the BlockRenderer merge; chrome public exports
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(web)!: host template renders block-composed chrome; token-only navbar/footer styles
* docs: changeset and architecture notes for chrome blocks
* docs: type-sync loop section reflects the three-DZ serializer
* chore(playground): regenerate types with chrome blocks
* test(web): pin non-http nav url resolving with external:false
* feat: introduce canonical URN identity for pages and site settings
- Add a new document outlining design decisions for the canonical URN identity.
- Implement `mapPage` function to attach canonical stored identity `urn:page:{documentId}`.
- Create `quietSchemaHttpLog` to suppress schema polling logs in development.
- Add tests for `mapPage`, `buildUrn`, and `quietSchemaHttpLog` to ensure functionality.
- Define identity primitives in `urn.ts` for structured URN generation.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <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