Skip to content

Fix navigation #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 7, 2025
Merged

Fix navigation #697

merged 2 commits into from
Mar 7, 2025

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Mar 7, 2025

Closes: #692

Result

cursorful-video-1741339063009.mp4

@Copilot Copilot AI review requested due to automatic review settings March 7, 2025 09:15
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.

PR Overview

This PR addresses fixes in navigation by refining how navigation depth is handled and improving AJAX navigation behavior. Key changes include:

  • Renaming variables in the table of contents navigation to clearly differentiate between group and file depth.
  • Adding htmx attributes to primary navigation items to enable dynamic content swapping.
  • Updating styling classes to maintain consistent UI behavior.

Reviewed Changes

File Description
src/Elastic.Markdown/Slices/Layout/_TocTreeNav.cshtml Renamed depth variables and adjusted class conditions for file versus group items.
src/Elastic.Markdown/Slices/Layout/_PrimaryNavDropdownItem.cshtml Added htmx attributes to improve dynamic navigation updates.
src/Elastic.Markdown/Slices/Layout/_PrimaryNav.cshtml Introduced htmx attributes for enhanced AJAX navigation and URL management.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/Elastic.Markdown/Slices/Layout/_TocTreeNav.cshtml:5

  • [nitpick] Consider adding an inline comment to explain the distinction between 'topLevelGroup' and 'topLevelFile', to help future maintainers understand the logic behind different depth levels.
var topLevelGroup = Model.IsRoot ? 1 : 2;

src/Elastic.Markdown/Slices/Layout/_PrimaryNavDropdownItem.cshtml:9

  • Verify that the inline 'onclick' event does not conflict with the newly added htmx attributes, ensuring that the navigation state is updated as intended.
<a onclick="document.getElementById('primary-nav-hamburger').checked = false"

@reakaleek reakaleek self-assigned this Mar 7, 2025
@reakaleek reakaleek added the fix label Mar 7, 2025
@reakaleek reakaleek requested a review from a team March 7, 2025 09:20
@reakaleek reakaleek merged commit f050e84 into main Mar 7, 2025
8 checks passed
@reakaleek reakaleek deleted the feature/fix-navigation branch March 7, 2025 09:42
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.

Solo L1 sidebar entries are styled like they're parented to the previous L1
1 participant