From 71139c85adda66252e243dd0759b0936203156fe Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 22 Sep 2026 17:44:06 +0200 Subject: [PATCH 1/2] Move nav method glyphs into the SVG sprite sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each API operation page emits 613 inline SVG elements in the sidebar nav, but they are only three distinct shapes (arrow, X, multi-operation branch). At ~246 bytes each on average, those duplicates account for ~151 KB per page — 89% of the 436 KB page weight. Three symbols are added to the hidden sprite sheet in `_GlobalLayout.cshtml`: `icon-api-arrow`, `icon-api-x`, and `icon-api-multi`. The templates that previously inlined the full path data now emit a single `` reference per glyph instead. `currentColor` inheritance and the `rotate(180deg)` transform on GET arrows both work through `` — the outer `` carries the transform. The same inline paths appear in `_HttpMethodBadge.cshtml` on API Explorer operation pages; those are updated to use the same sprites. `icon-chevron-double-down` is also added to the sprite sheet. It was referenced in `_TocTreeNavLegacy.cshtml:25` but missing — a pre-existing dangling reference that rendered as a blank icon. Co-Authored-By: Claude Sonnet 4.6 --- .../_Partials/_HttpMethodBadge.cshtml | 14 +----- .../Navigation/_NavHttpMethodGlyph.cshtml | 45 +++++-------------- .../_GlobalLayout.cshtml | 13 ++++++ 3 files changed, 25 insertions(+), 47 deletions(-) diff --git a/src/Elastic.ApiExplorer/_Partials/_HttpMethodBadge.cshtml b/src/Elastic.ApiExplorer/_Partials/_HttpMethodBadge.cshtml index 36e2f17595..f510094767 100644 --- a/src/Elastic.ApiExplorer/_Partials/_HttpMethodBadge.cshtml +++ b/src/Elastic.ApiExplorer/_Partials/_HttpMethodBadge.cshtml @@ -4,21 +4,11 @@ @Model.ToUpperInvariant() diff --git a/src/Elastic.Documentation.Site/Navigation/_NavHttpMethodGlyph.cshtml b/src/Elastic.Documentation.Site/Navigation/_NavHttpMethodGlyph.cshtml index 1efdc24287..9975b8ec90 100644 --- a/src/Elastic.Documentation.Site/Navigation/_NavHttpMethodGlyph.cshtml +++ b/src/Elastic.Documentation.Site/Navigation/_NavHttpMethodGlyph.cshtml @@ -1,42 +1,17 @@ @inherits RazorSlice @if (Model.IsMultiOperation) { - - - + } else if (Model.HttpMethod is { } httpMethod) { - - @if (httpMethod == "delete") - { - - } - else - { - - } - + var m = httpMethod.ToUpperInvariant(); + if (httpMethod == "delete") + { + + } + else + { + + } } diff --git a/src/Elastic.Documentation.Site/_GlobalLayout.cshtml b/src/Elastic.Documentation.Site/_GlobalLayout.cshtml index 38a9605e8d..b6f74ebf1e 100644 --- a/src/Elastic.Documentation.Site/_GlobalLayout.cshtml +++ b/src/Elastic.Documentation.Site/_GlobalLayout.cshtml @@ -50,6 +50,19 @@ + + + + + + + + + + + + + @if (Model.GoogleTagManager.Enabled) From 93f6dd5a909c183dc52d6f28f22e77a146e7e838 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 29 Sep 2026 14:41:15 +0200 Subject: [PATCH 2/2] fix: align chevrons in legacy nav at all nesting depths The `ul.nav-subtree` was a bare flex item of `li.nav-folder` with no explicit width. In a flex wrap container, this makes the subtree content-sized, so its children's `w-full` percentage resolves against a collapsing containing block. The result: `grid-cols-[1fr_auto]` at depth 2+ collapsed to text width + chevron, placing the `>` glyph immediately after the link text instead of at the panel's right edge. Wrapping the subtree in `div.nav-subtree-clip` (which carries `@apply w-full`) gives it a defined containing block. The existing CSS selectors already handle the clip path for both reveal and current-page line-darkening rules, so no CSS change is needed. Co-Authored-By: Claude Sonnet 4.6 --- .../Navigation/_TocTreeNavLegacy.cshtml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Elastic.Documentation.Site/Navigation/_TocTreeNavLegacy.cshtml b/src/Elastic.Documentation.Site/Navigation/_TocTreeNavLegacy.cshtml index 1471efe642..2045ccdbb1 100644 --- a/src/Elastic.Documentation.Site/Navigation/_TocTreeNavLegacy.cshtml +++ b/src/Elastic.Documentation.Site/Navigation/_TocTreeNavLegacy.cshtml @@ -54,9 +54,11 @@ } - + } else @@ -82,9 +84,11 @@ } - + } }