Skip to content

Label unreleased version as Beta instead of Legacy#376

Merged
moritzhartmeier merged 1 commit into
mainfrom
fix-beta-version-label
Jun 24, 2026
Merged

Label unreleased version as Beta instead of Legacy#376
moritzhartmeier merged 1 commit into
mainfrom
fix-beta-version-label

Conversation

@raffaelefarinaro

Copy link
Copy Markdown
Contributor

Problem

The SDK version dropdown showed the unreleased 8.5.0 (current) version tagged as LEGACY, even though #375 added a getCategory() branch intended to tag it as Beta:

if (version.banner === 'unreleased') return 'beta';

That check never matched. useVersions() returns global-data version objects built by Docusaurus's toGlobalDataVersion(), which only expose name, label, isLast, path, mainDocId, docs, draftIds, and sidebarsthere is no banner field. (banner lives on the per-page PropVersionMetadata from useDocsVersion(), not on the global version list.) So version.banner was always undefined and the unreleased version fell through to legacy.

Fix

Key on version.name === 'current' instead. Docusaurus always names the in-development version current, which is exactly the one the config marks banner: 'unreleased'. The component already uses version.name for its Xamarin filter, so it's the consistent property to branch on.

Version Before After
8.5.0 (current, unreleased) Legacy Beta
8.4.1 (isLast) Stable Stable
7.6.14 Legacy Legacy
6.28.10 Legacy Legacy

The .version-tag-beta styling already exists in navbar.scss, so no other changes are needed.

The version dropdown's getCategory() branched on version.banner, but
useVersions() returns global-data version objects (toGlobalDataVersion)
which don't carry the banner config field. The check never matched, so
the unreleased 'current' version fell through to 'legacy'.

Key on version.name === 'current' instead — the in-development version
is the one the config marks banner: 'unreleased'.
@moritzhartmeier moritzhartmeier merged commit 9c460c3 into main Jun 24, 2026
2 checks passed
@moritzhartmeier moritzhartmeier deleted the fix-beta-version-label branch June 24, 2026 18:19
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.

2 participants