Skip to content

feat(cms): dedicated page hero field - one H1, sections are H2 - #216

Merged
dogfrogfog merged 1 commit into
feat/cms-section-heading-patternfrom
feat/cms-dedicated-page-hero
Oct 28, 2026
Merged

dogfrogfog merged 1 commit into
feat/cms-section-heading-patternfrom
feat/cms-dedicated-page-hero

Conversation

@dogfrogfog

Copy link
Copy Markdown
Member

Recreates #163 on top of the recreated heading-pattern PR (base: feat/cms-section-heading-pattern). Merge that one first.

What

  • Page gets a hero field: a blocks field above the sections, required, exactly one row (minRows: 1, maxRows: 1), localized like the sections. Its block types come from blocks/heroBlocks.ts, so new hero variants are added there without touching the sections.
  • Hero removed from sections: it's no longer in contentBlocks, so it can't be added to the sections array or to global sections. The sections field is now labelled "Sections", and both fields tell editors which heading level they produce.
  • Rendering: RenderHero renders the single visible hero before RenderBlocks. Result: one h1 at the top of the page and h2 for every section title, enforced by the structure rather than by editors.
  • Search text, SEO content extraction, the search image lookup and the MCP collection description read the new field.

Migration 20261028_134825_dedicated_page_hero

Payload keeps every block slug in one table per collection, told apart by _path. So moving heroes needs no table changes:

  • In page_blocks_hero / _page_v_blocks_hero, the first hero per page, locale and version moves from blocks to hero.
  • Extra heroes on the same page are deleted: the new structure allows only one.
  • Heroes inside global sections are dropped (Drizzle drops the gsec_*_hero tables). A global section can sit anywhere in the sections, so letting it hold a hero would allow a second h1 again.
  • down moves heroes back to the top of blocks. Deleted heroes are not restored.

Verified locally

  • Migrations apply from scratch on Postgres 17 + pgvector, and migrate:down then migrate round-trips the new migration cleanly.
  • payload migrate:create afterwards reports no schema changes, and generate:types produces no diff.
  • check-types passes.
  • Data migration (two heroes in en, one in es, one h1 per locale, no orphaned action rows, API rejects 0 or 2 heroes) was verified on the old PR. The SQL is the same.
  • The migration SQL and snapshot are carried over unchanged from the old PR: the new snapshot differs from the old one only by its id.

Port the hero work from #163 onto current main and recreate its migration
(dedicated_page_hero) so it sorts after section_heading_group.

Scopes: apps/cms Page collection, blocks, search extraction, mcp, database/migrations.
@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ideal-cms Ready Ready Preview Oct 28, 2026 1:51pm UTC

Request Review

@dogfrogfog
dogfrogfog added this pull request to stack #217 October 28, 2026 13:54
@dogfrogfog
dogfrogfog merged commit 675f1ec into main Oct 28, 2026
2 checks passed
@dogfrogfog
dogfrogfog deleted the feat/cms-dedicated-page-hero branch October 28, 2026 13:55

This branch was successfully deployed

1 active deployment
Preview — 5a5a5545 Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to 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