Repository navigation
API Explorer: show a version notice on older and unreleased pages - #4977
Merged
Merged
Conversation
An older major names its version and the unreleased tree warns that it can change. Both link to the same page in the newest major, or to its landing page. Each switcher item now carries its moniker, so the notice finds the newest major without parsing labels. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A reader on an older major or on /next now sees which version the page belongs to, with a link to the same page in the newest major. The notice is a pill and a link under the H1, not a banner, so it does not compete with the page. The newest major and its numbered copy show nothing, because the version selector already says latest. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The style guide gains an operation page in an older major and one in the unreleased version. The API Explorer docs say which notice each version shows and where its link goes. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
`_VersionNotice` now takes the view model and returns nothing when the page has no notice, so each view makes one call instead of an `@if` block. `ApiVersionNotices.For` checks the page type before it scans the version items. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4977/ Sample changed pages: |
The notice was a block between the title and the request line, so it pushed them about 70px apart. It now sits in the title row and wraps under the title when the row is full, which keeps the 16px step to the request line. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The versionless URL belongs to the newest major the API declares, but the switcher lists only the trees that rendered. When that major failed to load, an older page named itself as "the latest version". The notice now looks up the declared newest major, keeps the page's own version, and drops the link when that tree did not render. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The lorem API is not served, so the "View the latest version" link on the two notice previews led nowhere. Each version in the preview switcher now links to the preview of the same operation in that version. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The notice sits in the title row and wraps under the title when the row is full. The docs said "under the title", which stopped being true when the notice moved into the row. They also state what the link does when the newest major did not render. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The notice sat beside a short title and slipped below a long one, so its place changed with the title and the window width. It now takes its own row under the title on every page type. The docs say so. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The notice link ended in a text arrow that matched neither look of the docs landing page. It now uses that page's arrow: the inline glyph in the legacy look and the shared `arrow_right` icon in the design-system look. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
On an operation page the `Version 8` label and the link to the latest version now sit with the other badges, so the title stays next to its request line. The `Unreleased` warning stays under the title, and pages without a badges row keep both notices under the title. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
An API with no numeric major serves `main` at the versionless URL, so an older tree such as `/vbeta` told readers to "View the latest version (Next)". Only a numeric version is a release to link to. Without one the notice keeps its label and has no link. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The unit tests pass the declared newest major to the notice directly. A generator case with an unreadable v9 now checks the wiring end to end: the v8 badges and the `/next` and v8 landing notices render without a link to the latest version. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The docs said the notice appears on every page type. Hand-written `children:` Markdown pages show none, even under `/v8/` or `/next/`, so a missing notice there does not mean the latest version. The docs now name generated API pages and call out the exception. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The preview tests passed if the arrow was removed or the icon name misspelled, and the generator snapshots cover only the legacy glyph. A verified snapshot of the `/next` preview notice now holds the link text and the arrow icon in one anchor. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The link text already says what the link does, and the icon has no label, so a screen reader could announce an unlabeled graphic. The arrow now sits in an `aria-hidden` wrapper, as the legacy glyph already does. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The old preview test looked for the destination and the label anywhere on the page, and the version switcher already links to the same preview, so it passed even if the notice link pointed elsewhere. A verified snapshot of the badges row now holds the label and its destination in one anchor. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The exported previews are sibling files in `preview/`, but their links to one another still pointed at the dev-server route, so the version picker and the notice link led outside the archive. The export now rewrites a preview-to-preview link to the sibling file. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The HTML tests still pass if a stylesheet puts the notice beside a short title again. A journey test now opens older and unreleased API pages at 375, 1280 and 1680px, in the legacy look and in the design-system look through the style-guide previews, and checks that the notice starts below the title. With the notice beside the title, the group page fails at 1280px and 1680px. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The journeys workflow fails its planning job when a test class is not in exactly one shard, so the new `ApiVersionNoticeTests` stopped every browser journey from running. It joins the other API page tests in `api-examples`. Raised in review by Libra. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
Older-major and unreleased API pages now show their version under the page title and link to the same page in the newest major.
Affects: API reference
Prompt summary: Implement docs-eng-team#1218. A reader on an older, end-of-life, or unreleased API page sees which version it is and can reach the newest major. The warning sits next to the title, not in a strip at the top.
Why
A reader who lands on
/v8or/nextfrom search cannot tell they are not on the current version. The version selector shows it, but only after the reader opens it. The RFC page types table asks for a notice on these pages, next to the title and without a top strip.Closes elastic/docs-eng-team#1218
What
Notice per page type
An older major shows a
Version 8label and a link to the same page in the newest major. The link goes to the newest major's landing page when the page does not exist there./nextshows anUnreleasedwarning with the same link. Versionless pages and the numbered copy of the newest major show nothing.Placement
The
Unreleasedwarning sits directly under the H1, on its own row, on operation, landing, group, schema, topic and structural pages. The older-major label and link sit there too, except on operation pages, where they join the badges row asVersion 8andLatest: v9. That keeps the title next to its request line. The intro and outro Markdown pages are left out because they are not versioned content.Markup and style
The label reuses the title badge, with a new
Warningtone next toDanger. Both looks get styles: the legacy one inapi-docs.cssand the design-system one inapi-reference.css.Previews
Two style-guide previews,
api-operation-older-majorandapi-operation-next, show both notices. The preview version switcher now listsNext,v9 (latest)andv8, as the generator builds it.Verify
Out of scope: the end-of-life notice. The page type does not exist yet (#1229). Adding it is one new case in
ApiVersionNotices.For.🤖 Generated with Claude Code