chore: removed disabled routes#121
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughThis 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Areas requiring extra attention:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
disabledRoutesarray and filtering logic that blocked/componentsand/hooksroutes - Updated
next-env.d.tstypes 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 |
There was a problem hiding this comment.
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_HOSTis good. If you want to be extra explicit for search engines, you could later switchlogoto an absolute URL (e.g. via a sharedmetadataBase), but the current root‑relative path is generally acceptable.apps/www/app/docs/[[...slug]]/page.tsx (1)
11-12: Docs metadata now correctly reusesgetPageImagefor OG images.
generateMetadatais wired cleanly: it resolves the page viasource, guards withnotFound(), and usesgetPageImage(page).urlforopenGraph.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
⛔ Files ignored due to path filters (3)
apps/www/lib/og/JetBrainsMono-Bold.ttfis excluded by!**/*.ttfapps/www/lib/og/JetBrainsMono-Regular.ttfis excluded by!**/*.ttfbun.lockis 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}: Noanytypes unless absolutely necessary - always provide proper TypeScript interfaces and properly type all media event handlers and Shaka Player configurations
Never callusePlayerStates(),useVolumeStates(),useTimelineStates(), or similar singleton hooks directly in components - always centralize them in thePlayerHookscomponent to prevent re-render performance issues
Always support composition via@radix-ui/react-slotby including anasChildprop and using the Slot pattern for mandatory component composability
UseReact.memo,useCallback, anduseMemofor high-frequency components like timeline controls to maintain performance
Centralize all media event listeners in thePlayerHookscomponent to prevent re-render performance issues
Never block event propagation - always compose events instead and allow prop spreading with proper priority
UsecomposeRefsfrom@radix-ui/react-compose-refsfor 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, andaria-pressedfor 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 usingfocus-visiblestyles and respectprefers-reduced-motionfor animations
Ensure minimum 4.5:1 contrast ratio for all UI elements against their backgrounds per WCAG AA standards
Files:
apps/www/lib/source.tsapps/www/components/json-ld.tsxapps/www/app/docs/[[...slug]]/page.tsxapps/www/lib/og/mono.tsxapps/www/app/robots.tsapps/www/app/og/docs/[...slug]/route.tsxapps/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.tsapps/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-responsedependency — keep usage server-only.The addition looks consistent with the OG image route work and
serverExternalPackagesconfig. 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.xmlis generated.The robots config is clean and environment‑agnostic now. Just make sure there is a corresponding
/sitemap.xmlin 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.pngand/site.webmanifesthere 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
titleanddescriptionare typed asReactNode, 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 bothsegmentsandurlin one place will keep the docs metadata and OG routes in sync. Just ensurepage.slugsis 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
serverExternalPackagesis supported in Next.js 16 and Takumi's docs explicitly recommend marking@takumi-rs/image-responseas external.The usage pattern is sound: the route handler at
apps/www/app/og/docs/[...slug]/route.tsxexportsgenerateStaticParams()to pre-generate all image routes at build time, making this compatible withoutput: "export". The package is used only in the server-side route handler (verified—no client component imports detected), soserverExternalPackagescorrectly 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 ImageResponseThe GET implementation looks solid: using
RouteContext<"/og/docs/[...slug]">withconst { slug } = await params, mappingslug.slice(0, -1)back to the docs page, and returning anew ImageResponse(<MetadataImage ...>, await getImageResponseOptions())aligns with Next.js asyncparamssemantics and Takumi’sImageResponseAPI. ThenotFound()guard for missing pages is also appropriate.Please double‑check in this repo that:
- You’re on a Next.js version where
RouteContextand asyncparamsare generated (typed routes + typegen enabled), andnext.configincludesserverExternalPackages: ["@takumi-rs/image-response"](or equivalent) as recommended by Takumi, so this handler doesn’t fail at runtime due to bundling issues.
chore: removed disabled routes
Summary by CodeRabbit
New Features
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.