Don't change accordion visibility #97
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.