Skip to content

Conversation

@sfc-gh-nbellante
Copy link
Contributor

@sfc-gh-nbellante sfc-gh-nbellante commented Jan 10, 2026

Describe your changes

This PR make the X button colors adhere to the designs in Figma.

Screenshot or video (only for visual changes)

Updated snapshots for file chips in various states (archive, audio, code, pdf, spreadsheet, text, video, unknown) across different browsers (Chromium, Firefox, WebKit) and themes (light, dark).

Testing Plan

  • No additional tests needed as this is a visual change only
  • The existing E2E tests with visual snapshots have been updated to reflect the new styling
  • The functionality remains unchanged, only the appearance of the delete button has been modified

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 Jan 10, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13554/streamlit-1.52.2-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13554.streamlit.app (☁️ Deploy here if not accessible)

Copy link
Contributor Author

sfc-gh-nbellante commented Jan 10, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

📉 Frontend coverage change detected

The frontend unit test (vitest) coverage has decreased by 0.0000%

  • Current PR: 86.5900% (12826 lines, 1719 missed)
  • Latest develop: 86.5900% (12826 lines, 1719 missed)

✅ Coverage change is within normal range.

📊 View detailed coverage comparison

@sfc-gh-nbellante sfc-gh-nbellante added security-assessment-completed Security assessment has been completed for PR change:chore PR contains maintenance or housekeeping change impact:users PR changes affect end users labels Jan 10, 2026
@sfc-gh-nbellante sfc-gh-nbellante changed the title fix: update file chip X button colors [fix] Improve chat input file delete button color for error states Jan 10, 2026
@sfc-gh-nbellante sfc-gh-nbellante changed the title [fix] Improve chat input file delete button color for error states [fix] Improve chat input file delete button color Jan 11, 2026
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the fixit/file-chip-x-button-colors-v3 branch from 7495da7 to dc0fc19 Compare January 11, 2026 19:32
@sfc-gh-nbellante sfc-gh-nbellante changed the title [fix] Improve chat input file delete button color [fix] Improve chat input file delete button colors Jan 11, 2026
@sfc-gh-nbellante sfc-gh-nbellante added the ai-review If applied to PR or issue will run AI review workflow label Jan 12, 2026
@github-actions github-actions bot removed the ai-review If applied to PR or issue will run AI review workflow label Jan 12, 2026
@github-actions
Copy link
Contributor

Summary

This PR improves the visual appearance of the delete button (X button) on file chips in the chat input component by updating color values to match Figma designs. The changes include:

  1. Adding an isError prop to StyledChatUploadedFileDeleteButton to support error state-specific coloring
  2. Updating default button colors from fadedText20 to fadedText60 (improving visibility)
  3. Updating hover colors from fadedText40 to bodyText (better contrast on hover)
  4. Adding error state colors: redTextColor for default and red70 for hover
  5. Updating all related E2E visual snapshots across browsers (Chromium, Firefox, WebKit) and themes (light, dark)

Code Quality

The code quality is excellent and follows Streamlit's frontend conventions:

ChatUploadedFile.tsx (lines 168-171)

  • The isError prop is correctly passed to the styled component
  • The existing isError variable derived from statusType === "error" is reused appropriately

styled-components.ts (lines 150-188)

  • The new StyledChatUploadedFileDeleteButtonProps interface follows TypeScript best practices with optional isError prop
  • The styled component correctly uses Emotion's object syntax with theme values
  • All color values are properly derived from the theme (no hardcoded values), complying with the streamlit-custom/no-hardcoded-theme-values ESLint rule
  • The ternary color logic is clear and readable: color: isError ? theme.colors.redTextColor : theme.colors.fadedText60

Theme Color Choices:

  • fadedText60 (40% transparency) provides better visibility than the previous fadedText20 (70% transparency)
  • bodyText on hover ensures strong contrast for the interactive state
  • redTextColor and red70 are appropriate semantic colors for error states

Test Coverage

