Skip to content

Conversation

@leemthompo
Copy link
Contributor

@leemthompo leemthompo commented Nov 17, 2025

  • vibe-coded pre-ON week testeroo
  • probably totally unviable
  • there were some refactoring in docs-builder in meantime and I merged main fixing conflicts as much as possibl
  • just pushing to see what CI says at this point 😄

📹

nav-tooltips

🤖 Summary

Navigation Tooltips Feature Changes

Implementation Summary

Added NavigationTooltip property across the navigation system to display hover tooltips for navigation items:

  • Interface Change: Added NavigationTooltip property to IDocumentationFile interface
  • Implementation Pattern:
    • Leaf nodes: Delegate to their Model.NavigationTooltip
    • Node items: Delegate to their Index.NavigationTooltip
    • Root/container items: Return null

Files Modified

Core Implementation:

  • src/Elastic.Markdown/IO/MarkdownFile.cs - Tooltip logic using description from YAML frontmatter, strips markdown and escapes quotes
  • src/Elastic.Documentation.Navigation/IDocumentationFile.cs - Added NavigationTooltip property to interface

Navigation Classes (9 files):

  • src/Elastic.Documentation.Navigation/Assembler/SiteNavigation.cs
  • src/Elastic.Documentation.Navigation/Isolated/Leaf/CrossLinkNavigationLeaf.cs
  • src/Elastic.Documentation.Navigation/Isolated/Leaf/FileNavigationLeaf.cs
  • src/Elastic.Documentation.Navigation/Isolated/Node/DocumentationSetNavigation.cs
  • src/Elastic.Documentation.Navigation/Isolated/Node/FolderNavigation.cs
  • src/Elastic.Documentation.Navigation/Isolated/Node/TableOfContentsNavigation.cs
  • src/Elastic.Documentation.Navigation/Isolated/Node/VirtualFileNavigation.cs
  • src/Elastic.ApiExplorer/ApiIndexLeafNavigation.cs

Frontend:

  • src/Elastic.Documentation.Site/Assets/navigation-tooltip.ts - JavaScript implementation
  • src/Elastic.Documentation.Site/Assets/navigation-tooltip.css - Tooltip styling

Tests:

  • tests/Elastic.Markdown.Tests/Inline/ImagePathResolutionTests.cs
  • tests/Navigation.Tests/TestDocumentationSetContext.cs

Integration

Successfully integrated with the refactored navigation system from main branch after merge conflict resolution.

leemthompo and others added 6 commits November 3, 2025 09:29
Add a new NavigationTooltip property to the navigation interface and
implement it across all navigation item types. The tooltip automatically
falls back to the description field if no explicit tooltip is provided.

Key changes:
- Add navigation_tooltip field to YAML frontmatter parser
- Add NavigationTooltip property to INavigationItem interface
- Implement NavigationTooltip in MarkdownFile with fallback logic
- Replace double quotes with single quotes to prevent HTML attribute issues
- Strip markdown formatting from tooltip text
- Implement property in all navigation item classes (DocumentationGroup,
  FileNavigationItem, CrossLinkNavigationItem, OperationNavigationItem,
  LandingNavigationItem, ApiGroupingNavigationItem, EndpointNavigationItem)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Implement dynamic viewport-relative tooltip positioning using Tippy.js.
Tooltips appear after a 500ms hover delay and are styled to match the
site's design system with theme support.

Key features:
- Export initNavigationTooltips() for HTMX re-initialization support
- Cleanup logic to destroy previous tooltip instances
- Dynamic positioning to prevent viewport overflow
- Accessibility: aria-label support and keyboard navigation
- Theme-aware styling (light/dark mode)
- Arrow indicator pointing to hovered element

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Resolved merge conflicts:
- MarkdownFile.cs: Kept navigation tooltip fields from feature branch
- Removed old Navigation classes that were refactored in main
Implements NavigationTooltip property across all navigation classes to integrate the tooltip feature with the refactored navigation system from main. Node navigation items delegate tooltips to their Index property, while leaf items get tooltips from their underlying Model.
@github-actions
Copy link

github-actions bot commented Nov 17, 2025

🔍 Preview links for changed docs

Comment on lines +190 to +194
if (!string.IsNullOrEmpty(NavigationTooltip))
{
if (NavigationTooltip.AsSpan().ReplaceSubstitutions(subs, Collector, out var replacement))
NavigationTooltip = replacement;
}
@leemthompo
Copy link
Contributor Author

leemthompo commented Nov 20, 2025

@elastic/docs-engineering if you have any time to gander at this, lemme know if this is anywhere near viable 😄

totally understand if it's not worth the effort to refactor or whatever

@colleenmcginnis
Copy link
Contributor

I'd also be curious what @itsalexcm thinks of this from a UX perspective. 🙂

@Mpdreamz
Copy link
Member

Super neat @leemthompo ! Definitely viable IMO :)

Do we need defaults if its not provided? We might want to back this with querying AI descriptions from our search service if not provided ?

@leemthompo
Copy link
Contributor Author

leemthompo commented Nov 20, 2025

Do we need defaults if its not provided?

Good question @Mpdreamz, currently it just does nothing if there isn't a description field, but I'm not sure if it's acceptable UX to have some pages not render a tooltip, as we gradually add descriptions.

A related question is that this introduces a new frontmatter field, navigation_tooltip which is theoretically more concise than an SEO description, but seeings as it's hard enough to get descriptions everywhere...that might be a step too far. 😄

We might want to back this with querying AI descriptions from our search service if not provided?

I mean if you could do that, that would be amazing, but sounds complex 🚀

One vague ambition with this was that it would be a tangible incentive to adding descriptions to pages :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants