Skip to content

chore: removed disabled routes#121

Merged
WINOFFRG merged 3 commits into
mainfrom
chore/2511a
Nov 25, 2025
Merged

chore: removed disabled routes#121
WINOFFRG merged 3 commits into
mainfrom
chore/2511a

Conversation

@WINOFFRG
Copy link
Copy Markdown
Owner

@WINOFFRG WINOFFRG commented Nov 25, 2025

Summary by CodeRabbit

  • New Features

    • Added dynamic Open Graph images for documentation pages to improve social media sharing previews.
    • Enabled static generation for all LLM documentation routes.
    • API endpoints are now crawlable by search engines.
  • Refactor

    • Simplified site configuration and metadata handling with relative paths for improved portability.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings November 25, 2025 06:27
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 25, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This PR implements dynamic Open Graph image generation for documentation pages. It adds a new OG image route handler, creates a server-side image generation component library, and refactors metadata/URL handling to use relative paths instead of PROD_BASE_HOST. A new dependency and Next.js config entry support the image generation system.

Changes

Cohort / File(s) Summary
OG Image Generation
apps/www/app/og/docs/[...slug]/route.tsx, apps/www/lib/og/mono.tsx
New route handler for generating dynamic OG images with static param generation; new server-side component library for rendering OG images with typography, gradients, and embedded fonts (JetBrains Mono).
Metadata & Page Integration
apps/www/app/docs/[[...slug]]/page.tsx, apps/www/lib/source.ts
Updated generateMetadata signature and added getPageImage utility function to compute OG image URLs and segments for docs pages.
URL & Host Refactoring
apps/www/app/layout.tsx, apps/www/components/json-ld.tsx, apps/www/app/robots.ts
Removed PROD_BASE_HOST usage across metadata, JSON-LD schemas, and robots.txt; converted asset URLs to relative root-relative paths.
Route Generation & Config
apps/www/app/llms.mdx/[...slug]/route.ts, apps/www/next.config.mjs, apps/www/package.json
Removed disabledRoutes filter in LLM generateStaticParams; added @takumi-rs/image-response dependency and serverExternalPackages config.

Sequence Diagram(s)

sequenceDiagram
    participant Browser
    participant OG Route as /og/docs/[...slug]
    participant Source as source.getPage()
    participant ImageGen as mono.generate()
    
    Browser->>OG Route: GET /og/docs/docs/intro
    OG Route->>Source: getPage("docs/intro")
    alt Page Found
        Source-->>OG Route: page object
        OG Route->>ImageGen: generate({ title, description, site })
        ImageGen-->>OG Route: ImageResponse (1200x630 PNG)
        OG Route-->>Browser: OG image
    else Page Not Found
        Source-->>OG Route: undefined
        OG Route-->>Browser: 404 notFound()
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring extra attention:

  • OG route handler's error handling and notFound() flow
  • Font file loading and ImageResponse options in mono.tsx (async file I/O)
  • Static params generation consistency between docs and OG routes
  • Coordinate verification between getPageImage segments and actual route params
  • Removal of disabledRoutes logic in LLM route to ensure all docs pages are properly generated

Possibly related PRs

Poem

🐰 A rabbit hops through docs so bright,
With OG images, crafted just right!
No host-bound URLs, just paths so clean,
The finest social cards you've seen!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'chore: removed disabled routes' is misleading. The changeset removes disabled routes in one file but primarily adds comprehensive OG image generation infrastructure for docs pages, with multiple configuration and layout updates across the codebase. Consider a more accurate title like 'feat: add dynamic OG image generation for docs pages' or 'chore: refactor OG image handling and remove host-based routing', which better reflects the actual scope of changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/2511a

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the disabled routes filtering logic from the LLM documentation endpoint and updates the Next.js types import path. The change enables LLM access to components and hooks documentation that was previously filtered out, likely addressing a Next.js 16 build issue mentioned in code comments.

  • Removed disabledRoutes array and filtering logic that blocked /components and /hooks routes
  • Updated next-env.d.ts types import from dev to production path

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/www/next-env.d.ts Updated types import path from .next/dev/types/routes.d.ts to .next/types/routes.d.ts
apps/www/app/llms.mdx/[...slug]/route.ts Removed disabled routes filtering logic, enabling all documentation routes for LLM access

