Skip to content

Add a product switcher on API reference pages - #4035

Open
reakaleek wants to merge 2 commits into
mainfrom
feat/817-hub-product-switcher
Open

Add a product switcher on API reference pages#4035
reakaleek wants to merge 2 commits into
mainfrom
feat/817-hub-product-switcher

Conversation

@reakaleek

Copy link
Copy Markdown
Member

API product pages now show a sidebar switcher. A reader can open another declared API or return to the hub without the browser back button.

Affects: API reference, Assembler builds

Prompt summary: Add a hub product switcher on API product pages so a reader can jump between assembled APIs and back to the hub. The tracking issue is elastic/docs-eng-team#817.

Why

API product pages do not use the site navigation dropdown. A reader on an Elasticsearch operation page cannot open Kibana or /docs/api/ without the browser back button.

Closes elastic/docs-eng-team#817

What

Sidebar product switcher

The left navigation on a product page shows a dropdown above the version list. The first option is Back to hub. The remaining options are the declared APIs, ordered by title. The current product is selected. The hub page hides the control.

Catalog collected before render

The generator reads declared api: entries before it fetches any spec. The assembler unions every owner's list and the first key wins. Each product render receives that shared list.

Isolated generate

A single-repo generate still builds the switcher from that repo's api: config. Sibling APIs appear only when the caller passes a shared list.

Verify

dotnet test tests/Elastic.ApiExplorer.Tests/
# ApiHubSwitcher, ApiPagesNavRendering, OpenApiGeneratorCatalogSplit

On a local serve of this repo, open /api/doc/docs-builder-elasticsearch/ and confirm the switcher lists Back to hub plus that product. An assembler preview is required to confirm a jump from Elasticsearch to Kibana.

Out of scope — The switcher does not sit in the header or secondary nav. Production still proxies API pages to bump.sh until the explorer ships there.

Made with Cursor

API pages cannot jump to another product or the hub because they do not use the site navigation dropdown.

Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4035/

Sample changed pages:

@reakaleek

Copy link
Copy Markdown
Member Author

We might want to move it elsewhere in a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant