Skip to content

Show a beta banner on every API page - #4832

Merged
akira28 merged 8 commits into
mainfrom
feature/api-explorer-show-beta
Nov 16, 2026
Merged

akira28 merged 8 commits into
mainfrom
feature/api-explorer-show-beta

Conversation

@akira28

@akira28 akira28 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Every API reference page, including the /api/ catalog, now shows a slim beta banner below the site header. The banner says the site is new and links readers to an issue form with the page URL filled in.

Affects: API reference, Site UI

Prompt summary: At the Bump.sh cutover, readers should see that the API reference is new and know where to report problems. The banner must be visible on every API page, one line on desktop and two at most on mobile, and accessible. Closes elastic/docs-eng-team#1196.

Why

The cutover replaces the Bump.sh pages with a refreshed API site. Readers will notice differences, and without a message those differences look like regressions. Today the API pages give readers no obvious way to tell us what they find.

What

One banner, both layouts

The banner renders just before #main-container in _Layout.cshtml and _CatalogLayout.cshtml, with NAVIGATION_PREVIEW both off and on. No boosted swap carries it: a move within an API swaps only #api-content-grid, and the design-system bundle swaps #main-container between docs and API pages. After each boosted navigation, api-beta-banner.ts replaces, inserts or removes the banner to match the new page, in both bundles. Its feedback link therefore always names the page the reader is on, and the banner never shows on docs pages. It is not dismissible.

Wording and size

The text uses the long wording from the issue, with a visible "Beta" label, so colour is not the only signal. The middle sentence shows only above 1100px, the design system's widest breakpoint, where the whole message fits on one line. Below that the short message is one line down to 768px and two lines on a phone.

Feedback link

"let us know" opens the same docs-content issue form as Report an issue on docs pages (issue-report.yaml, label source:web). It adds link= when the build has a canonical base URL. The link opens in the same tab. The URL is one constant in ApiBetaBanner.

Removal

To remove the banner, delete ApiBetaBanner, _ApiBetaBanner.cshtml, api-beta-banner.test.ts and the .api-beta-banner rules in api-docs.css and api-reference.css.

Out of scope: the final wording and feedback target still need sign-off from @timto-elastic before merge. Both live in one file each: _ApiBetaBanner.cshtml and ApiBetaBanner.cs.

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests
# ApiBetaBannerTests — feedback URL with and without a canonical base URL, rendered markup
# *_BetaBanner_SitsOutsideTheSwappedContainer — placement on product and catalog pages
mise run site:test
# api-beta-banner.test.ts — a move within the API, docs to API and API to docs
mise run serve
# open http://localhost:3000/api/, move between operations, and check the link at desktop and mobile widths

Check on the preview

  • API catalog — banner on one line above the hero, with the middle sentence above 1100px and without it below; two lines at most on a phone.
  • Elasticsearch: Search — banner above the three-column layout. Click another operation in the nav: "let us know" now links that operation.
  • Docs home — control page: no banner.

🤖 Generated with Claude Code

The Bump.sh cutover replaces the old API pages with a new site. Readers
will notice differences, so a slim banner says the site is new and links
to the docs-content issue form with the page URL filled in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@akira28
akira28 requested a review from a team as a code owner November 12, 2026 11:52
@akira28
akira28 requested a review from Mpdreamz November 12, 2026 11:52
Comment thread src/Elastic.ApiExplorer/_Layout.cshtml Resolved
@github-actions

Copy link
Copy Markdown
Contributor

A move within one API swaps only `#api-content-grid`, so the banner kept
the first page's URL. The banner now sits outside `#main-container` and
replaces itself out of band on every swap. The middle sentence shows only
from 1200px, where the whole message fits on one line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
akira28 and others added 3 commits November 13, 2026 14:52
With `NAVIGATION_PREVIEW` on, a move between docs and API pages swaps
`#main-container` without a reload. The out-of-band banner then had no
element to replace on the way in and stayed on docs pages on the way out.
After each boosted swap the banner is now replaced, inserted or removed
to match the new page, in both bundles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ocs-builder into feature/api-explorer-show-beta

@technige technige left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me. We will await @timto-elastic's review of the wording, otherwise it looks ready to go.

akira28 and others added 3 commits November 16, 2026 12:00
`Css_UsesOnlyTheSystemBreakpoints` allows only 760, 860 and 1100 in the
design-system CSS, so the 1199 rule failed the build. The full message
still fits on one line from 1101px in both layouts.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ocs-builder into feature/api-explorer-show-beta
@akira28
akira28 merged commit badc306 into main Nov 16, 2026
43 checks passed
@akira28
akira28 deleted the feature/api-explorer-show-beta branch November 16, 2026 12:01
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.

2 participants