Comment thread apps/www/app/llms.mdx/[...slug]/route.ts
Copy link
Copy Markdown

@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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/www/components/json-ld.tsx (1)

4-20: Root‑relative JSON‑LD logo is fine; consider absolute URL if you want maximum schema clarity.

Decoupling from PROD_BASE_HOST is good. If you want to be extra explicit for search engines, you could later switch logo to an absolute URL (e.g. via a shared metadataBase), but the current root‑relative path is generally acceptable.

apps/www/app/docs/[[...slug]]/page.tsx (1)

11-12: Docs metadata now correctly reuses getPageImage for OG images.

generateMetadata is wired cleanly: it resolves the page via source, guards with notFound(), and uses getPageImage(page).url for openGraph.images, keeping things aligned with the OG route helper. If you ever need multiple images or alt text, consider switching to the descriptor form:

openGraph: {
  images: [{ url: getPageImage(page).url }],
}

but the current string form is valid.

Also applies to: 50-63

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5fa4c30 and 22004d7.

⛔ Files ignored due to path filters (3)
  • apps/www/lib/og/JetBrainsMono-Bold.ttf is excluded by !**/*.ttf
  • apps/www/lib/og/JetBrainsMono-Regular.ttf is excluded by !**/*.ttf
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • apps/www/app/docs/[[...slug]]/page.tsx (2 hunks)
  • apps/www/app/layout.tsx (3 hunks)
  • apps/www/app/og/docs/[...slug]/route.tsx (1 hunks)
  • apps/www/app/robots.ts (1 hunks)
  • apps/www/components/json-ld.tsx (1 hunks)
  • apps/www/lib/og/mono.tsx (1 hunks)
  • apps/www/lib/source.ts (2 hunks)
  • apps/www/next.config.mjs (1 hunks)
  • apps/www/package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: No any types unless absolutely necessary - always provide proper TypeScript interfaces and properly type all media event handlers and Shaka Player configurations
Never call usePlayerStates(), useVolumeStates(), useTimelineStates(), or similar singleton hooks directly in components - always centralize them in the PlayerHooks component to prevent re-render performance issues
Always support composition via @radix-ui/react-slot by including an asChild prop and using the Slot pattern for mandatory component composability
Use React.memo, useCallback, and useMemo for high-frequency components like timeline controls to maintain performance
Centralize all media event listeners in the PlayerHooks component to prevent re-render performance issues
Never block event propagation - always compose events instead and allow prop spreading with proper priority
Use composeRefs from @radix-ui/react-compose-refs for handling multiple refs in components
All media control components must include proper ARIA attributes: role (slider/button), aria-label, aria-valuemin, aria-valuemax, aria-valuenow, and aria-pressed for buttons
Support full keyboard navigation for media controls: Space/Enter for play-pause, Arrow keys for timeline/volume, M for mute, F for fullscreen
Implement focus management with visible focus indicators using focus-visible styles and respect prefers-reduced-motion for animations
Ensure minimum 4.5:1 contrast ratio for all UI elements against their backgrounds per WCAG AA standards

Files:

  • apps/www/lib/source.ts
  • apps/www/components/json-ld.tsx
  • apps/www/app/docs/[[...slug]]/page.tsx
  • apps/www/lib/og/mono.tsx
  • apps/www/app/robots.ts
  • apps/www/app/og/docs/[...slug]/route.tsx
  • apps/www/app/layout.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-24T19:02:04.404Z
Learnt from: CR
Repo: WINOFFRG/limeplay PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:02:04.404Z
Learning: Applies to **/content/docs/**/*.mdx : Use `<AutoTypeTable path="./registry/default/ui/component.tsx" name="ComponentPropsDocs" />` for API reference sections, referencing the correct component file and type name

