-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix design of disabled states #11989
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 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 |
lukasmasuch
left a comment
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.
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)
|
Changed file uploader height and merged. |
## 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.
Describe your changes
Adapts the design of the disabled state of
st.file_uploaderandst.audio_inputto 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:

After:

Audio input
Before:

After:

GitHub Issue Link (if applicable)
Testing Plan
<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.