From 6f56ef42050e4674bba2bfbffdb2d15a65651cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Thu, 29 Oct 2026 16:38:04 +0100 Subject: [PATCH 1/2] Block library: item headings follow the section; the leading block's first image is the LCP image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by ipal-doctor live-seo on the reference archive pages (entry list under a page header without a picture): cards jumped h1 → h3, and the first card image was lazy. - itemHeadingLevel: items one below the section heading (h3 under h2, h2 under the page h1, h2 when the block shows no heading); createBlockRegistry({ itemHeadings }) fixes a level per block. featureGrid, entryList, pricing, steps, team. - blockPosition / blockHasImage (root): createPageRoute and the 404 view pass firstImage next to isFirst; leadsWithImage marks the first image of the leading block eager + fetchPriority high (hero, textMedia, featureGrid, gallery, team, entryList); priorityImage: false turns it off. - reference/ipal-doctor.json: the two live-seo silences removed; reference skills and docs/agent/reference-site/INDEX.md refreshed. - bin/ipal-blocks.mjs executable like the other bins. Co-Authored-By: Claude Opus 5.5 --- bin/ipal-blocks.mjs | 0 docs/CHANGELOG.md | 5 +++ docs/agent/reference-site/INDEX.md | 10 ------ .../skills/ipal-reference/resources/api.md | 6 ++-- docs/block-library.md | 13 ++++++-- docs/blocks.md | 3 +- docs/frontend.md | 5 ++- .../skills/ipal-reference/resources/api.md | 6 ++-- reference/ipal-doctor.json | 10 ------ src/exports/blocks-rsc.ts | 2 ++ src/index.ts | 1 + .../blocks/entryList/Component.tsx | 9 +++-- .../blocks/featureGrid/Component.tsx | 12 ++++--- .../blocks/gallery/Component.tsx | 4 ++- .../block-library/blocks/hero/Component.tsx | 5 +-- .../blocks/pricing/Component.tsx | 9 +++-- .../block-library/blocks/steps/Component.tsx | 6 ++-- .../block-library/blocks/team/Component.tsx | 9 +++-- .../blocks/textMedia/Component.tsx | 3 +- src/modules/block-library/context.ts | 7 ++++ src/modules/block-library/ui/levels.ts | 30 +++++++++++++++++ src/modules/blocks/index.ts | 1 + src/modules/blocks/position.ts | 27 +++++++++++++++ src/modules/frontend/pageRoute.tsx | 10 +++--- test/blockLibraryRender.test.ts | 33 ++++++++++++++++++- test/blockPosition.test.ts | 29 ++++++++++++++++ test/integration.test.ts | 4 +++ 27 files changed, 206 insertions(+), 53 deletions(-) mode change 100644 => 100755 bin/ipal-blocks.mjs create mode 100644 src/modules/block-library/ui/levels.ts create mode 100644 src/modules/blocks/position.ts create mode 100644 test/blockPosition.test.ts diff --git a/bin/ipal-blocks.mjs b/bin/ipal-blocks.mjs old mode 100644 new mode 100755 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 73c78b5..de19da8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -80,6 +80,11 @@ fifteen ready page sections and ten page templates. A new site in one command: ` Type `CookieButtonProps`. ### Fixed +- **Block library — headings and the LCP image** (found by `ipal-doctor` live-seo on the archive pages): item headings + follow the section — `h3` under a section heading, `h2` when the block shows none (an entry list under the page header + no longer jumps `h1` → `h3`); override with `createBlockRegistry({ itemHeadings: { entryList: 'h3' } })`. The first + image of the block that leads the page loads eagerly with high priority — `createPageRoute` now passes `firstImage` + ("no block before this one shows an image", `blockPosition`) next to `isFirst`; `priorityImage: false` turns it off. - **Sitemap, llms.txt, the site index (MCP `list_pages`), search (`searchContent`, the search route, MCP `search_content`):** the page assigned as the 404 page is no longer listed — it answers 404 at its own address (`unlistedPageIds(settings)`). A 404 page that is also the homepage stays. diff --git a/docs/agent/reference-site/INDEX.md b/docs/agent/reference-site/INDEX.md index 677d79f..e9f281b 100644 --- a/docs/agent/reference-site/INDEX.md +++ b/docs/agent/reference-site/INDEX.md @@ -81,16 +81,6 @@ legacy-peer-deps=true "until": "2026-11-30", "reason": "Follow-up for the reference-site track: three pages per language have no own meta description and fall back to the site description; the seed should give each page one" }, - "live-seo:heading-levels-skipped": { - "off": true, - "until": "2026-11-30", - "reason": "Follow-up for the block-library track: entryList cards use h3 with no h2 on the archive pages (h1 → h3)" - }, - "live-seo:first-image-not-prioritised-lcp": { - "off": true, - "until": "2026-11-30", - "reason": "Follow-up for the block-library track: on the archive pages the first image is an entryList card, which is not marked priority" - }, "live-seo:thin-pages-words": { "off": true, "until": "2026-11-30", diff --git a/docs/agent/skills/ipal-reference/resources/api.md b/docs/agent/skills/ipal-reference/resources/api.md index 4ec4ddc..fc0838c 100644 --- a/docs/agent/skills/ipal-reference/resources/api.md +++ b/docs/agent/skills/ipal-reference/resources/api.md @@ -104,6 +104,7 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT | Export | Import from | What it does / when | |---|---|---| | `RenderBlocks` | `@intecion/ipal-kit/rsc` | Server block renderer: `{ blocks, components, enhanceProps? }` — each block through a `blockType → component` map, skips unknown ones, no extra markup. Do not write your own loop over blocks. Nested blocks render their own `RenderBlocks` (do not pass the map as a prop). | +| `blockPosition({ allBlocks, index })`, `blockHasImage(data)` | `@intecion/ipal-kit` | `{ isFirst, firstImage }` for a block — first section (page `h1`) and "no earlier block shows an image" (LCP image); createPageRoute passes both, spread it in your own `enhanceProps`. | | `buildSectionHeaderField(opts?)` | `@intecion/ipal-kit` | `header` field group (eyebrow, heading, intro — localized) for every section block; `interfaceName` `SectionHeaderData`. Options: `name`, `fields`, `interfaceName`. | | `buildSectionSettingsField(opts?)` | `@intecion/ipal-kit` | `settings` group in the block sidebar: `anchor` (#id) + `background` (select, default Default/Muted/Inverted) + your own fields; instead of a per-block `bgColor`/`sectionId`. | @@ -125,18 +126,19 @@ Fifteen ready blocks and ten page templates. **Use a library block (or a variant | `blockThumbnail(slug)` | `@intecion/ipal-kit/blocks` | Inline SVG sketch (data URL) for the block picker — what `thumbnail: true` uses. | | `faqItemsFromLayout(doc, { field?, slugs? })` | `@intecion/ipal-kit/blocks` | FAQ questions of the page's FAQ blocks → `getPageJsonLd(locale, slug, { faq: faqItemsFromLayout })` (FAQPage). | | `blockLibraryManifest`, `buildBlockLibraryManifest()`, `fieldPaths(fields)` | `@intecion/ipal-kit/blocks` | Plain data: every block's slug, interface name, variants, stored field paths; primitives, field builders, templates — for `ipal-doctor` and tests. | -| `createBlockRegistry(content, options?)` | `@intecion/ipal-kit/blocks/rsc` | `blockType → component` map for `createPageRoute` / `RenderBlocks`, bound to lib/content. Options: `Image`, `Link` (next/image, next/link), `sendForm`, `formClassNames`, `contactDetails`, `classNames` (per block part), `ui` (swap primitives), `components` (swap a block), `backgrounds`, `slugs`, `only`, `extra` (own blocks), `noSnippet` (e.g. `['cta']`), `icons`, `texts`, `lightbox`, `richText`, `entryCard`, `mapTestimonial`. | +| `createBlockRegistry(content, options?)` | `@intecion/ipal-kit/blocks/rsc` | `blockType → component` map for `createPageRoute` / `RenderBlocks`, bound to lib/content. Options: `Image`, `Link` (next/image, next/link), `sendForm`, `formClassNames`, `contactDetails`, `classNames` (per block part), `ui` (swap primitives), `components` (swap a block), `backgrounds`, `slugs`, `only`, `extra` (own blocks), `noSnippet` (e.g. `['cta']`), `itemHeadings`, `priorityImage`, `icons`, `texts`, `lightbox`, `richText`, `entryCard`, `mapTestimonial`. | | `LIBRARY_BLOCK_COMPONENTS` | `@intecion/ipal-kit/blocks/rsc` | The plugin's component per slug. | | `HeroBlock`, `TextMediaBlock`, `FeatureGridBlock`, `GalleryBlock`, `FaqBlock`, `CtaBlock`, `ContactBlock`, `TeamBlock`, `PricingBlock`, `LogosBlock`, `TestimonialsBlock`, `StatsBlock`, `RichTextBlock`, `StepsBlock`, `EntryListBlock` | `@intecion/ipal-kit/blocks/rsc` | The block components (server; props `LibraryBlockProps`: data + `locale`, `isFirst`, `ui`, `ctx`, `classNames`). | | `HERO_PARTS`, `TEXT_MEDIA_PARTS`, `FEATURE_GRID_PARTS`, `GALLERY_PARTS`, `FAQ_PARTS`, `CTA_PARTS`, `CONTACT_PARTS`, `TEAM_PARTS`, `PRICING_PARTS`, `LOGOS_PARTS`, `TESTIMONIALS_PARTS`, `STATS_PARTS`, `RICH_TEXT_PARTS`, `STEPS_PARTS`, `ENTRY_LIST_PARTS` | `@intecion/ipal-kit/blocks/rsc` | Default token classes per block part — the keys of `classNames`. | | `defaultEntryCard(doc)`, `defaultTestimonial(doc)` | `@intecion/ipal-kit/blocks/rsc` | Default mapping of a collection document to an entry card / a testimonial (`entryCard`, `mapTestimonial` replace them). | | `Section`, `SECTION_BACKGROUNDS`, `SectionHeader`, `Media`, `CMSLink`, `Anchor`, `buttonClass`, `BUTTON_CLASSES`, `Container`, `CONTAINER_WIDTHS`, `Card`, `CARD_CLASS`, `CARD_INTERACTIVE_CLASS` | `@intecion/ipal-kit/blocks/rsc` | UI primitives, token utilities only: section (anchor, background, `data-surface`), heading group, image/video, panel link, link element, button looks, page column, card. | +| `itemHeadingLevel(slug, props)`, `leadsWithImage(props)` | `@intecion/ipal-kit/blocks/rsc` | Item heading tag (one below the section heading; `h2` without one; `itemHeadings` overrides) and whether the block's first image is the page's LCP image (`isFirst` / `firstImage`; `priorityImage: false` turns it off). | | `Buttons`, `headingId(block)`, `TitleLink`, `GRID_COLUMNS`, `cx`, `parts(defaults, overrides)` | `@intecion/ipal-kit/blocks/rsc` | Helpers for own blocks: button row, heading id for `aria-labelledby`, card title link (plain text when the link is dead), grid columns, class joining, part classes. | | `BLOCK_TEXTS`, `blockTexts(locale, own?)`, `fillText(text, value)` | `@intecion/ipal-kit/blocks/rsc` | Visitor texts the blocks write (rating, step) in en/pl; override with `texts`. | | `pageTemplates` | `@intecion/ipal-kit/templates` | `home`, `about`, `services`, `service`, `contact`, `blogIndex`, `post`, `legal(role)`, `cookiePolicy`, `notFound` → `{ title, slug, layout }` for `seed.upsertBySlug('pages', …)`. Options: `blocks`, `overrides`, `layout`, `slug`, `title`, `defaultLocale`, `linkTo`; `contact`/`service` take `form` (`{ $form: 'title' }`). After launch: only with `SEED_ONLY`. | | `systemPageRefs(roles)` | `@intecion/ipal-kit/templates` | `{ homepage: 'start' }` → `{ homepage: { $page: 'start' } }` for `seed.fillGlobal('site-settings', …)`. | -**Types:** `BlockOptions`, `BlockBuilder`, `BlockLocalization`, `LibraryBlockSetting`, `LibraryBlocksShared`, `LibraryBlockSlug`, `LibraryBlocksOptions`, `VariantOption`, `LibraryBlockDefinition`, `ContactOptions`, `EntryListOptions`, `FeatureGridOptions`, `TestimonialsOptions`, `ItemsFieldOptions`, `MediaFieldOptions`, `VariantFieldOptions`, `IconFieldOptions`, `Columns`, `BlockLibraryManifest`, `ManifestBlock`, `ManifestField` (`/blocks`); `BlockRegistryOptions`, `BlockContent`, `BlockContext`, `BlockUi`, `LibraryBlockProps`, `ContactDetail`, `EntryCard`, `TestimonialItem`, `BlockTexts`, `PartClasses`, `BaseBlockData`, `LinkData`, `LinksData`, `MediaValue`, `RichTextData`, `SectionHeaderData`, `SectionSettingsData`, `HeroBlockData`, `TextMediaBlockData`, `FeatureGridBlockData`, `FeatureItem`, `GalleryBlockData`, `GalleryItem`, `FaqBlockData`, `FaqItem`, `CtaBlockData`, `ContactBlockData`, `TeamBlockData`, `TeamMember`, `PricingBlockData`, `PricingPlan`, `LogosBlockData`, `LogoItem`, `TestimonialsBlockData`, `StatsBlockData`, `StatItem`, `RichTextBlockData`, `StepsBlockData`, `StepItem`, `EntryListBlockData`, `CMSLinkProps`, `ResolveLink`, `LinkComponent`, `ImageComponent`, `MediaProps`, `SectionProps`, `SectionHeaderProps`, `HeadingLevel`, `CardProps`, `ContainerProps`, `ContainerWidth` (`/blocks/rsc`); `TemplateOptions`, `TemplatePage`, `TemplateBlock`, `TemplateValue` (`/templates`). +**Types:** `BlockOptions`, `BlockBuilder`, `BlockLocalization`, `LibraryBlockSetting`, `LibraryBlocksShared`, `LibraryBlockSlug`, `LibraryBlocksOptions`, `VariantOption`, `LibraryBlockDefinition`, `ContactOptions`, `EntryListOptions`, `FeatureGridOptions`, `TestimonialsOptions`, `ItemsFieldOptions`, `MediaFieldOptions`, `VariantFieldOptions`, `IconFieldOptions`, `Columns`, `BlockLibraryManifest`, `ManifestBlock`, `ManifestField` (`/blocks`); `BlockRegistryOptions`, `BlockContent`, `BlockContext`, `BlockUi`, `LibraryBlockProps`, `ContactDetail`, `EntryCard`, `TestimonialItem`, `BlockTexts`, `PartClasses`, `BaseBlockData`, `LinkData`, `LinksData`, `MediaValue`, `RichTextData`, `SectionHeaderData`, `SectionSettingsData`, `HeroBlockData`, `TextMediaBlockData`, `FeatureGridBlockData`, `FeatureItem`, `GalleryBlockData`, `GalleryItem`, `FaqBlockData`, `FaqItem`, `CtaBlockData`, `ContactBlockData`, `TeamBlockData`, `TeamMember`, `PricingBlockData`, `PricingPlan`, `LogosBlockData`, `LogoItem`, `TestimonialsBlockData`, `StatsBlockData`, `StatItem`, `RichTextBlockData`, `StepsBlockData`, `StepItem`, `EntryListBlockData`, `CMSLinkProps`, `ResolveLink`, `LinkComponent`, `ImageComponent`, `ItemHeadingLevel`, `MediaProps`, `SectionProps`, `SectionHeaderProps`, `HeadingLevel`, `CardProps`, `ContainerProps`, `ContainerWidth` (`/blocks/rsc`); `TemplateOptions`, `TemplatePage`, `TemplateBlock`, `TemplateValue` (`/templates`). ## Cookie consent (`consent`) — details: `node_modules/@intecion/ipal-kit/docs/consent.md` diff --git a/docs/block-library.md b/docs/block-library.md index 587be27..7d18bb2 100644 --- a/docs/block-library.md +++ b/docs/block-library.md @@ -108,8 +108,12 @@ block has them) → `variant` (sidebar) → `settings` (sidebar: anchor, backgro | `entryList` (`buildEntryListBlock`) | Entry list | `entryCollection`, `mode` (latest / chosen), `limit`, `entries` | `cards`, `list` | each title links to its entry and covers the card; dates in `