Skip to content

docs: Fix version switching for API reference pages#1823

Merged
vdusek merged 2 commits intomasterfrom
fix/docs-versioned-api-reference-and-sidebar
Mar 31, 2026
Merged

docs: Fix version switching for API reference pages#1823
vdusek merged 2 commits intomasterfrom
fix/docs-versioned-api-reference-and-sidebar

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented Mar 30, 2026

Problem

  • Switching versions for API reference pages is broken

Solution

  • Swizzle DocsVersionDropdownNavbarItem to navigate to the correct API version paths
  • Make API navbar link respect the currently selected docs version
  • Collapse all sidebar categories by default (to be aligned with SDK & Client)
  • Remove unreleased changelog section from versioned 1.6 docs

Test plan

  • Doc website executed locally and manually checked

@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Mar 30, 2026
@vdusek vdusek self-assigned this Mar 30, 2026
@github-actions github-actions bot added this to the 137th sprint - Tooling team milestone Mar 30, 2026
@vdusek vdusek changed the title fix(docs): fix version switching for API reference pages docs: Fix version switching for API reference pages Mar 30, 2026
@vdusek vdusek force-pushed the fix/docs-versioned-api-reference-and-sidebar branch from e7edc4f to 21f5400 Compare March 30, 2026 12:38
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (a3b635e) to head (d96c750).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1823   +/-   ##
=======================================
  Coverage   92.26%   92.26%           
=======================================
  Files         157      157           
  Lines       10886    10889    +3     
=======================================
+ Hits        10044    10047    +3     
  Misses        842      842           
Flag Coverage Δ
unit 92.26% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek requested a review from Pijukatel March 30, 2026 12:46
- Swizzle DocsVersionDropdownNavbarItem to navigate to correct API version paths
- Make API navbar link respect the currently selected docs version
- Collapse all sidebar categories by default and enable auto-collapse
- Remove unreleased changelog section from versioned 1.6 docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vdusek vdusek force-pushed the fix/docs-versioned-api-reference-and-sidebar branch from 21f5400 to e96c2a8 Compare March 31, 2026 07:44
@Pijukatel Pijukatel requested a review from Copilot March 31, 2026 11:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes docs-site version navigation for API reference routes by making the version dropdown and API navbar entry aware of API versioned paths, while aligning sidebar UX and cleaning up versioned changelog content.

Changes:

  • Swizzles DocsVersionDropdownNavbarItem to switch versions correctly when browsing /api/* routes.
  • Replaces the static API navbar link with a custom component that routes to the API path for the currently preferred docs version.
  • Collapses sidebar categories by default and removes the unreleased section from the versioned 1.6 changelog.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js New swizzled version dropdown that detects API routes and builds API-version-aware links.
website/src/theme/NavbarItem/ComponentTypes.js Adds custom-api navbar item type that links API to the preferred docs version.
website/src/theme/NavbarItem/apiVersionUtils.js Centralizes API path construction for stable/current/versioned API routes.
website/docusaurus.config.js Switches the navbar “API” item to type: 'custom-api'.
website/sidebars.js Collapses the Introduction sidebar category by default.
website/versioned_sidebars/version-1.6-sidebars.json Collapses Introduction in the 1.6 versioned sidebar.
website/versioned_sidebars/version-0.6-sidebars.json Collapses multiple categories by default in the 0.6 versioned sidebar.
website/versioned_docs/version-1.6/changelog.md Removes the unreleased changelog block from the versioned 1.6 docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vdusek vdusek merged commit f6be00b into master Mar 31, 2026
30 checks passed
@vdusek vdusek deleted the fix/docs-versioned-api-reference-and-sidebar branch March 31, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants