-
Notifications
You must be signed in to change notification settings - Fork 4k
Add support for rerunning app when dialog gets dismissed #12034
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
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
✅ PR preview is ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for rerunning the app when a dialog gets dismissed by the user. It adds an on_dismiss parameter to the dialog decorator that can be set to "rerun" to trigger app reruns or to a callback function for custom dismissal handling.
- Adds
on_dismissparameter to dialog decorator and internal dialog implementation - Integrates dialog dismissal with Streamlit's widget system for state management
- Extends frontend dialog component to send widget events on dismissal
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/streamlit/proto/Block.proto | Adds id field to Dialog message for widget registration |
| lib/streamlit/elements/lib/dialog.py | Implements on_dismiss functionality with widget registration |
| lib/streamlit/elements/layouts.py | Passes on_dismiss parameter to dialog creation |
| lib/streamlit/elements/dialog_decorator.py | Adds on_dismiss parameter to dialog decorator API |
| frontend/lib/src/components/elements/Dialog/Dialog.tsx | Implements frontend dismissal handling with widget events |
| frontend/lib/src/components/core/Block/Block.tsx | Passes widget manager and fragment ID to Dialog component |
| lib/tests/streamlit/elements/layouts_test.py | Adds unit tests for on_dismiss functionality |
| frontend/lib/src/components/elements/Dialog/Dialog.test.tsx | Adds frontend tests for dismissal behavior |
| e2e_playwright/st_dialog.py | Adds test app for on_dismiss functionality |
| e2e_playwright/st_dialog_test.py | Adds end-to-end tests for dialog dismissal |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.
Describe your changes
Implements support for rerunning the app when the dialog gets dismissed by the user. This can be activated via
on_dismiss="rerun" or callback.GitHub Issue Link (if applicable)
st.dialogby clicking on X or pressing Escape #8507Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.