Add support for fixed tooltips and fix status widget tooltip bug#3576
Add support for fixed tooltips and fix status widget tooltip bug#3576
Conversation
Test results 27 files 27 suites 45m 10s ⏱️ Results for commit 2f79324. ♻️ This comment has been updated with latest results. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3576 +/- ##
==========================================
+ Coverage 62.20% 62.21% +0.01%
==========================================
Files 611 611
Lines 44939 44939
Branches 43 43
==========================================
+ Hits 27955 27960 +5
+ Misses 16974 16969 -5
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b44e609 to
6bead60
Compare
6bead60 to
a07aea7
Compare
johannaengland
left a comment
There was a problem hiding this comment.
In the locations and the organizations tooltips there is a difference on how they are positioned:
Before:

I do think it is much easier to navigate with the tooltip flowing to the right of the entries
And for the status widget I was able to produce this:

Here I would assume that the triangle should move down
|
@johannaengland I made some changes (fixups):
|
2f79324 to
005b072
Compare
|




Scope and purpose
Fixes #3301.
The bug described in #3301 has been reported multiple times by users, and while fixing it I discovered that the tooltips were not rendering at all. This was due to a
delegate_tooltipplugin which still used Foundation. In addition, thedelegate_tooltipplugin fetched data with javascript and rendered the returned content. I changed the data fetching to use an htmx call with amouseover oncehx-trigger, which only runs the first time a tooltip trigger is hovered.When refactoring to use a nav tooltip, I discovered that the tooltip caused layout shifts inside the navlet. This is because the container is quite small, and has automatic scroll bars. In order to fix it I had to add support for fixed position tooltips. When
.nav-tooltipis annotated withdata-position="fixed", the tooltip is automatically positioned below the trigger element, but without affecting the flow of the page.This pull request
tree_list.htmltemplate in SeedDb tooldelegate_tooltippluginHow to test
The tree list changes can be verified on the Seed database: Locations and Seed database: Organizations pages.
Testing the fix in the Status2 widget is a bit more involved. A full description of the bug can be found in #3301, but personally I followed this procedure:
Netboxwith interfaces to add an event to, and get the id of an interface.AlertHistoryentry, with the following values:eventtypeid='linkState'is required for the interface tooltip to render, andalerttypeid=27refers to thelinkDownalert.subid(Interface id) and changingevent_type_idandalert_type_id.Screenshots
All before screenshots are from the "5.14.x" branch.
Contributor Checklist
Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.
<major>.<minor>.x). For a new feature or other additions, it should be based onmaster.