Skip to content

Conversation

@freddyaboulton
Copy link
Collaborator

Description

Closes: #12573

AI Disclosure

We encourage the use of AI tooling in creating PRs, but the any non-trivial use of AI needs be disclosed. E.g. if you used Claude to write a first draft, you should mention that. Trivial tab-completion doesn't need to be disclosed. You should self-review all PRs, especially if they were generated with AI.

  • I used AI to... [fill here]
  • I did not use AI

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Testing and Formatting Your Code

  1. PRs will only be merged if tests pass on CI. We recommend at least running the backend tests locally, please set up your Gradio environment locally and run the backed tests: bash scripts/run_backend_tests.sh

  2. Please run these bash scripts to automatically format your code: bash scripts/format_backend.sh, and (if you made any changes to non-Python files) bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Dec 17, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/5ce0c4fa925bda75eca48430dac70de5505c501a/gradio-6.1.0-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/5ce0c4fa925bda75eca48430dac70de5505c501a/gradio-client-2.0.0.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Dec 17, 2025

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/audio patch
@gradio/image patch
gradio patch

  • Fix image buttons default value

✅ Changeset approved by @freddyaboulton

  • Maintainers can remove approval by unchecking this checkbox.

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.

@freddyaboulton freddyaboulton marked this pull request as ready for review December 17, 2025 15:46
$: buttons_to_render =
buttons && buttons.length > 0 ? buttons : ["download", "share"];
buttons && typeof buttons === "object" ? buttons : ["download", "share"];
Copy link
Member

Choose a reason for hiding this comment

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

As part of #12539, I made it so that the "buttons" prop returned from the frontend is always a list (for the Audio component, the default returned list is ["download", "share"]). So this kind of logic should no longer be needed, you can just render the set of buttons in buttons directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will fix!

Copy link
Collaborator

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

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

Can confirm buttons=[] works!
In the original issue, OP wanted buttons=None to hide the buttons, but that is not the current behaviour (buttons=None shows default buttons). Would be worth clarifying in the issue.

@freddyaboulton
Copy link
Collaborator Author

Thank you for the reviews @abidlabs @aliabid94 !

@freddyaboulton freddyaboulton merged commit 7498fac into main Dec 17, 2025
20 of 21 checks passed
@freddyaboulton freddyaboulton deleted the 12573-image-buttons branch December 17, 2025 21:09
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.

unable to remove the buttons (download, share, fullscreen) from an image block

5 participants