Skip to content

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

Closed
dogfrogfog wants to merge 2 commits into
claude/practical-hawking-v6okaxfrom
claude/practical-hawking-v6okax-hero
Closed

dogfrogfog wants to merge 2 commits into
claude/practical-hawking-v6okaxfrom
claude/practical-hawking-v6okax-hero

Conversation

@dogfrogfog

Copy link
Copy Markdown
Member

Stacked on the heading-pattern PR (base: claude/practical-hawking-v6okax). 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 20261002_092121_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

  • Seeded page with two heroes in en and one in es: after migration it has one hero per locale in the new field and renders exactly one h1 at the top. Down/up round trip is clean, and there are no orphaned hero action rows.
  • payload migrate:create afterwards reports no schema changes.
  • API: publishing with 0 or 2 heroes is rejected; a hero block inside sections is rejected.
  • The admin form shows the Hero field above Sections.
  • check-types, lint and test:int (54/54) pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U6co4xd2fjA45YxTjXXjc3


Generated by Claude Code

Pages now have a `hero` blocks field (exactly one block) above the
sections, and the hero is no longer available in the sections array or
in global sections. The hero always renders the page's only H1 at the
top; every section title renders as H2, so the heading structure is
correct by construction. Hero blocks live in `heroBlocks`, so new hero
variants can be added without touching the sections.

The migration moves each page's first hero (per locale and version)
into the new field and removes extra heroes, which the new structure
can no longer hold. Heroes inside global sections are dropped for the
same reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6co4xd2fjA45YxTjXXjc3
@vercel

vercel Bot commented Oct 2, 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 8, 2026 4:20pm UTC

Request Review

@dogfrogfog

Copy link
Copy Markdown
Member Author

Superseded by #216 (recreated on current main with a regenerated migration). Merged.

@dogfrogfog dogfrogfog closed this Oct 28, 2026

This branch was successfully deployed

1 active deployment
Preview — b89343d6 Deployed Oct 8, 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.

2 participants