Skip to content

Add examples rail and restyle API Explorer operation pages - #3973

Open
itsalexcm wants to merge 1 commit into
mainfrom
feat/api-explorer-improvements
Open

Add examples rail and restyle API Explorer operation pages#3973
itsalexcm wants to merge 1 commit into
mainfrom
feat/api-explorer-improvements

Conversation

@itsalexcm

Copy link
Copy Markdown
Contributor

API Explorer operation pages on main now render an examples rail, breadcrumbs, and HTTP method badges in the current sidebar. Isolated serve shows the same layout without Nav V2.

Affects: API reference, Site UI, Navigation

Why

Operation pages on main have no examples rail and no breadcrumbs. The sidebar also does not paint HTTP method badges, even though the navigation model already carries IHttpMethodNavigationModel. That page work sat on a Findability-stacked branch that cannot merge to main.

What

Examples rail

Every operation page that has samples or named examples renders #api-examples-panel beside the article. Highlighting and copy buttons cover the rail, including console and curl blocks. At 1024px and up, the layout becomes a two-column grid driven by CSS :has.

Synthetic samples

When an operation has no x-codeSamples, the generator builds a minimal Console and curl sample from the method, path, required query parameters, required headers, and document servers URL. Author-provided samples always win.

Current sidebar

API pages keep _ApiPagesNav from main. _TocTreeNav and _TocTreeNavLegacy paint GET/POST/PUT/DELETE/multi glyphs from IHttpMethodNavigationModel and IMultiOperationNavigationItem. Nav V2 is not on this branch.

Operation page chrome

Breadcrumbs sit above the article. Operation pages restyle request and response cards and keep the property tree. The right rail is examples-only; "On this page" stays hidden.

Out of scope — Nav V2, the Findability hub, and later supplemental catalog work on main. This PR supersedes #3796.

Verify

dotnet test tests/Elastic.ApiExplorer.Tests/
dotnet run --project src/tooling/docs-builder -- serve --port 3000

Open /api/doc/docs-builder-elasticsearch/ and an operation page. Confirm the examples rail, breadcrumbs, and method badges.

Made with Cursor

The examples rail and operation restyle lived on api-docs/improvements, stacked on Nav V2. This branch takes that core and wires it to _ApiPagesNav so the Findability prototype can close.

Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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