I'm using the new on_window_command listener in the SyncedSideBar plugin to track sidebar visibility. In the absence of a proper sidebar API, it works fairly well:
https://github.com/sobstel/SyncedSideBa ... 6dfb92c0f3
However the toggle_side_bar command only appears when using the keyboard shortcut to hide and show the sidebar, not when the view -> side bar -> hide/show is used. In fact on_window_command doesn't appear to fire at all when using menu items?