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

Skip to content

Conversation

@jrieke
Copy link
Collaborator

@jrieke jrieke commented Jul 20, 2025

Describe your changes

Adapts the design of the disabled state of st.file_uploader and st.audio_input to make it match other widgets. Also makes the cursor "not-allowed" for these two elements when disabled.

This also makes the file uploader have a pointer cursor everywhere, since it can be clicked + changes the height of file uploader to match the one of audio input.

File uploader

Before:
Screenshot 2025-07-20 at 09 21 31@2x

After:
Screenshot 2025-07-24 at 00 26 01

Audio input

Before:
Screenshot 2025-07-20 at 09 21 21@2x

After:
Screenshot 2025-07-20 at 09 20 43@2x

GitHub Issue Link (if applicable)

Testing Plan

  • Updated snapshot tests, which already cover disabled states for both widgets.
  • Note that this PR is changing all file uploader snapshots since I'm using a <span> (with small font size) instead of an actual <small> element for consistency, which slightly changes the sizes/padding (we'll change the design of file uploader very soon anyway, so shouldn't matter).

Contribution License Agreement

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

@snyk-io
Copy link
Contributor

snyk-io bot commented Jul 20, 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 Jul 20, 2025

✅ PR preview is ready!

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

@jrieke jrieke added security-assessment-completed Security assessment has been completed for PR impact:users PR changes affect end users change:bugfix PR contains bug fix implementation labels Jul 20, 2025
@sfc-gh-jrieke sfc-gh-jrieke marked this pull request as ready for review July 20, 2025 15:52
@jrieke jrieke requested a review from Copilot July 20, 2025 16:14

This comment was marked as outdated.

@lukasmasuch lukasmasuch requested a review from Copilot July 23, 2025 16:26
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 PR fixes the design of disabled states for st.file_uploader and st.audio_input widgets to make them consistent with other Streamlit widgets. The changes include updating cursor behavior and color styling for disabled states.

  • Updates file uploader to use "not-allowed" cursor when disabled and "pointer" cursor when enabled
  • Standardizes text color styling for disabled states using theme colors (fadedText40/fadedText60)
  • Replaces HTML <small> element with styled span for consistency

Reviewed Changes

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

Show a summary per file
File Description
frontend/lib/src/components/widgets/FileUploader/styled-components.ts Adds cursor styling and new styled components for text with disabled state support
frontend/lib/src/components/widgets/FileUploader/FileDropzoneInstructions.tsx Updates component to accept disabled prop and use new styled components
frontend/lib/src/components/widgets/FileUploader/FileDropzone.tsx Passes disabled prop to FileDropzoneInstructions component
frontend/lib/src/components/widgets/AudioInput/styled-components.ts Adds disabled prop support and cursor styling for audio input components
frontend/lib/src/components/widgets/AudioInput/AudioInput.tsx Passes disabled prop to styled components

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍 since the height of file uploader has slightly changed with this PR, maybe its a good time to try to get the file uploader height aligned with the audio input & (min) text area size. I think something like ~96px (4.25rem input + label)

@jrieke jrieke enabled auto-merge (squash) July 24, 2025 00:17
@jrieke jrieke merged commit 035014d into develop Jul 24, 2025
38 checks passed
@jrieke jrieke deleted the fix/disabled-states-design branch July 24, 2025 00:30
@jrieke
Copy link
Collaborator Author

jrieke commented Jul 24, 2025

Changed file uploader height and merged.

sfc-gh-bnisco added a commit that referenced this pull request Aug 13, 2025
## Describe your changes

- Fixes a regression introduced in
#11989 by truncating
overflowing text per suggestion from Johannes in
#12189

## GitHub Issue Link (if applicable)

Fixes #12189

## 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.
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.

3 participants