Skip to content

API Explorer: label the unreleased version "Next (unreleased)" - #4973

Merged
reakaleek merged 4 commits into
mainfrom
api-version-switcher-c201bfde
Nov 20, 2026
Merged

reakaleek merged 4 commits into
mainfrom
api-version-switcher-c201bfde

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The API version menu now calls the unreleased build "Next (unreleased)" instead of main. The trigger and breadcrumb read "Next". Numbered majors keep v9 (latest) and v8.

Affects: API reference

Prompt summary: Implement elastic/docs-eng-team#1216: each API page shows which major it serves, and the version selector keeps the reader on the same page. The numbered labels keep their v prefix by the author's call.

Why

Closes elastic/docs-eng-team#1216

#4971 serves the unreleased build at /next and the newest major at the versionless URL. It also already links the newest major to versionless URLs and keeps the reader on the same page when switching. The menu still names the unreleased build main, which no longer matches its URL.

What

Version labels

The main entry reads "Next (unreleased)" in the menu and "Next" in the trigger and breadcrumb. Page titles still omit the unreleased label, as before. Numbered majors are unchanged.

Tests and docs

The switcher, breadcrumb and navigation rendering tests assert the new text. The API Explorer page describes the new label.

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests
dotnet test --project tests/Navigation.Tests

Out of scope: The issue asks for 9 (latest) and 8. This PR keeps the v prefix. The same-page switch uses the per-version page set built at render time, not links.json, and behaves the same.

The unreleased tree is served at /next, but the version menu still called it main. The menu entry now reads "Next (unreleased)" and the trigger, breadcrumb and page title read "Next". Numbered majors keep their v labels.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 20, 2026 01:08
@reakaleek
reakaleek requested a review from akira28 November 20, 2026 01:08
Comment thread docs/data/openapi/api-explorer.md Resolved
}

private static string ShortLabelFor(string moniker) => moniker == "main" ? moniker : $"v{moniker}";
private static string ShortLabelFor(string moniker) => moniker == "main" ? "Next" : $"v{moniker}";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: P3 (Low)

The browser title still omits Next on unreleased pages. ApiPageTitle.ReleasedVersionLabel only accepts labels starting with v followed by a digit, so the new short label reaches the breadcrumb but is dropped from the title. Include Next in title generation and cover it with a title assertion.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No change in this PR. ReleasedVersionLabel never returned main either, so unreleased page titles were already unlabeled before this change. /next is noindex and out of the search index since #4972, so the title does not reach search. Adding the label to titles and headings is a separate behavior change. I corrected the PR description, which wrongly said the title reads "Next".

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed that this is not a regression introduced by this PR. The PR changes the switcher’s short label for main from main to Next (ApiVersionSwitcher.cs#L47); title generation still deliberately selects only released labels, and its predicate requires v followed by a digit (ApiPageTitle.cs#L30-L43, ApiPageTitle.cs#L73). So adding Next to titles would be a separate behavior change, not a fix for a title regression in this PR.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

reakaleek and others added 2 commits November 20, 2026 02:11
…iew by @infra-vault-gh-plugin-prod)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…per review by @infra-vault-gh-plugin-prod)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…review by @infra-vault-gh-plugin-prod)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@reakaleek
reakaleek merged commit 7e2928f into main Nov 20, 2026
44 checks passed
@reakaleek
reakaleek deleted the api-version-switcher-c201bfde branch November 20, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant