Skip to content

Refactor documentation structure for multi-product support#22

Merged
utkarsh232005 merged 6 commits into
KDM-cli:mainfrom
utkarsh232005:main
Jun 5, 2026
Merged

Refactor documentation structure for multi-product support#22
utkarsh232005 merged 6 commits into
KDM-cli:mainfrom
utkarsh232005:main

Conversation

@utkarsh232005

@utkarsh232005 utkarsh232005 commented Jun 5, 2026

Copy link
Copy Markdown
Member

closes #14

Summary by CodeRabbit

  • New Features

    • Added multi-product support with dedicated product pages for KDM and KDC.
    • New hub homepage linking to both product offerings with quick access to documentation.
    • Product-specific documentation sections for each product.
  • Documentation

    • Added complete KDC documentation covering installation, features, CLI commands, and development guidance.

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@utkarsh232005, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d9185a65-511c-41ba-bb8b-dbba0daba991

📥 Commits

Reviewing files that changed from the base of the PR and between 651e6bf and 006a8b5.

📒 Files selected for processing (11)
  • src/components/CTA.tsx
  • src/components/Footer.tsx
  • src/components/Hero.tsx
  • src/components/Navbar.tsx
  • src/docs/kdc/index.md
  • src/docs/kdc/installation.md
  • src/lib/docs.ts
  • src/routes/__root.tsx
  • src/routes/index.tsx
  • src/routes/kdc.docs.tsx
  • src/routes/kdm.docs.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kdm-website Ready Ready Preview, Comment Jun 5, 2026 8:15am

codescene-delta-analysis[bot]

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Hardcoded "Status" link breaks cross-product navigation.

The "Status" link always points to https://github.com/KDM-cli/kdm-cli regardless 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 value

Duplicate 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 win

Move loader creation outside the component.

createDocsLoader("kdm") is called on every render of KdmDocsLayout. 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 value

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between d399145 and 651e6bf.

📒 Files selected for processing (38)
  • src/components/CTA.tsx
  • src/components/Commands.tsx
  • src/components/Features.tsx
  • src/components/Footer.tsx
  • src/components/Hero.tsx
  • src/components/Navbar.tsx
  • src/components/Terminal.tsx
  • src/config/products/index.ts
  • src/config/products/kdc.ts
  • src/config/products/kdm.ts
  • src/config/products/types.ts
  • src/context/ProductContext.tsx
  • src/docs/kdc/commands.md
  • src/docs/kdc/development.md
  • src/docs/kdc/features.md
  • src/docs/kdc/index.md
  • src/docs/kdc/installation.md
  • src/docs/kdm/commands.md
  • src/docs/kdm/contributing.md
  • src/docs/kdm/index.md
  • src/docs/kdm/installation.md
  • src/lib/docs.ts
  • src/routeTree.gen.ts
  • src/routes/__root.tsx
  • src/routes/docs.$slug.tsx
  • src/routes/docs.index.tsx
  • src/routes/docs.tsx
  • src/routes/index.tsx
  • src/routes/kdc.docs.$slug.tsx
  • src/routes/kdc.docs.index.tsx
  • src/routes/kdc.docs.tsx
  • src/routes/kdc.index.tsx
  • src/routes/kdc.tsx
  • src/routes/kdm.docs.$slug.tsx
  • src/routes/kdm.docs.index.tsx
  • src/routes/kdm.docs.tsx
  • src/routes/kdm.index.tsx
  • src/routes/kdm.tsx
💤 Files with no reviewable changes (3)
  • src/routes/docs.$slug.tsx
  • src/routes/docs.tsx
  • src/routes/docs.index.tsx

Comment thread src/components/CTA.tsx Outdated
Comment thread src/components/Hero.tsx
Comment thread src/components/Navbar.tsx Outdated
Comment thread src/lib/docs.ts Outdated
Comment thread src/lib/docs.ts Outdated
…ng, and improve docs loader and CTA flexibility.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@utkarsh232005 utkarsh232005 merged commit 9c098d6 into KDM-cli:main Jun 5, 2026
4 of 8 checks passed
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.

Feat: Redesign website to support dual-product architecture and documentation

1 participant