Skip to content

fix: separate blog and component doc surfaces#803

Open
sabraman wants to merge 2 commits intoncdai:mainfrom
sabraman:codex/separate-blog-and-component-doc-surfaces
Open

fix: separate blog and component doc surfaces#803
sabraman wants to merge 2 commits intoncdai:mainfrom
sabraman:codex/separate-blog-and-component-doc-surfaces

Conversation

@sabraman
Copy link
Contributor

@sabraman sabraman commented Mar 17, 2026

Summary

This PR separates blog-only surfaces from component documentation surfaces.

Several blog entry points were sourcing data from getAllDocs(), which includes both uncategorized blog posts and docs with category: "components". As a result, component docs could leak into the blog index, the homepage blog panel, the blog RSS feed, and blog URLs in the sitemap.

Changes

  • add getBlogDocs() to return only non-component docs
  • use getBlogDocs() for the blog index
  • use getBlogDocs() for blog RSS generation
  • use getBlogDocs() for the homepage blog panel
  • restrict blog static params and prev/next navigation to blog docs only
  • return notFound() for component docs under /blog/[slug]
  • use getBlogDocs() for blog URLs in the sitemap

Verification

  • ran pnpm check-types

Summary by CodeRabbit

  • Refactor
    • Blog content is now sourced and filtered separately from other docs, improving separation across blog pages, RSS, sitemap, and portfolio listings.
  • Bug Fixes
    • Tightened not-found handling for certain doc categories and updated previous/next post navigation to reflect the filtered blog dataset.

@vercel
Copy link

vercel bot commented Mar 17, 2026

@sabraman is attempting to deploy a commit to the React Wheel Picker OSS Program Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f9a82741-d78d-4f43-b5a7-34cb334337ae

📥 Commits

Reviewing files that changed from the base of the PR and between 8cca3d2 and 1dca863.

📒 Files selected for processing (1)
  • src/features/doc/data/documents.ts

📝 Walkthrough

Walkthrough

Replaced calls to getAllDocs() with a new getBlogDocs() across blog pages, RSS route, sitemap, and portfolio component; added getBlogDocs() (filters out docs in the "components" category); tightened not-found logic on the blog [slug] page to treat components-category docs as not found.

Changes

Cohort / File(s) Summary
Blog pages & routes
src/app/(app)/(docs)/blog/page.tsx, src/app/(app)/(docs)/blog/[slug]/page.tsx, src/app/(app)/(docs)/blog/rss/route.ts
Imports and calls switched from getAllDocsgetBlogDocs. [slug] page: tightened not-found checks to exclude docs in the "components" category.
Data layer
src/features/doc/data/documents.ts
Added export function getBlogDocs(): Doc[] which returns getAllDocs() filtered to exclude docs where category === "components".
Sitemap & Portfolio consumer
src/app/sitemap.ts, src/features/portfolio/components/blog.tsx
Switched blog data source from getAllDocs() to getBlogDocs() for sitemap posts and portfolio blog list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through code with tiny paws,
Swapped all-docs for blog-only laws.
I nudged components gently aside,
Now blog posts hop in tidy stride. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main objective of the changeset: separating blog and component documentation surfaces by introducing getBlogDocs() to filter out component docs from blog-related surfaces.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/features/doc/data/documents.ts (1)

64-66: Add an explicit return type for exported getBlogDocs.

This is part of the public data-layer API; declaring : Doc[] makes the contract stable and clearer for downstream callers.

Proposed diff
-export function getBlogDocs() {
+export function getBlogDocs(): Doc[] {
   return getAllDocs().filter((doc) => doc.metadata.category !== "components")
 }

As per coding guidelines "Use TypeScript strict mode with explicit types when necessary in TypeScript files".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/doc/data/documents.ts` around lines 64 - 66, Add an explicit
return type to the exported function getBlogDocs by declaring it as returning
Doc[] (i.e., change the signature of getBlogDocs to include : Doc[]); also
ensure the Doc type is imported or defined in this module so the signature
compiles. This makes the public data-layer API contract explicit and satisfies
TypeScript strict-mode guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/features/doc/data/documents.ts`:
- Around line 64-66: Add an explicit return type to the exported function
getBlogDocs by declaring it as returning Doc[] (i.e., change the signature of
getBlogDocs to include : Doc[]); also ensure the Doc type is imported or defined
in this module so the signature compiles. This makes the public data-layer API
contract explicit and satisfies TypeScript strict-mode guidelines.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 67ffc4e7-d1b8-4b0f-8f36-20bf178d91da

📥 Commits

Reviewing files that changed from the base of the PR and between 3087393 and 8cca3d2.

📒 Files selected for processing (6)
  • src/app/(app)/(docs)/blog/[slug]/page.tsx
  • src/app/(app)/(docs)/blog/page.tsx
  • src/app/(app)/(docs)/blog/rss/route.ts
  • src/app/sitemap.ts
  • src/features/doc/data/documents.ts
  • src/features/portfolio/components/blog.tsx

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