Refactor documentation structure for multi-product support#22
Conversation
|
@utkarsh232005 is attempting to deploy a commit to the utkarsh232005's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 37 minutes and 7 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/Footer.tsx (1)
26-33:⚠️ Potential issue | 🟠 Major | ⚡ Quick winHardcoded "Status" link breaks cross-product navigation.
The "Status" link always points to
https://github.com/KDM-cli/kdm-cliregardless of the current product context. When a user is viewing the KDC product page, clicking "Status" incorrectly navigates to the KDM repository instead of the KDC repository.🔧 Proposed fix to use product-aware URL
<a - href="https://github.com/KDM-cli/kdm-cli" + href={product ? product.githubUrl : "https://github.com/KDM-cli/kdm-cli"} target="_blank" rel="noreferrer" className="hover:text-foreground/40 transition-colors" > Status </a>Alternatively, if "Status" should point to a dedicated status page rather than GitHub, update the link target and anchor text accordingly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Footer.tsx` around lines 26 - 33, The Footer component currently hardcodes the "Status" anchor to the KDM GitHub URL; update Footer (the anchor rendering the "Status" link) to build the URL based on the current product context instead of the fixed string. Locate the anchor in Footer.tsx and replace the hardcoded href with a product-aware value (e.g., derive from a prop/context value like currentProduct or use a utility/getRepoUrl(product) mapping that returns the correct repository or status page for KDM vs KDC); ensure target/rel attributes remain and adjust the anchor text if you switch to a dedicated status page endpoint.
🧹 Nitpick comments (3)
src/docs/kdc/installation.md (1)
105-110: 💤 Low valueDuplicate build instructions.
The "Build From Source" section duplicates the same instructions already present in Lines 14-18 of installation.md and will be repeated in development.md. Consider consolidating build instructions in one canonical location and cross-referencing from others.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/docs/kdc/installation.md` around lines 105 - 110, The "Build From Source" bash snippet is duplicated; remove the repeated git clone/cargo build/sudo mv block from the "Build From Source" section and replace it with a short cross-reference to the canonical build instructions (the original snippet under the earlier installation "Build From Source" section), or move the canonical snippet into a single central location (e.g., development.md) and update both places to reference that single source so the clone/build/move commands are maintained in only one place.src/routes/kdm.docs.tsx (1)
15-17: ⚡ Quick winMove loader creation outside the component.
createDocsLoader("kdm")is called on every render ofKdmDocsLayout. Since the docs are eagerly loaded at module time (per src/lib/docs.ts), the loader should be created once outside the component to avoid unnecessary object recreation.⚡ Suggested refactor
+const kdmDocsLoader = createDocsLoader("kdm"); + function KdmDocsLayout() { - const loader = createDocsLoader("kdm"); return ( <div className="container mx-auto px-6 py-16 grid grid-cols-1 md:grid-cols-[220px_1fr] gap-12"> <aside className="md:sticky md:top-24 self-start"> <p className="font-mono text-xs uppercase tracking-[1.4px] text-foreground/50 mb-4"> KDM Documentation </p> <nav className="flex flex-col gap-2 text-sm"> - {loader.docList.map((d) => { + {kdmDocsLoader.docList.map((d) => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/routes/kdm.docs.tsx` around lines 15 - 17, The call to createDocsLoader("kdm") is being executed inside KdmDocsLayout on every render; move the loader creation to module scope so it is created once - e.g., create a top-level constant (referencing createDocsLoader("kdm") and name it like kdmDocsLoader) and then have KdmDocsLayout read from that constant (instead of calling createDocsLoader inside the component) to avoid repeated object recreation.src/docs/kdc/index.md (1)
16-19: 💤 Low valueConsider varying sentence structure for better readability.
Three consecutive sentences in the list begin with "If the project has..." While this is clear and functional, varying the sentence structure slightly can improve reading flow.
✍️ Example alternative phrasing
For example: -- If the project has a `Dockerfile`, KDC enables Docker actions. -- If the project has `docker-compose.yml`, KDC enables Compose actions. -- If the project has Kubernetes manifests, KDC enables Kubernetes and deployment actions. -- If Docker is installed but not running, KDC reports that state and disables runtime-dependent actions where needed. +- When a `Dockerfile` is present, KDC enables Docker actions. +- Projects with `docker-compose.yml` get Compose actions enabled. +- Kubernetes manifests activate Kubernetes and deployment actions. +- Docker installation without a running daemon triggers state reporting and disables runtime-dependent actions.As per coding guidelines, this addresses the LanguageTool hint about repetitive sentence beginnings.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/docs/kdc/index.md` around lines 16 - 19, Rewrite the four bullets to avoid repeating "If the project has..." by rephrasing each line: replace "If the project has a `Dockerfile`" with something like "Presence of a `Dockerfile` enables Docker actions", change "If the project has `docker-compose.yml`" to "A `docker-compose.yml` enables Compose actions", reword "If the project has Kubernetes manifests" to "Kubernetes manifests enable Kubernetes and deployment actions", and keep or slightly rephrase "If Docker is installed but not running" to maintain clarity about reporting disabled runtime-dependent actions; update the three affected list items accordingly where those phrases appear.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/CTA.tsx`:
- Around line 19-21: The CTA anchor currently uses a no-op href ("#") so the
primary "Install CLI" button is non-functional; update the CTA component (the
anchor that renders {ctaButtonText}) to use a real destination by replacing
href="#" with a proper URL (e.g., installation docs, GitHub releases, or a prop
like ctaHref passed into the CTA component) and ensure you also add
target="_blank" and rel="noopener noreferrer" if opening an external page; if
you prefer configurability, add a ctaHref prop to the CTA component and default
it to the install docs URL, then use that prop in the anchor element instead of
"#".
In `@src/components/Hero.tsx`:
- Around line 9-13: The copy function currently calls
navigator.clipboard.writeText(installCommand) without handling rejections, then
unconditionally calls setCopied(true); modify the copy function (referenced as
copy) to await or attach a .then/.catch to navigator.clipboard.writeText and
only call setCopied(true) and start the setTimeout when the Promise resolves
successfully; on rejection, handle the error by logging or surfacing a fallback
(e.g., use document.execCommand fallback or show an error state) and do not set
the copied flag. Ensure you reference the existing setCopied and setTimeout
usage so the success-only behavior is implemented.
In `@src/components/Navbar.tsx`:
- Around line 20-79: The product-specific navbar currently hides all nav items
on mobile (see className "hidden md:flex") leaving no mobile menu; add a mobile
Sheet-based menu (same pattern as the neutral navbar) that is shown on md:hidden
and contains the same entries: a Products section reproducing the DropdownMenu
items (respecting isKdm to show the active dot), Features anchor, Commands
anchor, Docs Link (`/${product.slug}/docs`), and the external GitHub Star button
(preserve target/_rel). Implement the Sheet with SheetTrigger (visible on
mobile), SheetContent listing the Links (reuse Link, Star, DropdownMenu logic or
duplicate items inside the SheetContent), and ensure you import and use Sheet,
SheetTrigger, and SheetContent consistent with existing components; keep desktop
state unchanged (leave "hidden md:flex" intact).
In `@src/lib/docs.ts`:
- Around line 63-77: The createDocsLoader function currently falls back to
kdcDocs for any productSlug not equal to "kdm"; add validation for productSlug
in createDocsLoader (the parameter) so invalid values don't silently return the
wrong docs: either narrow the parameter type to the union "kdm" | "kdc" or
explicitly check productSlug and throw a clear error when it is not "kdm" or
"kdc"; update the selection logic that assigns docs (kdmDocs/kdcDocs) to only
run after validation so getDoc, allDocs and docList always reflect the intended
product.
- Line 50: The title fallback currently uses "title: data.title ?? slug ??
'Untitled'" which leaves an empty slug ("") as the chosen title; update the
expression in src/lib/docs.ts so empty strings are treated as missing—e.g.
replace the nullish-coalescing chain with a truthy fallback such as using
logical OR or an explicit empty-string check (for example: use data.title ||
slug || "Untitled" or (data.title ?? slug) || "Untitled") so index.md (slug =
"") falls back to "Untitled".
---
Outside diff comments:
In `@src/components/Footer.tsx`:
- Around line 26-33: The Footer component currently hardcodes the "Status"
anchor to the KDM GitHub URL; update Footer (the anchor rendering the "Status"
link) to build the URL based on the current product context instead of the fixed
string. Locate the anchor in Footer.tsx and replace the hardcoded href with a
product-aware value (e.g., derive from a prop/context value like currentProduct
or use a utility/getRepoUrl(product) mapping that returns the correct repository
or status page for KDM vs KDC); ensure target/rel attributes remain and adjust
the anchor text if you switch to a dedicated status page endpoint.
---
Nitpick comments:
In `@src/docs/kdc/index.md`:
- Around line 16-19: Rewrite the four bullets to avoid repeating "If the project
has..." by rephrasing each line: replace "If the project has a `Dockerfile`"
with something like "Presence of a `Dockerfile` enables Docker actions", change
"If the project has `docker-compose.yml`" to "A `docker-compose.yml` enables
Compose actions", reword "If the project has Kubernetes manifests" to
"Kubernetes manifests enable Kubernetes and deployment actions", and keep or
slightly rephrase "If Docker is installed but not running" to maintain clarity
about reporting disabled runtime-dependent actions; update the three affected
list items accordingly where those phrases appear.
In `@src/docs/kdc/installation.md`:
- Around line 105-110: The "Build From Source" bash snippet is duplicated;
remove the repeated git clone/cargo build/sudo mv block from the "Build From
Source" section and replace it with a short cross-reference to the canonical
build instructions (the original snippet under the earlier installation "Build
From Source" section), or move the canonical snippet into a single central
location (e.g., development.md) and update both places to reference that single
source so the clone/build/move commands are maintained in only one place.
In `@src/routes/kdm.docs.tsx`:
- Around line 15-17: The call to createDocsLoader("kdm") is being executed
inside KdmDocsLayout on every render; move the loader creation to module scope
so it is created once - e.g., create a top-level constant (referencing
createDocsLoader("kdm") and name it like kdmDocsLoader) and then have
KdmDocsLayout read from that constant (instead of calling createDocsLoader
inside the component) to avoid repeated object recreation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b3af1d03-8578-4386-a7c9-9bb2da495509
📒 Files selected for processing (38)
src/components/CTA.tsxsrc/components/Commands.tsxsrc/components/Features.tsxsrc/components/Footer.tsxsrc/components/Hero.tsxsrc/components/Navbar.tsxsrc/components/Terminal.tsxsrc/config/products/index.tssrc/config/products/kdc.tssrc/config/products/kdm.tssrc/config/products/types.tssrc/context/ProductContext.tsxsrc/docs/kdc/commands.mdsrc/docs/kdc/development.mdsrc/docs/kdc/features.mdsrc/docs/kdc/index.mdsrc/docs/kdc/installation.mdsrc/docs/kdm/commands.mdsrc/docs/kdm/contributing.mdsrc/docs/kdm/index.mdsrc/docs/kdm/installation.mdsrc/lib/docs.tssrc/routeTree.gen.tssrc/routes/__root.tsxsrc/routes/docs.$slug.tsxsrc/routes/docs.index.tsxsrc/routes/docs.tsxsrc/routes/index.tsxsrc/routes/kdc.docs.$slug.tsxsrc/routes/kdc.docs.index.tsxsrc/routes/kdc.docs.tsxsrc/routes/kdc.index.tsxsrc/routes/kdc.tsxsrc/routes/kdm.docs.$slug.tsxsrc/routes/kdm.docs.index.tsxsrc/routes/kdm.docs.tsxsrc/routes/kdm.index.tsxsrc/routes/kdm.tsx
💤 Files with no reviewable changes (3)
- src/routes/docs.$slug.tsx
- src/routes/docs.tsx
- src/routes/docs.index.tsx
…ng, and improve docs loader and CTA flexibility.
There was a problem hiding this comment.
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Absence of Expected Change Pattern
- kdm-website/src/components/Hero.tsx is usually changed with: kdm-website/vite.config.ts
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
closes #14
Summary by CodeRabbit
New Features
Documentation