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

Skip to content

Conversation

@sfc-gh-bnisco
Copy link
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco commented Aug 11, 2025

Describe your changes

  • Fixes an issue where users could remove already uploaded files if an instance of st.file_uploader was set to disabled=True
  • Aligns the UI of the disabled states to other disabled affordances across the app
Kapture.2025-08-11.at.16.05.44.mp4

GitHub Issue Link (if applicable)

Fixes #12146

Testing Plan

  • ✅ Unit Tests (JS and/or Python)
  • ✅ 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.

@sfc-gh-bnisco sfc-gh-bnisco added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Aug 11, 2025
@sfc-gh-bnisco sfc-gh-bnisco requested a review from Copilot August 11, 2025 23:21
@snyk-io
Copy link
Contributor

snyk-io bot commented Aug 11, 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 Aug 11, 2025

✅ PR preview is ready!

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

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

@sfc-gh-bnisco sfc-gh-bnisco marked this pull request as ready for review August 11, 2025 23:52
@sfc-gh-bnisco sfc-gh-bnisco merged commit 8a4ce9a into develop Aug 12, 2025
37 checks passed
@sfc-gh-bnisco sfc-gh-bnisco deleted the bnisco/fix-12146 branch August 12, 2025 15:43
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.

file_uploader allows to remove files despite disabled = True

4 participants