Skip to content

Nav sections: independent sidebar islands and dynamic top bar#3133

Open
theletterf wants to merge 19 commits intonav-v2from
nav-v2-sections
Open

Nav sections: independent sidebar islands and dynamic top bar#3133
theletterf wants to merge 19 commits intonav-v2from
nav-v2-sections

Conversation

@theletterf
Copy link
Copy Markdown
Member

@theletterf theletterf commented Apr 16, 2026

Summary

  • Adds section: and island: item types in navigation-v2.yml that create independent nav trees ("nav islands"). Each section owns its own sidebar HTML — pages in one section never include another section's nav links in the DOM.
  • The secondary nav bar is now data-driven from the nav-v2 file instead of hardcoded. Sections appear as left-aligned, compact tabs (55px bar height). Isolated sections (isolated: true) do not appear in the top bar.
  • Per-section sidebar caching in GlobalNavigationHtmlWriter replaces the single "nav-v2" blob — each section's sidebar is rendered and cached independently.
  • External URLs in section url: fields open in a new tab with a ↗ indicator to signal users they're leaving elastic.co/docs.
  • Nav islands (island: item type) are intra-section subtrees that get their own focused sidebar when entered, with a back arrow pointing to the parent section. Island detection uses toc root identity (nav ownership model), not URL matching, so it works across all path prefixes.
  • Section root pages skip current-page highlighting in the sidebar and auto-expand top-level folders for discoverability.
  • The back arrow for top-level isolated sections is intentionally not implemented — the UX for exiting a top-level island is still under design review.

Tab ordering

Tabs follow a task-flow logic — building tabs grouped together, situational tabs at the end:

Guides | APIs ↗ | Reference | Troubleshoot | Release notes

Sections (top bar tabs)

Section Preview URL
Guides (full V2 tree) https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3133/
APIs https://www.elastic.co/docs/api (external, opens in new tab)
Reference https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3133/reference/
Troubleshoot https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3133/troubleshoot/
Release notes https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3133/release-notes/

Isolated sections (not in top bar)

Section Preview URL
Extension points https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3133/extend/

Nav islands (intra-section, with back arrow)

Island Parent Preview URL
Account and preferences Guides https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3133/cloud-account

Note: Logstash plugins and versioned plugins islands are configured but use logstash-docs-md (a private repo), so they are not accessible in PR previews. Test locally with dotnet run --project src/tooling/docs-builder -- assembler build && dotnet run --project src/tooling/docs-builder -- assembler servehttp://localhost:4000/docs/reference/logstash/plugins/

YAML format

nav:
  - section: Guides            # top bar tab, owns full sidebar
    url: /
    children:
      - label: Elasticsearch fundamentals
        children: [...]
      - island: Account and preferences   # focused sidebar + back arrow
        toc: docs-content://cloud-account

  - section: APIs              # external link, new tab with ↗
    url: https://www.elastic.co/docs/api

  - section: Reference         # top bar tab, own sidebar
    url: /reference/
    children:
      - toc: docs-content://reference
      - island: Logstash plugins          # focused sidebar + back arrow
        toc: logstash-docs-md://lsr

  - section: Troubleshoot      # top bar tab, own sidebar
    url: /troubleshoot/
    children:
      - toc: docs-content://troubleshoot

  - section: Release notes     # top bar tab, own sidebar
    url: /release-notes/
    children:
      - toc: docs-content://release-notes/intro

  - section: Extension points  # isolated: not in top bar
    url: /extend/
    isolated: true
    children:
      - toc: docs-content://extend

🤖 Generated with Claude Code

theletterf and others added 6 commits April 16, 2026 19:08
Introduces the `section:` YAML item type in navigation-v2.yml. Each
section owns an independent sidebar tree and optionally appears as a
tab in the secondary nav bar. Sections marked `isolated: true` render
with a back arrow instead of a top bar tab.

Key changes:
- SectionNavV2Item record + YAML parsing in NavV2FileYamlConverter
- SectionNavigationNode nav type + NavigationSection data carrier
- SiteNavigationV2 builds sections, URL-to-section lookup
- GlobalNavigationHtmlWriter renders per-section sidebar (cached)
- NavigationRenderResult carries section metadata
- _SecondaryNav.cshtml is now data-driven (falls back to static V1)
- _TocTree.cshtml shows back arrow for isolated sections
- PlaceholderPageWriter groups by section for per-section nav

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Converts the 4 top-level label: entries in navigation-v2.yml to the
new section: format with explicit url: fields. Each section becomes an
independent nav island with its own sidebar and top bar tab.

Sections:
- Elasticsearch fundamentals → /get-started/
- Install, deploy, and administer → /deploy-manage/deploy/
- The Elasticsearch Platform → /manage-data/ingest/
- Solutions and project types → /solutions/

Nested label: items within sections are unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…oubleshoot, Reference

Restructures navigation-v2.yml so all existing labels are children of
a single "Docs" section (full V2 tree in one sidebar). Adds Release
notes, Troubleshoot, and Reference as separate section tabs.

Secondary nav bar is now left-aligned, compact, and fully data-driven
from section metadata.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…to-expand

- Wrap all V2 content in a single "Docs" section; add Release notes,
  Troubleshoot, Reference as separate section tabs
- Secondary nav: left-aligned, 55px height, restored md:text-base font
- Skip current-page highlighting on section root pages via
  data-section-url attribute (includes site prefix)
- Auto-expand top-level folders on section root pages so content is
  visible without a specific page being marked current

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ove back arrow

Adds two isolated nav sections (not shown in top bar):
- Extension points (extend + kibana/logstash/beats/elasticsearch/integrations)
- Account and preferences (cloud-account)

