Skip to content

fix interactivity #1645

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

Closed
wants to merge 2 commits into from
Closed

fix interactivity #1645

wants to merge 2 commits into from

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Jun 27, 2022

Closes #1569.

Previously there were some issues with interactivity auto-detection. It was actually working as intended for the most part but it was a little confusing. The important factor here was that components needed to have no default_value in order to appear as dynamic. As soon as you gave them a default_value, the logic determined that if they have no inputs or outputs they are static. This makes sense in general but is slightly confusing when developing the application before all events have been hooked up.

This PR is more of a proposal. It essentially means that components which act only as an output will rename static, everything else is dynamic regardless of whether there is a default value. It is less magical but much easier to understand. Most of the time the component will be dynamic, users will always have the interactive=False kwarg for those times when they need to go against the very simple auto behaviour.

@pngwn pngwn requested a review from aliabid94 June 27, 2022 15:40
@aliabid94
Copy link
Collaborator

Hmm I see the point of reducing "magic", but I also think placing a static image as gr.Image("cat.jpg") is quite intuitive. Don't feel strongly either way though, so feel free to merge. Also, feel free to chime in @freddyaboulton if you think one way is more intuituve.

@pngwn
Copy link
Member Author

pngwn commented Jun 28, 2022

Yeah, I agree. Personally I like the autodetection logic. I'll make an alternative PR that tackles any bugs with the current implementation and we can decide which to keep.

@pngwn
Copy link
Member Author

pngwn commented Jul 1, 2022

@aliabid94 Alternative retaining the magic is here: #1685

@pngwn
Copy link
Member Author

pngwn commented Jul 1, 2022

Closing in favour of #1685

@pngwn pngwn closed this Jul 1, 2022
@pngwn pngwn deleted the 1569-interactivity branch July 12, 2022 20:30
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.

Dropdown is disabled when created with blocks
2 participants