Skip to content

Preserve value in reload mode #11421

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Preserve value in reload mode #11421

wants to merge 3 commits into from

Conversation

aliabid94
Copy link
Collaborator

@aliabid94 aliabid94 commented Jun 19, 2025

We had a regression where values of compnents were not preserved in reload mode, so when you edited the source file, values would be reset to empty. This is fixed.

Previously, state was not preserved in reload mode either, a separate bug. Also fixed.

Fixes: #8855
Fixes: #8641

@aliabid94 aliabid94 requested a review from abidlabs June 19, 2025 23:56
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 19, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detecting...

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/373a603c1a9b02fc1c79d7118d7e8f75b74a6182/gradio-5.34.2-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@373a603c1a9b02fc1c79d7118d7e8f75b74a6182#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/373a603c1a9b02fc1c79d7118d7e8f75b74a6182/gradio-client-1.15.3.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/373a603c1a9b02fc1c79d7118d7e8f75b74a6182/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 19, 2025

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/client patch
@gradio/core patch
@self/app patch
@self/spa patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Preserve value in reload mode

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@abidlabs
Copy link
Member

Nice @aliabid94! Is it possible to add a test for this? We have e2e tests that specifically test reload mode but we seem to still get lots of regressions around it...

@abidlabs
Copy link
Member

Otherwise, works great nice fix!

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.

Reload mode should preserve states Reload mode should preserve the selected tab
3 participants