Skip to content

Conversation

@sfc-gh-nbellante
Copy link
Contributor

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

Describe your changes

Fixed a CSS property typo in the Icon component's styled components. Changed justifyContents to the correct property name justifyContent in several places.

Screenshot or video (only for visual changes)

See snaps.

Testing Plan

  • No additional tests are needed as this is a simple typo fix for a CSS property name
  • The existing tests should continue to pass
  • Manual testing: verify that icons still display correctly with proper centering

Follow Up

  • Add linting that prevents invalid css properties from being used.

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 11, 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 11, 2026

✅ PR preview is ready!

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

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sfc-gh-nbellante sfc-gh-nbellante 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 Jan 11, 2026
@sfc-gh-nbellante sfc-gh-nbellante changed the title fix: correct justifyContents typo to justifyContent in Icon styles [fix] Correct justifyContents to justifyContent in Icon styled-components Jan 11, 2026
@sfc-gh-nbellante sfc-gh-nbellante marked this pull request as ready for review January 11, 2026 19:08
Copilot AI review requested due to automatic review settings January 11, 2026 19:09
@sfc-gh-nbellante sfc-gh-nbellante added the ai-review If applied to PR or issue will run AI review workflow label Jan 11, 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 pull request fixes a CSS property typo in Icon styled-components, changing justifyContents (incorrect) to justifyContent (correct) in three styled component definitions. The PR description states this is a bug fix that shouldn't change visual appearance, though E2E test snapshots were updated.

Changes:

  • Fixed CSS property name from justifyContents to justifyContent in StyledSpinnerIcon, StyledIcon, and StyledDynamicIcon
  • Updated E2E test snapshots for toast and status components across different themes and browsers

Reviewed changes

Copilot reviewed 1 out of 193 changed files in this pull request and generated no comments.

File Description
frontend/lib/src/components/shared/Icon/styled-components.ts Corrected justifyContents to justifyContent in three styled components (lines 46, 74, 96)
E2E snapshot files (various .png) Updated visual regression test snapshots for toast and status components

@github-actions github-actions bot removed the ai-review If applied to PR or issue will run AI review workflow label Jan 11, 2026
@github-actions
Copy link
Contributor

Summary

This PR fixes a CSS property typo in the Icon component's styled components, changing the invalid justifyContents to the correct property name justifyContent. The fix is applied to three styled components: StyledSpinnerIcon, StyledIcon, and StyledDynamicIcon. The PR also includes updated e2e test snapshots reflecting the visual changes from this fix.

Code Quality

The code change itself is correct - justifyContent is the valid CSS property (part of Flexbox) while justifyContents is invalid and was being silently ignored by browsers.

However, there is a critical issue: The fix is incomplete. The same typo exists in two additional locations that were NOT fixed:

  1. frontend/lib/src/components/shared/Icon/styled-components.ts line 126 - StyledEmojiIcon component:
justifyContents: "center",  // Still has the typo!
  1. frontend/lib/src/components/shared/Icon/Material/styled-components.ts line 33 - StyledMaterialIcon component:
justifyContents: "center",  // Also has the typo!

These missed instances mean emoji icons and Material icons will still have improper centering behavior while other icon types will be fixed, creating inconsistent behavior across the icon system.

Test Coverage

  • E2E Snapshots: The PR includes appropriate snapshot updates for existing e2e tests, which is the correct approach for visual CSS fixes.
  • Unit Tests: There is one existing test file (DynamicIcon.test.tsx) that tests basic rendering but doesn't specifically test CSS styles. For a typo fix of this nature, the e2e snapshot coverage is sufficient.
  • Coverage Assessment: The existing test coverage adequately validates that the fix doesn't introduce visual regressions for the fixed components. However, since the fix is incomplete, tests for emoji and Material icons won't catch the unfixed bug.

Backwards Compatibility

  • No Breaking Changes: This is a bug fix that improves behavior. Icons will now be properly centered using the correct CSS property.
  • Visual Changes Expected: Since justifyContent was previously being ignored (as justifyContents is invalid), fixing this may cause minor visual alignment changes. The snapshot updates confirm the visuals are acceptable.

Security & Risk

  • No Security Concerns: This is a purely cosmetic CSS fix with no security implications.
  • Low Regression Risk: The change is minimal and the e2e snapshots provide safety against visual regressions.

Recommendations

  1. [CRITICAL] Fix the remaining typos: Before merging, please also fix justifyContentsjustifyContent in:

    • frontend/lib/src/components/shared/Icon/styled-components.ts line 126 (StyledEmojiIcon)
    • frontend/lib/src/components/shared/Icon/Material/styled-components.ts line 33 (StyledMaterialIcon)
  2. Update snapshots: After fixing the additional typos, update any affected e2e snapshots for emoji icons and Material icons.

  3. Consider a repo-wide search: Run a search for justifyContents across the entire codebase to ensure there are no other instances of this typo.

