-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Ad/persistent menu mouseover #35566
base: master
Are you sure you want to change the base?
Ad/persistent menu mouseover #35566
Conversation
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.
One other thing I noticed in the screen shot is that the content of the menu wraps while it is shrinking. I think it would look better if the number of lines does not change during the transition. But I am not sure how hard that would be.
@@ -121,6 +121,7 @@ hqDefine("cloudcare/js/formplayer/apps/views", [ | |||
|
|||
initialize: function (options) { | |||
this.shouldShowIncompleteForms = options.shouldShowIncompleteForms; | |||
sessionStorage.removeItem('handledDefaultClosed'); |
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.
Does this mean if you reload the page the setting will be lost?
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.
If you lock the nav menu open, you can reload the page and the menu will stay open. The nav menu will stay expanded until you unlock it or navigate out of the app to the home menu.
persistentMenuContainer.addClass('position-relative'); | ||
sessionStorage.showPersistentMenu = true; | ||
}, | ||
deLockMenu: function () { |
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.
unlock?
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.
agreed
af38e12
fetchPersistantMenuRegionWidth: function () { | ||
let persistantMenuRegionWidth = sessionStorage.getItem('persistantMenuRegionWidth'); | ||
if (!persistantMenuRegionWidth) { | ||
persistantMenuRegionWidth = this.setPersistantMenuRegionWidth(); |
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.
to me sessionStorage.setItem('persistantMenuRegionWidth', regionWidth);
belongs in the if block here.
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.
In that case setPersistantMenuRegionWidth
would just do the calculation and I'd rename it to something like calcPersistantMenuRegionWidth
and maybe rename the fetchPersistantMenuRegionWidth
to setPersistantMenuRegionWidth
. That sounds good if that's what you're thinking.
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.
went with calcPersistantMenuRegionWidth
and getPersistantMenuRegionWidth
705e266
I agree with this. I'm not sure about how hard it would be either, but I'll give it a go. ...turns out it was incredibly easy 5c682d3 |
af38e12
to
705e266
Compare
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.
Very nice change, the animation is great! Nit if it's easy to implement - what do you thinking about not having the "opening" animation during navigation if the sidebar is already persistently opened?
Product Description
This makes it so that the persistent nav sidebar pops open as an overlay when the user hovers over the collapsed menu.
The menu can be locked open which will do two things.
1: it will fit the nav menu inline with the other elements on the page (no longer an overlay).
2: the nav menu will continue to be expanded as the user navigates between menus.
Technical Summary
Jira ticket for mouseover
In order to have have a transition for the expanding and collapsing you need to know the width the menu will be when expanded. To accomplish this
setPersistantMenuRegionWidth
sets up invisible clones of the elements that make up the nav menu and stores that value insessionStorage
so that it only needs to be calculated once per session. The value,persistantMenuRegionWidth
, is reset when the page is initialized.I looked at the possibility of using a css calc to determine the width, but I don't think that will work. The width will depend on the text content of the menu and the elements need to be appended to the DOM in order to get the correct width.
I'm pretty happy with the current approach, but open to other suggestions.
Jira ticket for defaulting nav menu to closed when split screen case search is on.
Feature Flag
persistent_menu_setting
Safety Assurance
Safety story
tested locally and on staging
changes are limited to this feature flag and the only risk I can see is undesirable ui on the persistent men nav bar.
Automated test coverage
QA Plan
no QA planned
Rollback instructions
Labels & Review