So I am trying to write a plugin that toggles the visibility of the sidebar, the favourites panel and the notes list at the same time.. Sometimes I like to have just one big notes editor window visible only.

I've kind of succeeded, but whenever I make everything invisible, and then toggle it back to visibility, the layout gets reset. Anyone know how to fix this?

Here is my very simple code:

joplin.plugins.register({
	onStart: async function() {
        
		await joplin.views.toolbarButtons.create('toggleCustomButton', 'toggleCustom', 'noteToolbar');
		

        await joplin.commands.register({
            name: 'toggleCustom',
            label: 'Custom Toggle',
            iconName: 'fas fa-bullseye',
            execute: async () => {
				
				await joplin.commands.execute('toggleNoteList');
				await joplin.commands.execute('toggleSideBar');
				await joplin.commands.execute('favsToggleVisibility');



			}
        })
    },
});

This is what it looks like before toggling when everything is visible:

image

And then if I toggle them all invisible, and visible again, the panel height is reset:

Anyone got any ideas if this can be fixed through code or CSS?