Unit Tests (ChatUploadedFile.test.tsx):

  • Existing unit tests adequately cover the functional aspects of the delete button including:
    • Aria-labels for different states (uploaded, uploading)
    • Click handler invocation
    • Error state accessibility
  • No new unit tests are needed since this is a visual-only CSS change with no behavioral changes

E2E Tests (st_chat_input_test.py):

  • All visual snapshot tests have been updated across all three browsers (Chromium, Firefox, WebKit)
  • Coverage includes:
    • Normal file upload state (light/dark themes)
    • Error state (light/dark themes)
    • Multiple file types (pdf, spreadsheet, text, code, audio, video, archive, unknown, truncated)
    • File chip theming variations
  • The E2E tests follow best practices:
    • Use expect for auto-wait assertions
    • Use stable locators (get_by_test_id)
    • Include appropriate snapshot names following the st_command-test_description convention

Backwards Compatibility

This change is fully backwards compatible:

  • No API changes to props or component interfaces
  • No changes to HTML structure or test IDs
  • The visual change is purely cosmetic (improved contrast/visibility)
  • Users will not need to modify any code

Security & Risk

  • No security concerns: This is a CSS-only visual change
  • Low regression risk: Colors are derived from the existing theme system
  • Accessibility improvement: The change from fadedText20 to fadedText60 improves button visibility and contrast, which is beneficial for users with visual impairments

Recommendations

No changes are required. The PR is well-implemented and follows all Streamlit coding conventions.

Optional consideration (not blocking):

  1. If desired for completeness, a unit test could be added to verify the isError prop is passed to the styled component, but this is not strictly necessary since the visual snapshots already verify the correct rendering.

Verdict

APPROVED: This is a clean, well-implemented visual improvement that follows Streamlit's coding conventions, uses proper theme values, and has appropriate E2E snapshot coverage. The changes improve button visibility and accessibility without any breaking changes.


This is an automated AI review. Please verify the feedback and use your judgment.

@sfc-gh-nbellante sfc-gh-nbellante marked this pull request as ready for review January 12, 2026 00:32
Copilot AI review requested due to automatic review settings January 12, 2026 00:32
@sfc-gh-nbellante sfc-gh-nbellante changed the title [fix] Improve chat input file delete button colors [fix] Improve st.chat_input file delete button colors Jan 12, 2026
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 improves the visual styling of the delete button (X icon) on file chips in the chat input component to match Figma designs. The change updates the button colors for both normal and error states.

Changes:

  • Updated delete button colors from fadedText20/fadedText40 to fadedText60/bodyText for normal state
  • Updated delete button colors to use redTextColor/redColor for error state
  • Added isError prop to the delete button styled component to enable conditional styling
  • Updated E2E test snapshots across all browsers and themes to reflect the new visual appearance

Reviewed changes

Copilot reviewed 2 out of 50 changed files in this pull request and generated 1 comment.

File Description
frontend/lib/src/components/widgets/ChatInput/fileUpload/styled-components.ts Added isError prop and conditional color styling for delete button
frontend/lib/src/components/widgets/ChatInput/fileUpload/ChatUploadedFile.tsx Passed isError prop to delete button component
E2E snapshot files (multiple) Updated visual regression test snapshots for all browsers and themes

})
)

/* eslint-disable streamlit-custom/no-hardcoded-theme-values */
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

Definition for rule 'streamlit-custom/no-hardcoded-theme-values' was not found.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

sfc-gh-nbellante commented Jan 12, 2026

Merge activity

  • Jan 12, 4:27 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 12, 4:27 PM UTC: @sfc-gh-nbellante merged this pull request with Graphite.

@sfc-gh-nbellante sfc-gh-nbellante merged commit b0643f3 into develop Jan 12, 2026
51 checks passed
@sfc-gh-nbellante sfc-gh-nbellante deleted the fixit/file-chip-x-button-colors-v3 branch January 12, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:chore PR contains maintenance or housekeeping change 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