I’ve noticed that this new grafana version set’s the localstorage variable grafana.navigation.docked = true by default. This causes the left-hand-side navigation menu to be docked on dashboard load. Is there a way to set this to false by default?
What I’m expecting: setting this to false by default will cause that menu to not be docked on dashboard load.
What I’ve tried: looked for url parameters to set this variable, could not find one. Also, maybe this can be set by modifying the .ini file?
I’ve also been looking for a way to set grafana.navigation.docked to false by default. Hoping we can get a solution or guidance from the Grafana team here.
You are a life-saver. Detailed instructions which work on my linux server:
Go to the /usr/share/grafana/public/build
Search this.megaMenuDocked with ripgrep: rg this.megaMenuDocked *.js -c. In my case it is in the file 4570.87a4acc6d9144f9ee50a.js.
Make backup copy cp 4570.87a4acc6d9144f9ee50a.js /home/username
Open original js file with text editor, e. g. micro: micro 4570.87a4acc6d9144f9ee50a.js
Find ‘this.megaMenuDocked=’, replace right-hand side (long expression !!(window.innerWidth>=j.$.theme2.breakpoints.values.xl&&ri.A.getBool(Eu,window.innerWidth>=j.$.theme2.breakpoints.values.xxl))) with false
Save the file.
Now the sidebar will be undocked by default as it should be. It is a very unsafe solution, use it at your own risk.
As a side note, the visible by default this huge sidebar is absolutely contrary to what is called “put content first”. I am really interested in the reasons for such a design decision.
Also looking for a “safe” way to make this menu UNDOCKED by default.
About to upgrade our org from 10->11, and during testing this is the first thing everyone is commenting on.
I get it’s not a huge deal to expect users to undock this, but it’s making the upgrade just a little GROSS when it could be seemless
This should be a config setting, and IMHO should be defaulted to UNDOCKED
I observed that there may be some variations around the right-hand side expression to replace, depending on the grafana 11.x version. Here is a one liner (using sed with a regex) linux command to perform the replacement, this is still not a safer solution but can be useful for industrialisation (e.g in a Dockerfile):
find public/build -type f -name "*.js" | xargs sed -i 's/this.megaMenuDocked=\(!!\(.*\)xxl)),\)/this.megaMenuDocked=false,/g'