feat: dropdown: section flavor for navigation_preview.yml top nav - #3873
Open
theletterf wants to merge 3 commits into
Open
feat: dropdown: section flavor for navigation_preview.yml top nav#3873theletterf wants to merge 3 commits into
theletterf wants to merge 3 commits into
Conversation
Extends the section: entry shape in navigation_preview.yml with a dropdown:
key that renders a panel of links instead of navigating to a tree section.
Config layer:
- Add SiteDropdownLinkRef record (title + url)
- Extend SiteSectionRef with DropdownLinks property and IsDropdown flag
- Parse dropdown: sequences in SiteTableOfContentsCollectionYamlConverter;
each item is a {title, url} mapping
Builder (SectionTopNavBuilder):
- When IsDropdown, prepend the site prefix to each link URL and emit
a TopNavDropdownItem with a single flat TopNavGroup (null label)
Template (_SecondaryNav.cshtml) and JS (secondary-nav.ts) required no
changes — TopNavDropdownItem rendering and close-on-click behaviour were
already implemented.
navigation_preview.yml: add Products dropdown with four solution links
as a concrete example between the APIs external tab and Reference.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The navigation model may intentionally preserve identical sidebar trees across htmx navigations, so the synthetic should assert the visible target group and only require a fresh DOM node when the tree id changes. Co-Authored-By: GPT-5.5 <noreply@openai.com>
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
dropdown:key to thesection:entry shape innavigation_preview.yml_SecondaryNav.cshtml) and JS (secondary-nav.ts) required no changes —TopNavDropdownItemwas already wired upDemo: https://docs-v3-preview.elastic.dev/elastic/docs-builder/docs/3873
What changed
Config layer (
SiteNavigationFile.cs):SiteDropdownLinkRef(Title, Url)recordSiteSectionRefgainsDropdownLinksandIsDropdownSiteTableOfContentsCollectionYamlConverterparsesdropdown:sequences as{title, url}itemsBuilder (
SectionTopNavBuilder.cs):IsDropdownsections →TopNavDropdownItemwith a single flat group; each URL gets the site prefix prependednavigation_preview.yml: adds aProductsdropdown between APIs and Reference, with four solution links as a concrete exampleTest:
SectionTopNavBuilder_BuildsDropdownTab_WhenDropdownLinksPresentverifies the new path end-to-endTest plan
dotnet test tests/Navigation.Tests/— 225 passed, 0 faileddotnet build— clean for bothElastic.Documentation.ConfigurationandElastic.Documentation.NavigationNAVIGATION_PREVIEW=trueto confirm the Products dropdown renders in the top nav🤖 Generated with Claude Code