-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Nav Unification - clicking on sections causes UI to "jump" and triggers other sections to close. #46091
Comments
As I may not be able to see this over the line (see p242cR-keI-p2) here's a proposed route forward for whoever picks this up. Original PlanThe key problems are:
We have x3 PRs all try to address the
I would personally go with Following on from that we need to merge whichever approach we take for Note: as #46677 was based on #46676 we'll need to remove those changes first before rebasing. Once that is done, then we need some final external reviews on #46677 in order to merge and deploy. With that done the "jumping" behaviour should be removed (from both unified nav and the current Calypso nav!). Alternative PlanAnother solution was offered by @jsnajdr which is to ignore the He also suggested that we could simplify the whole thing and only include the fixes to the JITMs cache in state and that would solve the problem of rendering. I've tried this by cherry picking a subset of the changes and it does appear that it does resolve the issue without requiring the fixes to |
Update:
Either one of (#46713, #46677) is sufficient to fix the jumpiness, but by merging both we'll fix it and get a small performance boost, too. |
Open a menu section. Then click on another menu section. This will sometimes cause the other menu sections to toggle closed.
For example in the screencapture below:
Pages
is toggled open.Tools
is clicked.Tools
opens andPages
closes. This is not expected.I believe this is due to the sidebar completely re-rendering when the route
path
prop changes. Given thatpath
is passed down the React tree several levels deep any change to this will cause the entire nav to render (including the Site Switcher and Notices).Here's a flamegraph from the React profiler showing the render profile when the
Pages
menu item is clicked.The text was updated successfully, but these errors were encountered: