Repository navigation
Conversation
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4641/ Sample changed pages: |
akira28
force-pushed
the
feature/api-explorer-section-links
branch
from
November 3, 2026 12:46
88413ca to
2c0bc1f
Compare
A sticky bar above the sections links to Authorization, Path, Query, Header, Body and Response, and underlines the section in view. It follows the endpoint page proposal. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The bar now binds to the existing initToc scroll-spy and the example chip count pill instead of its own copies. Sections reached from the bar also stop below it, not under it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A short last section never reaches the activation line, so the outline spy now marks the last heading within a few pixels of the page bottom. A spy also stops listening once its outline leaves the page, so htmx swaps no longer pile up scroll handlers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The new bottom-of-page rule made jsdom's zero-height page count as scrolled to the end, so the test marked the last link. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
With every section open, operation pages are long and the examples scrolled away after the first screen. The rail is sticky again from 1024px up and scrolls inside itself when the examples are taller than the window, so the code blocks keep their fixed line caps. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The rail's own scrolling clipped the Copy page menu, which opens past the rail's left edge. The rail no longer clips; the examples below the button shrink to the window and scroll. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Only the parameter and response links had a number, and a count of one was hidden. Each link now shows what its section lists: privileges, parameters, body fields or variants, or responses. The numbers reuse the name lists the section headers already summarise. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The links are plain labels again, which keeps the bar short and avoids numbers that count different things in each section. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
akira28
force-pushed
the
feature/api-explorer-section-links
branch
from
November 4, 2026 07:58
2c0bc1f to
b33b7de
Compare
akira28
enabled stacked auto-merge (squash)
November 4, 2026 07:58
This branch was successfully deployed
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.
Operation pages now have a sticky bar of quick links to their sections: Authorization, Path, Query, Header, Body and Response. A click jumps to the section, and the link of the section in view is underlined. The examples rail also stays in view while the sections scroll.
Affects: API reference
Stack: 2 of 2, on top of #4636
Prompt summary: Stack a second PR on the expand-by-default change that adds fast links to the response, path and query sections. It follows the
epTabsbar of the endpoint page proposal in the API docs prototype, in the current stylesheet and not the flagged design system.Why
With every section open, an operation page gets long. A reader looking for the query parameters or the response scrolls past everything above it, and the page offers no map of what it holds.
What
The bar
_SectionLinks.cshtmlrenders one link per section the operation has, in page order.OperationViewModel.SectionLinksbuilds the list, and the bar is left out when the page has fewer than two sections.Behaviour
The bar sticks under the page header and scrolls sideways on a narrow window. A link is a plain
#anchor, so the existing hash handling opens a folded section it points into, and the section stops below the bar instead of under it.Sticky examples rail
From 1024px up,
.api-page-railis sticky under the page header. When the examples are taller than the window, they scroll inside the rail under Copy page, so the code blocks keep their fixed line caps from #4554 and the Copy page menu is not clipped. That PR made the rail normal page flow because a rail sized to fit the window shrank the request code; this one keeps the caps and lets the rail scroll instead. Below 1024px the rail still follows the article.Reused pieces
The scroll-spy is
initTocfromds/toc.ts, the one behind the "On this page" outline: the bar carriesdata-tocanddata-toc-link, andinitOperationViewcallsinitToc. The bar adds no script and one small block of CSS inapi-docs.css. The design-system stylesheet has no styles for the bar yet, so a page built withNAVIGATION_PREVIEWon leaves it out and renders as before.Out of scope: The bar for the flagged design system, marking the last link at the bottom of a short page (the outline spy does not), and the filter and sort controls the prototype shows in the query and body sections.
Verify
Check on the preview
🤖 Generated with Claude Code