refactor(docs): move REST API docs to navbar and dedicated sidebar#3040
Conversation
📝 WalkthroughWalkthroughRestructures REST API documentation navigation by importing a dedicated API sidebar, filtering out auto-generated API categories from the main sidebar, adding explicit REST API navbar/footer links, and running API doc generation before the docs build steps. ChangesREST API Documentation Navigation Restructuring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@gen-docs/sidebars.ts`:
- Line 18: The manual registration of the API sidebar (the apisidebar property
referencing apiSidebar) is redundant when the OpenAPI plugin auto-registers
sidebars; remove the apisidebar: apiSidebar entry from the exported sidebars
object and instead configure the plugin's sidebarOptions (or the plugin-specific
sidebar ID) to use the imported apiSidebar if the plugin requires it—verify the
OpenAPI plugin docs and adjust the plugin's sidebarOptions or the exported
sidebar ID accordingly so the build no longer registers the sidebar twice.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 82b0e126-1594-4373-a35d-607452d49df8
📒 Files selected for processing (3)
docs/api/_category_.jsongen-docs/docusaurus.config.tsgen-docs/sidebars.ts
💤 Files with no reviewable changes (1)
- docs/api/category.json
Remove the _category_.json that was injecting the API docs into theautogenerated documentation sidebar, add a sidebarItemsGenerator toexplicitly exclude the api/ directory from the main sidebar, registerapisidebar as a top-level sidebar so API pages retain their ownnavigation, and add REST API links to the navbar and footer.
f10e70f to
6d1235f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/test-docs.yml (1)
59-62: ⚡ Quick winConsider splitting API docs generation into a separate step.
While the current implementation works correctly, splitting the API docs generation into its own step would improve visibility in the GitHub Actions UI and make debugging easier if either step fails.
♻️ Proposed refactor to separate the steps
- - name: Build website + - name: Generate API documentation run: | cd gen-docs - pnpm gen-api-docs all && pnpm build + pnpm gen-api-docs all + + - name: Build website + run: | + cd gen-docs + pnpm build🤖 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 @.github/workflows/test-docs.yml around lines 59 - 62, The current "Build website" step bundles API docs generation and the site build into one command, making failures hard to diagnose; split it into two GitHub Actions steps by replacing the single step that runs "cd gen-docs && pnpm gen-api-docs all && pnpm build" with (1) a "Generate API docs" step that runs "cd gen-docs && pnpm gen-api-docs all" and (2) a separate "Build website" step that runs "cd gen-docs && pnpm build", so the commands pnpm gen-api-docs and pnpm build are executed and logged independently for clearer visibility and debugging.
🤖 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 @.github/workflows/test-docs.yml:
- Line 62: Remove the redundant "all" argument in the workflow command so it
doesn't pass "all" twice to docusaurus: update the step that runs "pnpm
gen-api-docs all && pnpm build" to call only the package script (i.e., run "pnpm
gen-api-docs && pnpm build"), since the gen-docs package.json already defines
the "gen-api-docs" script as "docusaurus gen-api-docs all"; change the command
in the workflow to invoke the script without the extra "all".
---
Nitpick comments:
In @.github/workflows/test-docs.yml:
- Around line 59-62: The current "Build website" step bundles API docs
generation and the site build into one command, making failures hard to
diagnose; split it into two GitHub Actions steps by replacing the single step
that runs "cd gen-docs && pnpm gen-api-docs all && pnpm build" with (1) a
"Generate API docs" step that runs "cd gen-docs && pnpm gen-api-docs all" and
(2) a separate "Build website" step that runs "cd gen-docs && pnpm build", so
the commands pnpm gen-api-docs and pnpm build are executed and logged
independently for clearer visibility and debugging.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9834e23d-afd3-4f7f-9261-177415915b05
📒 Files selected for processing (4)
.github/workflows/test-docs.ymldocs/api/_category_.jsongen-docs/docusaurus.config.tsgen-docs/sidebars.ts
💤 Files with no reviewable changes (1)
- docs/api/category.json
✅ Files skipped from review due to trivial changes (1)
- gen-docs/sidebars.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- gen-docs/docusaurus.config.ts
Description
The REST API documentation was mixed into the main documentation sidebar
alongside user-facing docs like Getting Started, Using Seerr, and
Extending Seerr. While collapsed by default, it's a developer-oriented
section that doesn't belong in the same navigation as user guides, and
the separation makes the intent of each section clearer.
This moves the REST API docs to a dedicated navbar entry and footer
link, keeping it easily accessible for developers while leaving the main
sidebar clean for users. The API pages retain their own sidebar with the
full endpoint tree when navigating to
/api/*.Also removes the redundant

allargument passed topnpm gen-api-docsin both the test and deploy workflows. Thegen-api-docsscript ingen-docs/package.jsonalready includesall, so passing it again resulted indocusaurus gen-api-docs all all.How Has This Been Tested?
Locally built and ran
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit