Repository navigation
components(feat): add the related-posts file-only article component - #600
Merged
Merged
Conversation
Related Posts renders a compact end-of-post list of the posts a template selects. It requires an explicit currentHref, so it never lists the post it sits on. It skips unsafe hrefs, blank titles and repeats, and renders nothing when no posts remain. It does no querying, ranking or recommendation, so manual curation and any automatic recommendation query feed the same prop. It ships like post-hero and author-card: installMode file-only, no Payload fragments, post-install tasks or recovery paths, and a registry:component item that installs ~/src/components/RelatedPosts/Component.tsx. The install baseline is [email protected]. - Demo twin and demo registry entry, doc page in the fixed component format with a minimal post-template example and the placement and selection contract, docs sidebar entry, README inventory row. - The catalog moves related-posts from upcoming to installable. upcomingComponents is now an explicitly typed empty list, and the editorial roadmap shows a proposal invitation instead of an empty list and a "01 — 00" counter. - Tests: article-components (React-only compile, rendering, direct shadcn delivery, tracked lifecycle, rejected flags), catalog and count pins (82 -> 83), pack and fresh-smoke selections, and the frontend e2e Posts filter and no-proposal roadmap. Closes #135 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (4)
📒 Files selected for processing (21)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ng footer The visual-baselines workflow minted these on this branch in production mode with update=changed. Blobs were copied from the mint commits and verified. - component-related-posts-chromium-linux.png is new (run 37187249435, #603). - landing-home-desktop/mobile-chromium-linux.png (run 37187255076, #602): the related category now has an installable component, so the footer's Components column gains a "Related" link. That adds 34px of page height, and the catalog counts now read 83. No other region changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 4, 2026
Ducksss
added a commit
that referenced
this pull request
Oct 4, 2026
…support matrix related-posts (#600) landed declaring Payload 3 only, so once Payload 4 is allowed it would be the one component refusing v4 projects. Give it the same supports and peer range as every other manifest; manifest-only, so the versioned-source contract needs no version bump. payload-components-support-matrix.int.spec.ts makes this class of drift fail: every manifest, the component template and the `new` scaffold must declare exactly the Payload and Next.js majors their targets allow, with peer ranges that cover each major's stable line and the newest Payload major's prereleases. A v3-only fixture keeps the guard from passing vacuously. buildManifest is exported so the scaffold's output can be checked directly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ducksss
added a commit
that referenced
this pull request
Oct 4, 2026
Minted with visual-baselines.yml (run 37192108152, spec=blog-visual, update=all) and cherry-picked to the two files that changed: blog-index-desktop and blog-article-desktop. Only the shared header moves (wordmark, MIT badge and nav in the brand faces; 0.31% of pixels, under the 1% tolerance, hence update=all). The blog mobile shots re-minted byte-identical. The landing baselines are re-minted separately on top of #600's main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ducksss
added a commit
that referenced
this pull request
Oct 4, 2026
Minted with visual-baselines.yml on this branch after rebasing onto a728944 (run 37202985409, spec=frontend, update=all) and copied in from the bot branch, verified by blob: - landing-home-desktop-chromium-linux.png db09a22 (1280x10764: the Datasheet hero +120px over the old main, plus #600's +34px Related footer row) - landing-home-mobile-chromium-linux.png b8261ae The branded footer carries #600's Related link and the 83-component count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ducksss
added a commit
that referenced
this pull request
Oct 4, 2026
* cli(feat): accept Payload 4 projects alongside Payload 3 Payload 4 is in canary (4.0.0-canary.37) and every install into a v4 project was refused. Allow major 4 in both support-matrix targets and in every manifest (payloadMajors [3, 4], payload peer "^3.0.0 || ^4.0.0-0"), the component template, and the `new` scaffold. Widening the ranges alone was not enough: semver.intersects without includePrerelease tests each comparator on its own, so "<5.0.0-0" rejects 4.0.0-canary.37 and a pinned prerelease never intersects "^4.0.0-0". The "-0" bounds on every required range keep prereleases inside their major. detectProject now names an unsupported Payload or Next.js major instead of reporting "Unsupported project shape", which is what a v4 project got. The base Pages collection gains an explicit readVersions (signed-in only). Payload 4 inherits read access for versions (payloadcms/payload#17634), so visitors could list every previously published version. Payload 3 already requires a user here, so this is a no-op on v3. Co-Authored-By: Claude Opus 5.5 <[email protected]> * cli(fix): scaffold the pinned Payload 4 version and template in the fresh smoke create-payload-app 4 renamed --version to --payload-version. Its argument parser is permissive, so the old flag was silently dropped and a smoke pinned to 4.0.0-canary.37 scaffolded whatever the `canary` dist-tag resolved to. Pass the flag each major reads, and both for a dist-tag. create-payload-app 4 also downloads its template from the payloadcms/payload main branch instead of the release it installs. Main had already renamed createLocalReq (payloadcms/payload#18287, after canary.37 shipped), so the pinned scaffold failed tsc in the template's own seed route. Pin a v4 template to the release tag with --branch when that tag exists; v3 keeps its CLI's 3.x branch and needs no network check. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(feat): add a non-blocking nightly Payload canary smoke The nightly fresh smoke follows Payload `latest`, so nothing exercised the next major before it ships. Run the same bare and website scenarios against `npm view payload@canary version` on Node.js 24 (Payload 4 requires 24.15+), schedule-only and with continue-on-error, outside pr-gate. Co-Authored-By: Claude Opus 5.5 <[email protected]> * cli(fix): widen related-posts to Payload 4 and hold manifests to the support matrix related-posts (#600) landed declaring Payload 3 only, so once Payload 4 is allowed it would be the one component refusing v4 projects. Give it the same supports and peer range as every other manifest; manifest-only, so the versioned-source contract needs no version bump. payload-components-support-matrix.int.spec.ts makes this class of drift fail: every manifest, the component template and the `new` scaffold must declare exactly the Payload and Next.js majors their targets allow, with peer ranges that cover each major's stable line and the newest Payload major's prereleases. A v3-only fixture keeps the guard from passing vacuously. buildManifest is exported so the scaffold's output can be checked directly. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Ducksss
added a commit
that referenced
this pull request
Oct 4, 2026
…e, pinout hero (#604) * frontend(feat): Datasheet rebrand phase 1 — brand layer, preview scope, pinout hero Phase 1 of direction B (Datasheet) from the 2026-10 concept round. The site chrome is drawn like a component datasheet; the blocks it shows keep the component tokens they install with. - Brand layer (globals.css section 4): trace green tokens, Archivo (variable on width, so the condensed display face is the same file) and Azeret Mono via next/font with their variables on <html>, mirrored in the shared fumadocs.css partial. [data-brand='datasheet'] remaps --font-sans, --font-mono and the --brand ramp for the header, footer, and the landing, /about and /brand-guide <main>. - Preview scope: .preview-scope restores every remapped token from a :root snapshot (--component-*) on every surface that renders a demo twin, so the 82 component and 150 template preview captures are pixel-identical to main. Restoring from snapshots matters: an oklch() restore with var() cannot be compiled to the lab() form the build gives :root, and drifted by a level. The catalog's hue knob moves to --preview-brand* on .preview-themed. - Landing hero: document strip, condensed headline, a shared Datasheet install field (also used by the closing CTA), and DatasheetPinout — a static SVG of hero-basic as a ten-pin part, fed from the manifest via src/lib/datasheet.ts, with a one-shot trace draw under no-preference motion only. Hero bands rise without fading; .hero-reveal is gone. - The mark keeps the blocks' emerald through a new --mark token. - About and brand guide adopt the Datasheet typography; the brand guide documents both layers. DESIGN.md and AGENTS.md describe the scopes. - Guards: tests/int/brand-layer.int.spec.ts (scope symmetry, snapshot restores, mark, twin hosts, hero fields vs block config), plus frontend e2e checks for brand faces on docs/blog chrome, twin isolation inside the branded landing, and the pinout drawing. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(chore): mint Linux blog baselines for the Datasheet header Minted with visual-baselines.yml (run 37192108152, spec=blog-visual, update=all) and cherry-picked to the two files that changed: blog-index-desktop and blog-article-desktop. Only the shared header moves (wordmark, MIT badge and nav in the brand faces; 0.31% of pixels, under the 1% tolerance, hence update=all). The blog mobile shots re-minted byte-identical. The landing baselines are re-minted separately on top of #600's main. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(chore): re-mint Linux landing baselines on #600's main Minted with visual-baselines.yml on this branch after rebasing onto a728944 (run 37202985409, spec=frontend, update=all) and copied in from the bot branch, verified by blob: - landing-home-desktop-chromium-linux.png db09a22 (1280x10764: the Datasheet hero +120px over the old main, plus #600's +34px Related footer row) - landing-home-mobile-chromium-linux.png b8261ae The branded footer carries #600's Related link and the 83-component count. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 9, 2026
Merged
Ducksss
added a commit
that referenced
this pull request
Oct 10, 2026
New minor. The related-posts article component (#600) and experimental Payload 4 support (#601) have landed on main since v1.6.1, while npm still serves 1.6.1. The site already documents `npx payload-components add related-posts`, but the 1.6.1 CLI doesn't know the component, so the command fails for npm users until this ships. Runtime dependencies are unchanged (ajv, semver). Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #135
Summary
Adds
related-posts, a shadcn-native, file-only article component that renders a compact list of related articles at the end of a post. It follows thepost-hero/author-card/newsletter-calloutcontract:installMode: 'file-only', no Payload fragments, no post-install tasks, no recovery paths, aregistry:componentitem that installs~/src/components/RelatedPosts/Component.tsx, and--demo/--localizedrejected. The catalog moves it from "upcoming" to installable.ROADMAP.mdasked for two things before shipping it: explicit source-post context and a documented placement contract, with automatic recommendations kept separate from manual selection. Both are built into the props and the docs.Props contract
currentHrefstring(required)#fragmentstill matches, a different query string does not.postsreadonly RelatedPost[](required){ title, href, excerpt?, image?, publishedAt? }. Rendered in the order given.titlestring, defaultRelated postslocalestring, defaultenid,className,disableInnerContaineridalso prefixes the heading ID.Why this shape:
currentHrefis required, not optional. It is the "explicit source-post context" from the roadmap. The starter'srelatedPostsfield already excludes the current post throughfilterOptions, but that only applies in the admin picker. A required prop makes the guarantee hold at render time for any data source.relatedPostsrelationship) and any automatic recommendation query both pass their results through the samepostsprop. That keeps the two concerns separate, as the roadmap asks.author-card: site paths or HTTP(S) URLs without credentials). Repeated hrefs render once. When nothing remains it returnsnull, so templates need no empty check and never show an orphan heading.imageis aReactNodeslot, likepost-hero. The file imports only React, so it compiles in any consumer and the template owns media, sizes, and alt text.sectionlabelled by itsh2(viauseId, which also works in Server Components), anh3link per post, and a stretched link so the whole card is clickable while the accessible name stays the title. Styling uses consumer-safe tokens plus the shared article conventions (tracking-title,font-serif), with no site-onlybrandcolour.Placement contract (in the docs)
Render it once at the end of the post template, after the article body and any author card. The page keeps the single
h1from the post header. The Payload website starter ships its ownRelatedPostsat@/blocks/RelatedPosts/Component. This install leaves that file alone and installs undersrc/components/, so there is no file collision; the docs say to swap the import (or alias one of the two). The usage example maps the starter'spost.relatedPosts(populated at the post query'sdepth: 2) to the props.Files
New:
payload-components/source/components/RelatedPosts/Component.tsxpayload-components/manifests/related-posts.jsonsrc/components/site/demos/RelatedPostsDemo.tsx(twin; class groups mirrored element by element)content/docs/components/related-posts.mdx(fixed component page format: preview, Command/Manual tabs,ComponentWiring, props + post-entry TypeTables,ComponentUsage+ minimal post-template example + placement/selection contract,ComponentRequirements)Updated:
payload-components/registry.json(newregistry:componentitem,registryDependencies: []),payload-components/install-baselines.json(pnpm registry:snapshot,[email protected]),src/generated/component-catalog.json(pnpm catalog:build)src/lib/component-catalog.ts: editorial entry (categoryrelated, existingComponents.related-postscopy),upcomingComponentsis now an explicitly typed empty list, posts family copy names Related Postssrc/components/site/demos/registry.ts,content/docs/components/meta.json,README.mdinventory row and prose,AGENTS.md,ROADMAP.md,content/docs/architecture.mdxsrc/app/[locale]/roadmap/editorial/page.tsx+ two English strings inmessages/en.json: see belowThe editorial roadmap after its last proposal ships
related-postswas the only entry inupcomingComponents. With it gone,/roadmap/editorialwould have rendered a01 — 00counter, an empty numbered strip, and an empty bordered<ol>. The page now renders the counter, strip, and list only when proposals exist. Otherwise it shows the existing "Propose the next one" copy with an "Open an issue" link (both reusedCatalogBrowserkeys, so no new message keys and no Crowdin round). Two English values were stale and are updated in place:EditorialRoadmap.intronamed only Post Hero and Author Card as installable, andmetadataDescriptionsaid "remaining proposed". Draft locale catalogs keep their existing translations, permessages/README.md.Tests
tests/int/article-components.int.spec.tsx: the real file typechecks against React alone (strict). Three render tests cover order, current-post exclusion (trailing slash,#fragment, absolute URL with a different host case), unsafe/blank/duplicate skipping, thenullresult, distinct query strings, the labelledh2/h3outline, UTC dates, locale fallback, and the image slot. Direct shadcn delivery plus the trackedadd→add(idempotent state) →diff→removelifecycle runs with failinggenerate:*scripts and byte-identical host files.--demo/--localizedare rejected. I mutation-checked the render tests: removing current-post exclusion, or the href safety filter, fails them.tests/int/site-catalog.int.spec.ts: posts family is[post-hero, author-card, newsletter-callout, related-posts],upcomingComponentsis[].tests/int/fumadocs-site.int.spec.ts: the four literal catalog pins move 82 → 83.tests/int/payload-components-pack.int.spec.ts(packed tarball installs) andtests/int/fresh-payload-smoke.int.spec.ts(direct delivery, never Page wiring) includerelated-posts.tests/e2e/frontend.e2e.spec.ts: the Posts filter offersrelated-postsin the composer. The proposal-card test now skips while nothing is upcoming. A new test covers the no-proposal state on the Posts filter and on/roadmap/editorial.representativeInstallComponentsis unchanged on purpose: the file-only components are covered by thearticle-componentslifecycle test, not the page-block install list.Verification (local, macOS)
Each step's output went to its own log with its own exit code (no pipes). Everything below ran on the head of this PR, after rebasing onto
f603b5a2:pnpm source:buildpnpm lintpnpm format:checkpnpm i18n:checkpnpm exec tsc --noEmitpnpm test:registrypublic/rartifacts valid against the shadcn schemapnpm run test:intpnpm test:packrelated-poststwice with failinggenerate:*scripts; host files unchanged, stateinstalledat 0.1.0 with no patched filesE2E_PORT=3322 pnpm build:e2ehttp://localhost:3322E2E_PORT=3322 PLAYWRIGHT_SERVER_MODE=production pnpm run test:e2efrontend + components-visual + a11y + geoE2e breakdown:
/docs/components/related-posts(title, h1, no horizontal overflow), the Posts composer, and the new no-proposal roadmap test./components?type=postsand/roadmap/editorial.The same e2e set also passed on the pre-rebase base (190 passed, 0 failed). I reviewed screenshots of the preview (1280 and 390 wide), the docs page, the Posts catalog, and the roadmap from a production build.
Visual baselines
I dispatched
visual-baselines.ymlon this branch for both specs (production mode,update=changed, so only new or failing baselines are written). Both runs succeeded. Each opened a bot PR into this branch containing only PNGs, as a single commit onac19d7bb. I copied the blobs onto the branch ince801c4eand closed the bot PRs as superseded.component-related-posts-chromium-linux.png(new)3e4347901b52landing-home-desktop-chromium-linux.png48984234330elanding-home-mobile-chromium-linux.png4d5c92610592The landing re-mint is a direct consequence of this PR, not renderer drift. The
relatedcategory now has an installable component, so the footer's Components column (footerComponentCategoryLinks) gains a Related link. Both landing snapshots grow by exactly 34px, which fails on size. A pixel diff of old against new shows only that footer region plus three single-line count updates (82 → 83, including the hero wall counter and the catalog's "Browse all" link). That is 0.08% (desktop) and 0.22% (mobile) of the shared area. No other full-page snapshot includes the site footer: component previews and template previews are chrome-free, andblog-visualcaptures the viewport only.CI on
ce801c4eis all green, includingpr-gate. In the Linux release gate, every batch passed.components-visualran 85/85 with none skipped, so the newrelated-postscomparison ran.frontendpassed 156 with 1 skipped (the proposal-card test while nothing is upcoming), including the landing desktop/mobile snapshots.templates-visualpassed 152,templates-a11y63, and the remaining specs 202. Int passed 807 with 1 skipped. All five fresh-Payload smoke shards andnode-20-compatpassed too.Left for the maintainer
/roadmap/editorial. It now has no proposals. This PR keeps it valid as a call for proposals rather than deciding its fate. If you'd rather retire or redirect it, these can go with it:UpcomingComponentCardand itsThumbShapessketches insrc/components/site/ComponentGrid.tsx(every case is now unreachable), theCatalogBrowserroadmap keys, its sitemap entry, and its a11y/frontend routes.EditorialRoadmap.intro/metadataDescriptiondrafts inmessages/locales/*still translate the old English. That's expected for inactive drafts and gets picked up by the next Crowdin round.Components.related-postscatalog copy. It stays "A related-posts section for compact recommendations.", which is still accurate. Changing it would only stale the ja/ko/zh drafts.pnpm payload-components newonly scaffolds Pages blocks. Running it forrelated-postsproducedsource/blocks/RelatedPosts/config.ts, page-block fragments, andgenerate:*tasks, so this component was mirrored by hand fromauthor-card/post-hero. Separately, its README inventory insertion lands after the blank line before<!-- COMPONENT-INVENTORY:END -->, so the new row falls outside the table.🤖 Generated with Claude Code