From 80d1473d569f9942734c83aed46308fd436d3ef1 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 18 Sep 2026 12:34:14 +0200 Subject: [PATCH 1/2] Mount Jump to API in the assembler API sidebar API reference pages need the box. Markdown docs, isolated builds, and air-gapped layouts must not get it. Co-Authored-By: Cursor Grok 4.6 --- docs/data/openapi/api-explorer.md | 2 + .../_Partials/Layout/_ApiPagesNav.cshtml | 42 ++++++++------ .../web-components/loadWebComponents.ts | 2 + .../ApiPagesNavRenderingTests.cs | 55 ++++++++++++++++++- 4 files changed, 84 insertions(+), 17 deletions(-) diff --git a/docs/data/openapi/api-explorer.md b/docs/data/openapi/api-explorer.md index 0f6d7154a4..0c5617db63 100644 --- a/docs/data/openapi/api-explorer.md +++ b/docs/data/openapi/api-explorer.md @@ -151,6 +151,8 @@ specs per product are not currently supported. Product pages show an API product switcher in the left navigation. The list includes every declared API and a Back to hub option. +Assembler API pages also show a Jump to API box at the top of that sidebar. The box searches API operations only. Isolated and air-gapped builds omit the box. Markdown docs pages do not get it back. + ## Remote spec resolution When `spec:` does not resolve to a file on disk, {{dbuild}} resolves the current (`main`) version diff --git a/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml b/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml index 430c6a9917..e7d565cb47 100644 --- a/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml +++ b/src/Elastic.ApiExplorer/_Partials/Layout/_ApiPagesNav.cshtml @@ -4,26 +4,36 @@ id="pages-nav" @(Model.Features.NavigationPreviewEnabled ? "hx-preserve" : "") class="sidebar-nav h-full simple-scrollbar"> - @if (Model.HubSwitcherItems.Count > 0) + @{ + var showJumpToPage = Model.BuildType == BuildType.Assembler && !Model.Features.AirGappedEnabled; + } + @if (showJumpToPage || Model.HubSwitcherItems.Count > 0) {
- - + @foreach (var item in Model.HubSwitcherItems) { - + if (item.Selected) + { + + } + else + { + + } } - } - + + }
}