Skip to content

fix: wire Talos API and CLI reference sidebars to show all methods#2604

Merged
aeneasr merged 3 commits into
masterfrom
aeneasr/talos-api-sidebar-methods
Jun 4, 2026
Merged

fix: wire Talos API and CLI reference sidebars to show all methods#2604
aeneasr merged 3 commits into
masterfrom
aeneasr/talos-api-sidebar-methods

Conversation

@aeneasr

@aeneasr aeneasr commented Jun 4, 2026

Copy link
Copy Markdown
Member

Related Issue or Design Document

Improves the documentation, no issue reference required.

The Talos reference sidebar was broken: the generated API reference sidebar was never wired into the OSS/OEL navigation, so only the overview page showed instead of all 18 API methods, and the CLI reference exposed only a single flat talos command entry. This PR wires the generated Talos API reference sidebar into both the OSS and OEL sidebars and groups the methods under a clean "API reference" category linked to the overview page. It also adds a hand-maintained CLI reference sidebar (docs/talos/reference/cli/sidebar.ts) that mirrors the talos --help command hierarchy and replaces the flat CLI entry in both sidebars. The result is a complete, navigable Talos API and CLI reference.

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Introduced a new structured navigation tree for Talos CLI reference documentation
    • Reorganized Talos API reference navigation to consolidate related items under a unified "API reference" category
    • Updated documentation structure across Talos Reference section for improved organization

