How to disable grafana.navigation.docked localstorage variable by default

Grafana Version: v10.4.0

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?

Thanks in advance for any assistance!

4 Likes

Hello,

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.

1 Like

Would also appreciate an option to disable that by default. it’s annoying.

To solve this I changed

this.megaMenuDocked=!!(window.innerWidth>=j.$.theme2.breakpoints.values.xl&&ri.A.getBool(Eu,window.innerWidth>=j.$.theme2.breakpoints.values.xxl))

to

this.megaMenuDocked=false

in one of .js files in public/build

Also looking for safer solution…

2 Likes

You are a life-saver. Detailed instructions which work on my linux server:

  1. Go to the /usr/share/grafana/public/build
  2. Search this.megaMenuDocked with ripgrep: rg this.megaMenuDocked *.js -c. In my case it is in the file 4570.87a4acc6d9144f9ee50a.js.
  3. Make backup copy cp 4570.87a4acc6d9144f9ee50a.js /home/username
  4. Open original js file with text editor, e. g. micro: micro 4570.87a4acc6d9144f9ee50a.js
  5. 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
  6. 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

1 Like

Hello,

Thanks for the workaround !

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'

Tested for grafana 11.1.4. Hope this helps.