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 :)

@theletterf
Copy link
Contributor

@leemthompo Related? #1838

@Mpdreamz
Copy link
Member

#1559 would add tooltips for all :)

@leemthompo
Copy link
Contributor Author

Not sure what the next steps are on this TBH, haven't had much time to think about this since ON week. Maybe I'll poll the channel in the new year and see if we want to try to merge this ASAP, or if we want a critical mass of descriptions before doing so 🤔

@itsalexcm
Copy link
Contributor

Sorry, I missed this PR. My thoughts, following @colleenmcginnis's curiosity:

I think the idea is interesting as an exploration, but I’m not convinced tooltips are the right pattern for primary navigation.

In navigation, users are usually in a goal-oriented mindset. When they hover an item, they’re not trying to “learn” about it, but deciding whether to click or not. In most cases, they’ll just click and expect the destination page to explain the concept.

Tooltips tend to work better for secondary or supporting UI, where the action isn’t obvious or where clicking is risky or irreversible. Navigation doesn’t usually fall into that category.

More info: Tooltip EUI

@leemthompo
Copy link
Contributor Author

Thanks for chiming in @itsalexcm!

In navigation, users are usually in a goal-oriented mindset. When they hover an item, they’re not trying to “learn” about it, but deciding whether to click or not. In most cases, they’ll just click and expect the destination page to explain the concept.

I'll push back here though, because the whole point of the tooltip is to give some quick visibility into what the page actually contains, to motivate the decision about whether to click or not. If users are "deciding whether to click or not" when hovering, then providing information to help that decision might be useful.

Having to click through multiple pages just to find the right content is frustrating, especially if tooltips could help users navigate more efficiently on the first try.navigation_titles aren't always self-explanatory and the cognitive cost of context-switching between pages is real. Maybe tooltips could reduce that friction.

That said, implementation matters: you'd want them to appear on intentional hover (maybe with a slight delay) rather than aggressive instant tooltips that create noise, plus we do need descriptions that are genuinely helpful in this context.

I'm not sure what the "risk" is, feels like a pretty low-stakes enhancement. We could always ship it as an experiment and see if people actually use them. The feedback would have to be pretty qualitative though, because I don't think it would be easy to get clear telemetry data about stuff like hover times and click throughs that wasn't influenced by tons of other factors.

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.

6 participants