aeneasr and others added 3 commits June 4, 2026 16:57
The OSS and OEL sidebars hardcoded only the Talos API overview page and
never imported the generated sidebar, so all 18 method entries were
dropped during the path-based URL migration (#2603). Import the generated
sidebar and spread it in place of the single overview entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The generated OpenAPI sidebar surfaced its raw tag name ("ApiKeys") and a
separate "Introduction" doc flat inside the Talos Reference category. Lift
the methods into a single "API reference" category linked to the overview
page so the navigation reads cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a hand-maintained CLI reference sidebar tree mirroring the
`talos --help` command hierarchy and wire it into the OSS and OEL
sidebars in place of the single flat `talos` command entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 4, 2026 15:07

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aeneasr aeneasr enabled auto-merge (squash) June 4, 2026 15:09
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR refactors Talos documentation navigation by extracting the CLI reference into a dedicated sidebar definition file and updating both OEL and OSS main sidebars to import and integrate the new CLI reference alongside consolidated API references, replacing direct doc-ID references with organized category structures.

Changes

Talos CLI and API Reference Navigation

Layer / File(s) Summary
CLI reference sidebar definition
docs/talos/reference/cli/sidebar.ts
Defines the complete Talos CLI reference navigation tree with a doc-ID helper, "CLI reference" root category, and nested command structures for talos jwk, talos keys, talos migrate, and talos serve commands, exported as talosCliReference.
OEL sidebar integration
sidebars-oel.ts
Imports Talos API and CLI sidebars, creates an internal talosApiReference category that aggregates API methods under a single "API reference" group linked to the API overview doc, and updates the Talos "Reference" category to use these generated entries.
OSS sidebar integration
sidebars-oss.ts
Imports the new Talos API and CLI sidebars, creates a talosApiReference category flattening the generated API sidebar, and updates the Talos "Reference" section to reference the consolidated API and imported CLI references instead of raw doc IDs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 New paths through Talos docs take shape,
CLI commands in neat sidebar escape,
Two mirrors sync—OEL and OSS aligned,
References grouped, navigation refined!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: wiring Talos API and CLI reference sidebars to display all methods in the navigation.
Description check ✅ Passed The pull request description follows the template with a clear 'Related Issue or Design Document' section explaining the improvement, and a completed checklist addressing the required items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aeneasr/talos-api-sidebar-methods

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.

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

🧹 Nitpick comments (2)
sidebars-oel.ts (2)

10-22: 💤 Low value

Consider whether the overview doc should also appear as the first item.

The generated talosApiReference category links to the overview page but does not include it as the first item in the items array. Based on learnings, the intentional pattern in sidebar files is to have a doc appear both as the category link and as the first entry in items to ensure it's visible both as the landing page and in the sidebar list.

However, the comment explicitly states the intent is to "read cleanly instead of exposing the raw OpenAPI tag name," suggesting the omission is deliberate. Please confirm whether users can still easily discover and access the overview page with this structure, or if it should be added to items for consistency with the established pattern.

Based on learnings: In sidebar config files, having a doc listed both as a category link and as the first entry in the same sidebar items array is intentional, ensuring the page appears as the visible category landing and is also explicitly present in the sidebar list.

🤖 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 `@sidebars-oel.ts` around lines 10 - 22, The talosApiReference category
currently sets link: { type: "doc", id: "talos/reference/api/ory-talos-api" }
but omits that same doc from the items list, breaking the established pattern of
listing the overview page as the first item; update talosApiReference so its
items array begins with the overview doc (id
"talos/reference/api/ory-talos-api") followed by the existing flatMap result
from talosApiSidebar, ensuring the overview appears both as the category landing
(link) and as the first sidebar entry while preserving the rest of the generated
items.

10-22: ⚡ Quick win

Consider extracting the duplicated talosApiReference logic.

The talosApiReference construction logic (lines 10-22 in this file) is duplicated identically in sidebars-oss.ts (lines 4-16). Extracting this shared logic into a separate module (e.g., docs/talos/reference/api/api-reference-builder.ts) would improve maintainability and ensure both sidebars stay in sync when the API sidebar structure changes.

♻️ Suggested refactor to extract shared logic

Create a new file docs/talos/reference/api/api-reference-builder.ts:

import talosApiSidebar from "./sidebar"

// The generated Talos API sidebar is [overview doc, { category "ApiKeys", items: [...methods] }].
// Lift the methods into a single "API reference" category linked to the overview page so the
// navigation reads cleanly instead of exposing the raw OpenAPI tag name.
export const talosApiReference = {
  type: "category",
  label: "API reference",
  link: { type: "doc", id: "talos/reference/api/ory-talos-api" },
  items: talosApiSidebar.flatMap((item: any) =>
    typeof item === "object" && "items" in item && Array.isArray(item.items)
      ? item.items
      : [],
  ),
}

Then update both sidebar files to import it:

-import talosApiSidebar from "./docs/talos/reference/api/sidebar"
+import { talosApiReference } from "./docs/talos/reference/api/api-reference-builder"
 import talosCliReference from "./docs/talos/reference/cli/sidebar"
-
-// The generated Talos API sidebar is [overview doc, { category "ApiKeys", items: [...methods] }].
-// Lift the methods into a single "API reference" category linked to the overview page so the
-// navigation reads cleanly instead of exposing the raw OpenAPI tag name.
-const talosApiReference = {
-  type: "category",
-  label: "API reference",
-  link: { type: "doc", id: "talos/reference/api/ory-talos-api" },
-  items: talosApiSidebar.flatMap((item: any) =>
-    typeof item === "object" && "items" in item && Array.isArray(item.items)
-      ? item.items
-      : [],
-  ),
-}
🤖 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 `@sidebars-oel.ts` around lines 10 - 22, Duplicate construction of
talosApiReference should be extracted into a shared module: create a new module
that imports talosApiSidebar and exports a single talosApiReference object (same
shape and flatMap logic as currently used), then replace the inline
talosApiReference definitions in both sidebar files to import that exported
talosApiReference; update any references to talosApiReference to use the shared
export so both sidebars stay in sync.
🤖 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.

Nitpick comments:
In `@sidebars-oel.ts`:
- Around line 10-22: The talosApiReference category currently sets link: { type:
"doc", id: "talos/reference/api/ory-talos-api" } but omits that same doc from
the items list, breaking the established pattern of listing the overview page as
the first item; update talosApiReference so its items array begins with the
overview doc (id "talos/reference/api/ory-talos-api") followed by the existing
flatMap result from talosApiSidebar, ensuring the overview appears both as the
category landing (link) and as the first sidebar entry while preserving the rest
of the generated items.
- Around line 10-22: Duplicate construction of talosApiReference should be
extracted into a shared module: create a new module that imports talosApiSidebar
and exports a single talosApiReference object (same shape and flatMap logic as
currently used), then replace the inline talosApiReference definitions in both
sidebar files to import that exported talosApiReference; update any references
to talosApiReference to use the shared export so both sidebars stay in sync.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 51e8700b-bdec-46d2-9486-d16a05713e92

📥 Commits

Reviewing files that changed from the base of the PR and between fa193db and 77288aa.

📒 Files selected for processing (3)
  • docs/talos/reference/cli/sidebar.ts
  • sidebars-oel.ts
  • sidebars-oss.ts

@aeneasr aeneasr disabled auto-merge June 4, 2026 15:15
@aeneasr aeneasr merged commit 927789c into master Jun 4, 2026
15 checks passed
@aeneasr aeneasr deleted the aeneasr/talos-api-sidebar-methods branch June 4, 2026 15:15
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.

3 participants