Removes the back arrow from isolated sections — the UX for returning
from an island is still under design review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Absolute URLs (http/https) in section url: fields render as plain
links without HTMX swap or Model.Link() prefix. Sections with no
children work as external navigation targets.

Adds "API reference" tab pointing to https://www.elastic.co/docs/api

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread config/navigation-v2.yml
Islands are subtrees within a section that get their own focused sidebar
when a user navigates into their pages. A back arrow points to the
parent section's landing page (known at build time, no history.back).

YAML format:
  - section: Reference
    url: /reference/
    children:
    - toc: docs-content://reference
    - island: Logstash plugins
      toc: logstash-docs-md://lsr

Key changes:
- IslandNavV2Item record + YAML parsing for island: key
- IslandNavigationNode wraps an existing toc node
- NavigationIsland data carrier with ParentSection reference
- SiteNavigationV2 builds island list + URL-to-island lookup
  (islands take priority over sections in URL resolution)
- GlobalNavigationHtmlWriter renders island sidebar with back arrow
- Back arrow uses HTMX navigation to parent section URL

Adds Logstash plugins and versioned plugins as islands in Reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@KOTungseth KOTungseth left a comment

Choose a reason for hiding this comment

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

Now that Docs, Release notes, Troubleshoot, API reference, and Reference are grouped together, we need to find a solution for the Docs label.

Release notes, Troubleshoot, API reference, and Reference are content types and help users navigate to a specific kind of documentation. Docs is not a content type, but is the parent context to everything else that lives inside of Docs. By grouping Docs, Release notes, Troubleshoot, API reference, and Reference together, we have mixed together wayfinding and content-type navigation.

The cleanest fix right now is to handle the "back to landing page" behavior through a separate, persistent element, like a logo or a breadcrumb. That way, the secondary nav becomes a coherent, single-purpose set of content-type links and the navigation to the landing page exists independently.

We could also change the Docs label. Something like Home or Overview signals intent a bit more clearly than Docs, through is still doesn't fully resolve the category mismatch.

Comment thread config/navigation-v2.yml Outdated
children:
- toc: docs-content://troubleshoot

- section: API reference
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.

The API reference link creates a classic navigation trap. When users enter the Bump.sh site, they lose their wayfinding back to our elastic.co/docs canonical site.

Some options:

  • Open the API reference docs site in a new tab to allows users to keep the Elastic Docs tab and return to it naturally.
  • Label the API reference link with a API reference ↗ visual treatment to clearly set user expectations that when they click the link, they'll be leaving elastic.co/docs.
  • Negotiate a Back to Elastic Docs link with Bump.sh that easily points users back to elastic.co/docs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would go for

Negotiate a Back to Elastic Docs link with Bump.sh that easily points users back to elastic.co/docs.

Can we add it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A combination of all of these 3 options would be best

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

API reference ↗ and opening in new tab has my vote, until we have a clear vision of whats going to ship first API Explorer or v2.

Copy link
Copy Markdown
Member Author

@theletterf theletterf Apr 23, 2026

Choose a reason for hiding this comment

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

Implemented! I've also renamed and reordered items. WDYT?

Screenshot 2026-04-23 at 09 22 41

More options:

  • Get started
  • Learn
  • Handbook
  • Home

Moves Account and preferences from a top-level isolated section to an
island: entry under "Deployment and administration tools" in the Docs
section. This gives it:
- An entry point visible in the main Docs sidebar
- A back arrow pointing to the Docs section root (via the existing
  island mechanism)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The island's toc root URL was not being collected in the URL-to-island
lookup, so navigating to the root page (e.g. /cloud-account/) fell
through to the section lookup and showed the full Docs sidebar instead
of the island sidebar.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…atching

URL-based island lookup breaks across path prefixes (dev vs preview vs
production). The nav system already knows which toc root owns the
current page via currentRootNavigation — use that identity to resolve
islands instead.

Replaces _urlToIsland dictionary with _tocRootToIsland keyed by the
toc root's Id. GetIslandForTocRoot takes the root navigation item
directly, matching by nav ownership rather than URL strings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The 16px/24px vertical padding on top-level <li> inside the nav tree
was intended for label section separators but applied to all items,
making island sidebars with flat leaf links overly spaced. Scope the
rule to li:has(> .docs-sidebar-nav-v2__label) so only label sections
get the extra padding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The back arrow used GetNavHxAttributes which only swaps content areas,
leaving the sidebar stuck on the island. Use GetHxAttributes with
#main-container,#secondary-nav swap targets (same as section tabs) so
the sidebar, content, and top bar all update on back navigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
External section URLs (like API reference → Bump.sh) now open in a
new tab (target="_blank" rel="noopener") with a small external-link
icon (↗) to set user expectations that they're leaving elastic.co/docs.

Prevents the navigation trap where users lose their wayfinding back
to the docs site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Guides better signals task-based narrative content alongside the
content-type tabs. APIs is shorter and eliminates the repetition
with Reference.

Tabs: Guides | Release notes | Troubleshoot | APIs ↗ | Reference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Guides → APIs → Reference → Troubleshoot → Release notes

Groups building tabs together, situational tabs at the end.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous label 'Build search queries with APIs and query languages
and search templates' wrapped to three lines in the sidebar.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theletterf
Copy link
Copy Markdown
Member Author

@Mpdreamz Right now we have islands: as navs that have a parent in a current nav but lead to a separate nav, and sections that have isolated: true and are effectively parentless. I feel something is not quite elegant with this solution...

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.

5 participants