fix(docs): version-picker shows 'latest' only on /versions/latest/ - #438
Merged
Conversation
The version picker defaulted currentVersion to 'latest', so on the site root and every unversioned page it surfaced AND selected the 'latest' option — not just on /versions/latest/. Default to null instead: only a /versions/<v>/ path (including the literal /versions/latest/) names a version; elsewhere 'latest' stays hidden and the browser auto-selects the highest v* entry. Fed back from Chris-Wolfgang/ETL-Abstractions#268. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot review on downstream syncs (DbContextBuilder#369, System.Mail- Extensions#208) flagged the "would show no selected option" claim as inaccurate — browsers auto-select the first option in a `<select>`. The real problem is that the auto-selected first concrete-version entry matches the current URL, so choosing it doesn't fire `change` and the reader can't navigate to the concrete-version URL. Fixed in the downstreams already (93780ed, 15f175f); propagating back to the canonical source so future template-syncs carry the accurate rationale. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feeds back the fix from Chris-Wolfgang/ETL-Abstractions#268 to the canonical template.
Problem
renderPickerdefaultedcurrentVersionto'latest'. Because thelatestalias is skipped unlesscurrentVersion === 'latest', that default surfaced and selected thelatestoption on the site root and every unversioned page — not just on/versions/latest/as intended.Fix
Default
currentVersiontonull. Only a/versions/<v>/path (including the literal/versions/latest/) now names a version:/versions/1.2.3/→1.2.3selected,latesthidden (unchanged)./versions/latest/→latestsurfaced and selected (so the reader can see which version they're viewing).latesthidden; the browser auto-selects the highestv*entry.Note: the canonical file was an older baseline than the downstream copies, so this also brings in the
/versions/latest/awareness those copies already had.Docs-only JS; no behavior change to the build.