Please don't add more state that needs to be synced. Panel element has [state property](https://developer.mozilla.org/en-US/docs/XUL/panel#p-state) that can be used to check if panel is hidden or not. I'd suggest to write `isPanelHidden(panel)` function that will use that
to know weather it's hidden or not.