-
Notifications
You must be signed in to change notification settings - Fork 33
[ON week experiment] Add tooltips to the nav #2222
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
base: main
Are you sure you want to change the base?
Conversation
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.
🔍 Preview links for changed docs |
|
@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 |
|
I'd also be curious what @itsalexcm thinks of this from a UX perspective. 🙂 |
|
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 ? |
Good question @Mpdreamz, currently it just does nothing if there isn't a A related question is that this introduces a new frontmatter field,
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 :) |
|
@leemthompo Related? #1838 |
|
#1559 would add tooltips for all :) |
|
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 |
|
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 |
|
Thanks for chiming in @itsalexcm!
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. 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 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. |
📹
🤖 Summary
Navigation Tooltips Feature Changes
Implementation Summary
Added
NavigationTooltipproperty across the navigation system to display hover tooltips for navigation items:NavigationTooltipproperty toIDocumentationFileinterfaceModel.NavigationTooltipIndex.NavigationTooltipnullFiles Modified
Core Implementation:
src/Elastic.Markdown/IO/MarkdownFile.cs- Tooltip logic using description from YAML frontmatter, strips markdown and escapes quotessrc/Elastic.Documentation.Navigation/IDocumentationFile.cs- AddedNavigationTooltipproperty to interfaceNavigation Classes (9 files):
src/Elastic.Documentation.Navigation/Assembler/SiteNavigation.cssrc/Elastic.Documentation.Navigation/Isolated/Leaf/CrossLinkNavigationLeaf.cssrc/Elastic.Documentation.Navigation/Isolated/Leaf/FileNavigationLeaf.cssrc/Elastic.Documentation.Navigation/Isolated/Node/DocumentationSetNavigation.cssrc/Elastic.Documentation.Navigation/Isolated/Node/FolderNavigation.cssrc/Elastic.Documentation.Navigation/Isolated/Node/TableOfContentsNavigation.cssrc/Elastic.Documentation.Navigation/Isolated/Node/VirtualFileNavigation.cssrc/Elastic.ApiExplorer/ApiIndexLeafNavigation.csFrontend:
src/Elastic.Documentation.Site/Assets/navigation-tooltip.ts- JavaScript implementationsrc/Elastic.Documentation.Site/Assets/navigation-tooltip.css- Tooltip stylingTests:
tests/Elastic.Markdown.Tests/Inline/ImagePathResolutionTests.cstests/Navigation.Tests/TestDocumentationSetContext.csIntegration
Successfully integrated with the refactored navigation system from main branch after merge conflict resolution.