feat: section: entries with children become island tree nodes - #3867
Merged
Conversation
5 tasks
itsalexcm
approved these changes
Aug 14, 2026
Member
Author
|
@Mpdreamz Feel free to merge when ready! |
8 tasks
…w.yml
Adds a config-level section: grouping to navigation_preview.yml that maps
the 11 flat top-level toc: entries to 5 named tabs in the top nav bar.
Sections are config-only — children are added to the site tree as flat
roots, so no page URLs change.
New ISiteNavigationEntry interface and SiteSectionRef record allow the
YAML converter to parse both toc: and section: entries. SiteTableOfContents
becomes List<ISiteNavigationEntry>. SiteNavigation iterates entries and
descends into section children when encountered.
SectionTopNavBuilder derives TopNavRenderModel from the nav file's entry
list. Section tabs carry SectionIds so active state is resolved by
comparing the current page's NavigationRoot.Id to the tab's set.
BuildContext.TopNav wires the render model through to every page.
_SecondaryNav.cshtml renders the tabs and delegates dropdown/external
behaviour to secondary-nav.ts.
Section structure in navigation_preview.yml:
- section: Guides (get-started, solutions, manage-data, explore-analyze,
deploy-manage, cloud-account)
- section: Troubleshoot (troubleshoot)
- section: Release notes (release-notes/intro + release children)
- section: Reference (reference + reference children)
- section: Extend (extend, contribute-docs)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…row icon
Replace two-key syntax (external: true + url:) with single-key:
- section: APIs
external: https://...
SiteSectionRef now carries ExternalUrl (string?) with IsExternal computed.
_SecondaryNav.cshtml drops the SVG arrow from external link tabs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hetics The sidebar dropdown (isUsingNavigationDropdown) is suppressed when section tabs are active. Navigate to Reference via #secondary-nav instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Links to https://www.elastic.co/docs/api/ using the external: <url> syntax. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…oot, Release notes, Extend Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A SiteSectionRef with children now creates a SectionNavigation node in the SiteNavigation tree instead of flattening its children directly under the site root. Key behaviors: - SectionNavigation (e.g. Guides) is marked IsIsland = true with Parent = SiteNavigation, so RendersAsIsland() is true. - Child docset roots (get-started, solutions, etc.) remain individual islands with Parent = SectionNavigation. - FindIslandRoot() from a deep page stops at the child docset root, not the section, so each docset renders its own sidebar tree. - CreateBackLinks emits a '← Guides' back-link because SectionNavigation is the immediate parent of the child island. - URL invariance is preserved: HomeProvider.NavigationRoot = SectionNavigation, and SectionNavigation.Parent is SiteNavigation, so relativeToContainer stays true at every depth. - SectionTopNavBuilder looks up SectionNavigation by title from TopLevelItems and collects child IDs for multi-root active-state matching in the secondary nav bar. Seven new tests cover: tree structure, island flags, FindIslandRoot returns child (not section), back-link breadcrumb, URL invariance, and SectionTopNavBuilder SectionIds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- SiteNavigation: external/empty sections no longer fall through to the SiteTableOfContentsRef cast and throw; they are skipped (SectionTopNavBuilder handles them as tabs with no tree node). - SectionNavigationTests: add using for SectionTopNavBuilder (IDE0002), remove unnecessary ! suppressors (IDE0370), use indexer instead of First() on IReadOnlyList (CA1826). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wrap top-level toc entries in section: nodes matching the island sidebar proposal. Order: Guides, APIs (external), Reference, Troubleshoot, Release notes, Extend. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SectionNavigation is the island; child docsets are branches within it. FindIslandRoot now returns the section, so the sidebar shows all sub-sections (Guides: Get started, Solutions, Manage data, ...). Active-tab detection uses SectionId = sectionNav.Id since all pages within the section have NavigationRoot = sectionNav. Also reverts navigation.yml to main state: only navigation_preview.yml carries the section: structure in this PR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…w.yml All 69 island: true entries dropped by the initial section: rewrite are restored. The OR-semantics override in CreateSiteTableOfContentsNavigation means these entries (Reference sub-docsets) keep their own island sidebars while section children without island: true (Guides) share the section sidebar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
theletterf
force-pushed
the
feature/section-island-sidebars
branch
from
August 14, 2026 13:02
3e9420b to
33e9697
Compare
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.
Summary
Follows up on #3792 to close the sidebar gap:
section:entries withchildren:now become realSectionNavigationtree nodes (islands), giving every page in a grouped set a back-link breadcrumb to the section and preserving URL invariance throughout.Problem: On #3792,
Guidesgroups six toc roots but from any get-started page there is no sidebar path to Solutions or Manage data. The roots are flatly added as direct children ofSiteNavigationand have no shared parent to link back to.Fix: A
section:with children creates aSectionNavigationnode (IRootNavigationItem,IsIsland = true,Parent = SiteNavigation). Child docset roots are nested under it, each still individually marked as islands.Behavior:
FindIslandRoot()from a deep page stops at the child docset root (not the section), so each docset renders its own sidebar tree unchanged.CreateBackLinksemits "← Guides" becauseSectionNavigationis the immediate parent of the child island.SectionTopNavBuildercollects child IDs fromSectionNavigation.NavigationItemsfor multi-root active-state matching in the secondary nav bar.URL invariance:
HomeProvider.NavigationRoot = SectionNavigationandSectionNavigation.Parent is SiteNavigation, sorelativeToContainerstays true at every depth — no page URL moves.Files changed
src/Elastic.Documentation.Navigation/Assembler/SectionNavigation.cssrc/Elastic.Documentation.Navigation/Assembler/SiteNavigation.csSectionNavigationfor sections with children instead of flatteningsrc/services/Elastic.Documentation.Assembler/Navigation/SectionTopNavBuilder.csTopLevelItemstests/Navigation.Tests/Assembler/SectionNavigationTests.csFindIslandRoot, back-link, URL invariance, tabSectionIdsKnown limitation (Phase 2)
The section's
Urlresolves to the first child's URL (e.g./docs/get-started). Clicking "← Guides" navigates back to that page rather than a dedicated Guides landing page. Phase 2 adds a synthetic section landing page that renders the six child roots as stub rows, making the two-click navigation (back-link → stub click → sibling) fully functional.Test plan
dotnet build— zero errors, zero lint warningsSectionNavigationTests: tree structure, island flags,FindIslandRootreturns child not section, "← Guides" back-link present, URL invariance,SectionTopNavBuilderSectionIds correctnavigation_preview.ymlto verify Guides tab active state and back-link renders on get-started pages🤖 Generated with Claude Code