There's no real need to hide the accordion contents based on the checkbox state. I'd like to be able to change the parameters even if the extension is not active to enable it later and have everything already configured (requires fewer clicks this way). It also introduces a bug if this extension is enabled by default from ui-config.json (or when saving the current values as defaults in settings): even though the checkbox is set the contents are not visible until you disable and enable it again. For gr.Dropdown the UI supports a special init_field() callback but it's not called for checkboxes and other controls so we can't properly handle this event and show the accordion (and the regular .change() Gradio handler isn't triggered in this case).
Considering all the above, I believe it's best not to mess with visibility since the accordion component already serves this purpose. It's probably a rudiment from the time when extensions didn't use accordions so indeed hiding them when disabled would save a lot of screen space.
There's no real need to hide the accordion contents based on the checkbox state. I'd like to be able to change the parameters even if the extension is not active to enable it later and have everything already configured (requires fewer clicks this way). It also introduces a bug if this extension is enabled by default from
ui-config.json
(or when saving the current values as defaults in settings): even though the checkbox is set the contents are not visible until you disable and enable it again. Forgr.Dropdown
the UI supports a specialinit_field()
callback but it's not called for checkboxes and other controls so we can't properly handle this event and show the accordion (and the regular.change()
Gradio handler isn't triggered in this case).Considering all the above, I believe it's best not to mess with visibility since the accordion component already serves this purpose. It's probably a rudiment from the time when extensions didn't use accordions so indeed hiding them when disabled would save a lot of screen space.