Applied to files:

  • apps/www/lib/source.ts
  • apps/www/app/docs/[[...slug]]/page.tsx
🧬 Code graph analysis (2)
apps/www/app/docs/[[...slug]]/page.tsx (2)
apps/www/lib/source.ts (2)
  • source (7-10)
  • getPageImage (12-19)
docs/pages/[...slug].tsx (1)
  • document (40-74)
apps/www/app/og/docs/[...slug]/route.tsx (2)
apps/www/lib/source.ts (2)
  • source (7-10)
  • getPageImage (12-19)
apps/www/lib/og/mono.tsx (1)
  • getImageResponseOptions (15-32)
🔇 Additional comments (7)
apps/www/package.json (1)

33-33: New @takumi-rs/image-response dependency — keep usage server-only.

The addition looks consistent with the OG image route work and serverExternalPackages config. Please just confirm this package is only imported from server-only modules (e.g. OG routes / lib helpers) and that the chosen version matches the library’s documented Next.js 16 support and required Node runtime.

apps/www/app/robots.ts (1)

5-12: Root‑relative sitemap is fine — ensure /sitemap.xml is generated.

The robots config is clean and environment‑agnostic now. Just make sure there is a corresponding /sitemap.xml in the static export so crawlers don’t hit a 404.

apps/www/app/layout.tsx (1)

10-75: Root‑relative metadata assets align with the host‑independent setup.

Using /opengraph-image.png and /site.webmanifest here keeps things environment‑agnostic and consistent with the rest of the changes. Just verify those files are present in the final static output so OG/Twitter cards and the manifest resolve correctly.

apps/www/lib/og/mono.tsx (1)

34-128: OG image layout implementation looks solid and self‑contained.

The JSX structure, typography, and spacing choices are clear and should render well at 1200×630. Given that title and description are typed as ReactNode, you have flexibility for future rich content if needed.

apps/www/lib/source.ts (1)

1-19: Nice centralization of per‑page OG image paths.

Typing with InferPageType<typeof source> and deriving both segments and url in one place will keep the docs metadata and OG routes in sync. Just ensure page.slugs is always defined for docs pages in your Fumadocs setup so this helper doesn’t encounter undefined slugs.

apps/www/next.config.mjs (1)

8-15: Configuration is correct and properly configured for static build-time image generation.

Verification confirms serverExternalPackages is supported in Next.js 16 and Takumi's docs explicitly recommend marking @takumi-rs/image-response as external.

The usage pattern is sound: the route handler at apps/www/app/og/docs/[...slug]/route.tsx exports generateStaticParams() to pre-generate all image routes at build time, making this compatible with output: "export". The package is used only in the server-side route handler (verified—no client component imports detected), so serverExternalPackages correctly enables Node API access during the build process without requiring a runtime server.

apps/www/app/og/docs/[...slug]/route.tsx (1)

12-30: OG image GET handler correctly wires async params, page lookup, and Takumi ImageResponse

The GET implementation looks solid: using RouteContext<"/og/docs/[...slug]"> with const { slug } = await params, mapping slug.slice(0, -1) back to the docs page, and returning a new ImageResponse(<MetadataImage ...>, await getImageResponseOptions()) aligns with Next.js async params semantics and Takumi’s ImageResponse API. The notFound() guard for missing pages is also appropriate.

Please double‑check in this repo that:

  • You’re on a Next.js version where RouteContext and async params are generated (typed routes + typegen enabled), and
  • next.config includes serverExternalPackages: ["@takumi-rs/image-response"] (or equivalent) as recommended by Takumi, so this handler doesn’t fail at runtime due to bundling issues.

Comment thread apps/www/lib/og/mono.tsx
@WINOFFRG WINOFFRG merged commit a8d2e84 into main Nov 25, 2025
2 checks passed
rohangupta-zomato pushed a commit that referenced this pull request Dec 6, 2025
chore: removed disabled routes
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