Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sfc-gh-bnisco
Copy link
Collaborator

Describe your changes

  • Fixes an issue where st.fragment re-runs would cause st.{balloons,snow} to show up again.

GitHub Issue Link (if applicable)

Fixes #10961

Testing Plan

  • ✅ Adds e2e tests

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@sfc-gh-bnisco sfc-gh-bnisco added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Apr 2, 2025
@snyk-io
Copy link
Contributor

snyk-io bot commented Apr 2, 2025

🎉 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)

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-11015/streamlit-1.44.1-py3-none-any.whl
🕹️ Preview app pr-11015.streamlit.app (☁️ Deploy here if not accessible)

Copy link
Contributor

Copilot AI left a 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 pull request fixes the issue where re-runs in st.fragment caused st.balloons and st.snow to reappear unexpectedly. The changes update the ElementNodeRenderer to pass the scriptRunId from node instead of props and add comprehensive end-to-end tests (for both snow and balloons) along with shared animation utilities to verify the correct behavior.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/lib/src/components/core/Block/ElementNodeRenderer.tsx Updates the scriptRunId prop passed to Balloons and Snow components to use node.scriptRunId for proper fragment interaction.
e2e_playwright/st_snow_with_fragment_interactions_test.py Adds tests to verify that st.snow behaves as expected with fragment re-runs and full page re-runs.
e2e_playwright/st_snow_with_fragment_interactions.py Defines a test component triggering st.snow through a fragment to support the new behavior.
e2e_playwright/st_balloons_with_fragment_interactions_test.py Adds tests to confirm that st.balloons does not reappear after fragment re-runs and reappears on full page re-run.
e2e_playwright/st_balloons_with_fragment_interactions.py Defines a test component triggering st.balloons through a fragment to support the new behavior.
e2e_playwright/shared/animation_utils.py Provides shared utilities for validating the onscreen/offscreen state of animations for use in the tests.

@sfc-gh-bnisco sfc-gh-bnisco marked this pull request as ready for review April 3, 2025 17:26
Copy link
Contributor

@sfc-gh-pchiu sfc-gh-pchiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG!

@sfc-gh-bnisco sfc-gh-bnisco merged commit a3cbea2 into develop Apr 4, 2025
33 checks passed
@sfc-gh-bnisco sfc-gh-bnisco deleted the bnisco/fix-10961 branch April 4, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

st.fragment on one function causing st.balloons to fly when another widget is changed

4 participants