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
Navbar UI Link Color and Functionality Updates #5178
Conversation
@bradh11 - take a look at this PR and see if you think it would improve your saved navbar state feature from #5146 This uses sessionStorage instead of localStorage which will clear if the tab closes (e.g. a user closes the tab, opens their Nautobot home bookmark later in the day -> the navbar will be reset instead of restoring the state from the previous session). I also added a reset navbar function that clears the storage when someone goes back to the home page, restoring the navbar back to the original state. |
I like the updates on the dropdown arrow and likewise to the reset on clicking home. That was something I had thought about after #5146 merged. Nice to see you put that in here! On the topic of session storage vs local storage for state mgmt -> I had considered that implementation but was thinking the likelihood of closing the page and coming back and expecting the dropdowns and scroll position to be exactly where you left off would be pretty low. I don't think it would be negative for that behavior to occur, but I also don't think it would be expected by the user. That being stated - I believe more permanent storage for state might really shine with regards to the home page panels. @matt852 and I were discussing this just yesterday. I think a case could be made to even have a db table tracking that. |
Also, keep an eye on #5172 as it is introducing collapse capable sidebar. There may be some potential merge conflicts so we should coordinate updates accordingly. |
@DistantVoyager , what do you think about having the menu dropdown caret arrrows point left by default and down when expanded? It might “feel” more natural in that it will give the appearance of “unfurling” the menu. |
@bradh11 With Example with User closes the Nautobot tab or window. User then goes to Nautobot at some later point, but the navbar state is unexpectedly restored/kept from prior visit: The change from Example with User closes the Nautobot tab or window. User then goes to Nautobot at some later point, and the navbar state is normal, as expected: Let me know if that makes sense! |
Yes. Makes much more sense now. Fully support this approach and change. I thought it was the opposite scenario - thanks for taking the time to explain. |
@bradh11 - how about this? Before: After: I don't really have a preference one way or the other. I've seen both caret types for dropdown elements. Not sure I'd have them point left, as I feel it looks a bit odd: |
I like the point right for collapsed, point down for expanded options. This is looking really nice btw! |
This is my preference as well after seeing screenshots. Looking good. 👍 |
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
// Add click event listeners to dropdown links | ||
addLinkClickListeners(); | ||
|
||
// Apply the 'active' class to the previously clicked link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
Got some feedback from @lampwins on this today.
Cloud menu open: Cloud menu closed:
.navbar-fixed-left .navbar-nav > .dropdown > .nav-dropdown-menu > li > a:hover {
transition: background-color 200ms ease;
background-color: #cdf3ff1a
} |
Updated - I changed the dropdown icon and the link style on hover and click to match that of Nautobot Cloud. |
This looks awesome! Thanks @DistantVoyager |
Closes #5177
What's Changed
Screenshots
Before:
After:
TODO