Run code when sidebar is toggled visible/invisible

The sidebar hamburger toggle is implemented in javascript and so it doesn’t play as nicely as you’re hoping with anvil components.
As far as the flow panel is concerned, it’s on the screen, and toggling the sidebar doesn’t change that.

If you did want to implement such a mechanism, then you’d probably want to use anvil.call inside the standard-form.html javascript code when the toggle functions are executed.

The documentation might help here

Anvil Docs | HTML Forms

Since you probably don’t need it anymore given: Refreshing/resizing plotly plots (reacing to sidebar toggle) - #2
I’ll leave the implementation as a future exercise.