Skip to content

Don't change accordion visibility #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2024
Merged

Don't change accordion visibility #97

merged 2 commits into from
May 9, 2024

Conversation

rkfg
Copy link
Contributor

@rkfg rkfg commented Mar 21, 2024

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.

@mcmonkey4eva mcmonkey4eva merged commit ec5d85c into mcmonkeyprojects:master May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants