-
Notifications
You must be signed in to change notification settings - Fork 4k
[fix] Do not allow removing already uploaded files when disabled #12180
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 a bug where users could remove already uploaded files from a disabled file uploader widget. The fix ensures that when a file uploader is disabled, the delete buttons for uploaded files are also disabled and non-functional.
- Implements proper disabled state handling for uploaded file deletion
- Adds visual styling to show disabled state for file elements (icons, names, delete buttons)
- Includes comprehensive test coverage for both enabled and disabled deletion scenarios
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
frontend/lib/src/components/widgets/FileUploader/styled-components.ts |
Adds disabled styling for file icons and filenames with faded text colors |
frontend/lib/src/components/widgets/FileUploader/UploadedFiles.tsx |
Passes disabled prop to individual uploaded file components |
frontend/lib/src/components/widgets/FileUploader/UploadedFile.tsx |
Implements disabled state for file components and delete buttons |
frontend/lib/src/components/widgets/FileUploader/UploadedFile.test.tsx |
Updates test props to include disabled parameter |
frontend/lib/src/components/widgets/FileUploader/FileUploader.tsx |
Adds early return in deleteFile method when disabled and passes disabled prop |
frontend/lib/src/components/widgets/FileUploader/FileUploader.test.tsx |
Adds comprehensive tests for disabled and enabled deletion scenarios |
frontend/lib/src/components/widgets/FileUploader/FileDropzone.tsx |
Adds aria-disabled attribute for better accessibility |
frontend/lib/src/components/shared/TextElements/Text.tsx |
Implements disabled styling for Small text component |
frontend/lib/src/components/shared/BaseButton/styled-components.ts |
Adds disabled styling for minimal buttons |
e2e_playwright/st_file_uploader_test.py |
Adds E2E test for visual disabled state after file upload |
e2e_playwright/st_file_uploader.py |
Adds toggle uploader for E2E testing of disabled state |
Describe your changes
st.file_uploaderwas set todisabled=TrueKapture.2025-08-11.at.16.05.44.mp4
GitHub Issue Link (if applicable)
Fixes #12146
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.