Skip to content

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Mar 11, 2025

cursorful-video-1741906274449.mp4

@Copilot Copilot AI review requested due to automatic review settings March 11, 2025 15:52
@reakaleek reakaleek changed the title PoC: nav selector PoC: nav select Mar 11, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a proof-of-concept for a navigation selector by introducing a new dropdown for selecting documentation sets and reworking navigation rendering. Key changes include:

  • Adding a new TopLevelTree property in NavigationViewModel and using it in RenderNavigation.
  • Updating asset scripts to import htmx as a module and wiring a new event listener on the docset selector.
  • Modifying layout views by replacing the existing header with an external navigation script and adding the new docset selector.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Elastic.Markdown/Slices/HtmlWriter.cs Added TopLevelTree property usage in RenderNavigation for new nav.
src/Elastic.Markdown/Assets/main.ts Updated htmx import and added docset-selector event handling.
src/Elastic.Markdown/Slices/_ViewModels.cs Introduced required TopLevelTree in NavigationViewModel.
docs/_docset.yml Toggled the primary-nav feature flag from false to true.
src/Elastic.Markdown/Slices/Layout/_TocTree.cshtml Replaced anchor navigation with a select dropdown for docset choice.
src/Elastic.Markdown/Slices/Layout/_PagesNav.cshtml Minor UI spacing adjustment.
src/Elastic.Markdown/Slices/Layout/_Header.cshtml Removed the complex header in favor of an external navigation script.
Comments suppressed due to low confidence (1)

src/Elastic.Markdown/Slices/Layout/_Header.cshtml:104

  • Replacing the entire header with an external script may cause issues if the script fails to load. Consider adding a fallback or documenting the expected behavior in such cases.
<div id="elastic-nav"></div>

@reakaleek reakaleek requested a review from a team as a code owner March 13, 2025 22:05
@reakaleek reakaleek requested a review from Copilot March 13, 2025 22:06
@reakaleek reakaleek self-assigned this Mar 13, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a proof-of-concept navigation selector by integrating a new Elastic navigation widget, updating how navigation items are rendered, and aligning configuration and view model properties accordingly.

  • Introduces a new navigation container and script in the header while removing legacy navigation markup.
  • Updates constructors, view models, and YAML configuration to support an “in_nav” flag and adjusted navigation item rendering.
  • Refactors layout partials and grid responsive classes across several Razor views.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Elastic.Markdown/Slices/HtmlWriter.cs Adds TopLevelItems to navigation render method for improved nav selection.
docs/_docset.yml Enables the primary-nav feature.
src/Elastic.Markdown/IO/Navigation/DocumentationGroup.cs Updates constructors to include an inNav flag.
src/Elastic.Markdown/Slices/_ViewModels.cs Introduces TopLevelItems property to support the new navigation.
src/Elastic.Markdown/Assets/main.ts Revises htmx import and removes legacy modifier key logic.
src/Elastic.Markdown/Extensions/IDocsBuilderExtension.cs Reorders interface methods for navigation injection.
src/Elastic.Markdown/IO/Configuration/ConfigurationFile.cs Incorporates the inNav flag when creating FolderReferences.
src/Elastic.Markdown/IO/Configuration/ITocItem.cs Updates FolderReference to include inNav.
src/Elastic.Markdown/IO/DocumentationSet.cs Changes DocumentationGroup instantiation to pass false for inNav.
src/Elastic.Markdown/Extensions/DetectionRules/DetectionRulesDocsBuilderExtension.cs Passes inNav to the DocumentationGroup constructor in CreateNavigationItem.
src/Elastic.Markdown/Slices/Layout/_Header.cshtml Replaces legacy header content with an Elastic navigation container and external script.
src/Elastic.Markdown/Slices/Layout/_PagesNav.cshtml Adjusts responsive classes for improved sidebar behavior.
src/Elastic.Markdown/Slices/Layout/_SecondaryNav.cshtml Updates nav styling and responsiveness, including replacing a hidden block with a reference link.
src/Elastic.Markdown/Slices/Layout/_TableOfContents.cshtml Modifies sidebar width and layout.
src/Elastic.Markdown/Slices/Layout/_TocTree.cshtml Adds a details element for top-level nav items when primary nav is enabled.
src/Elastic.Markdown/Slices/_Layout.cshtml Refines container padding and borders for layout consistency.
src/Elastic.Markdown/Slices/Layout/_LandingPage.cshtml Adjusts spacing and grid column classes for improved responsive layout.

@reakaleek reakaleek changed the title PoC: nav select Add global elastic.co nav Mar 13, 2025
@reakaleek reakaleek enabled auto-merge (squash) March 13, 2025 22:54
@reakaleek reakaleek merged commit 3a563d0 into main Mar 14, 2025
8 checks passed
@reakaleek reakaleek deleted the feature/new-nav branch March 14, 2025 09:42
reakaleek added a commit to elastic/docs-content that referenced this pull request Mar 14, 2025
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.

2 participants