Verdict

CHANGES REQUESTED: The fix is correct but incomplete - there are 2 additional instances of the same typo in StyledEmojiIcon and StyledMaterialIcon that must also be fixed for consistency across the icon system.


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

@github-actions github-actions bot added the do-not-merge PR is blocked from merging label Jan 11, 2026
Fixed a typo in three styled components (StyledSpinnerIcon, StyledIcon,
StyledDynamicIcon) where 'justifyContents' was used instead of the valid
CSS property 'justifyContent'. This fixes centering issues for icons
including the upload spinner.
@sfc-gh-nbellante sfc-gh-nbellante added the ai-review If applied to PR or issue will run AI review workflow label Jan 11, 2026
@github-actions github-actions bot removed the ai-review If applied to PR or issue will run AI review workflow label Jan 11, 2026
@github-actions
Copy link
Contributor

Summary

This PR fixes a CSS typo in the Icon component's styled-components, correcting justifyContents (invalid CSS property) to justifyContent (valid CSS flex property) in 5 locations across 2 files:

  1. frontend/lib/src/components/shared/Icon/styled-components.ts - 4 fixes in:

    • StyledSpinnerIcon (line 46)
    • StyledIcon (line 74)
    • StyledDynamicIcon (line 96)
    • StyledEmojiIcon (line 126)
  2. frontend/lib/src/components/shared/Icon/Material/styled-components.ts - 1 fix in:

    • StyledMaterialIcon (line 33)

The PR also includes 196 snapshot updates that reflect the visual improvements from properly centering icons.

Code Quality

Assessment: Excellent

The code changes are minimal, focused, and correct:

  • The typo fix is straightforward - changing an invalid CSS property name to the correct one
  • No unnecessary changes or refactoring included
  • Follows existing code style and patterns
  • All instances of the typo have been fixed (verified via grep - no remaining justifyContents in the codebase)

The commit messages are descriptive and follow good practices, clearly explaining what was fixed and why.

Test Coverage

Assessment: Adequate

  • Visual verification: The 196 updated E2E snapshots serve as visual regression tests, confirming that the CSS fix has the intended effect on icon centering. The snapshots cover:

    • Alert icons
    • Button icons (emoji)
    • Download button icons
    • Page link icons (sidebar, hover states)
    • Navigation icons
    • Toast notifications
  • Unit tests: The existing DynamicIcon.test.tsx tests render the icon components but don't specifically test CSS styling properties. This is acceptable because:

    1. Unit testing CSS property values is not a best practice - it tests implementation rather than behavior
    2. The visual E2E snapshots provide better coverage for styling changes
    3. The change fixes a typo rather than introducing new logic

No additional unit tests are needed for this bug fix.

Backwards Compatibility

Assessment: No Breaking Changes

This is a bug fix with no API changes:

  • No changes to component props or interfaces
  • No changes to exports
  • The visual behavior is being fixed, not changed - icons will now properly center as originally intended
  • Existing code using these icon components will work exactly the same way, just with correct centering

Security & Risk

Assessment: Low Risk

  • Security: No security concerns. This is a pure CSS typo fix with no impact on data handling, authentication, or user input.
  • Regression risk: Very low. The change corrects invalid CSS to valid CSS. The worst case would be if any existing code somehow depended on the broken centering behavior, which is highly unlikely.
  • Visual changes: The snapshots confirm the visual changes are limited to icon alignment improvements, which is the intended behavior.

Recommendations

No blocking issues identified. Minor observations:

  1. Optional improvement: Consider adding a CSS linting rule or TypeScript strict typing for Emotion style objects to catch typos like justifyContents at build time rather than runtime. This could prevent similar issues in the future. (Not a blocker for this PR)

  2. Documentation: The PR description is clear and well-written. No improvements needed.

Verdict

APPROVED: This is a clean, well-scoped bug fix that corrects an invalid CSS property typo. The change has been properly validated through extensive E2E snapshot updates, introduces no breaking changes, and poses minimal risk to existing functionality.


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

@sfc-gh-nbellante sfc-gh-nbellante removed the do-not-merge PR is blocked from merging label Jan 11, 2026
Copy link
Collaborator

@sfc-gh-lwilby sfc-gh-lwilby left a comment

Choose a reason for hiding this comment

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

Wow, good catch! It seems like a good idea to add a linting rule as the AI review suggests, but not blocking for this PR.

@sfc-gh-nbellante sfc-gh-nbellante merged commit 1ed1d6a into develop Jan 12, 2026
53 of 55 checks passed
@sfc-gh-nbellante sfc-gh-nbellante deleted the polish-upload-spinner branch January 12, 2026 16:25
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