Skip to content

Conversation

@philippjfr
Copy link
Contributor

Fixes regression in icon sizing introduced in #555

Copilot AI review requested due to automatic review settings January 14, 2026 18:12
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.54%. Comparing base (9fdb112) to head (e9b004c).

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #556       +/-   ##
===========================================
+ Coverage   67.86%   80.54%   +12.68%     
===========================================
  Files          31       31               
  Lines        3146     3146               
===========================================
+ Hits         2135     2534      +399     
+ Misses       1011      612      -399     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 regression in icon sizing where the icon_size parameter was not properly overriding the size parameter in the FileDownload widget. The fix ensures that custom icon sizes are correctly applied by updating the icon rendering logic to properly prioritize icon_size over size, and updating FileDownload to pass the size parameter to the icon rendering function for proper fallback behavior.

Changes:

  • Updated render_icon function to correctly prioritize icon_size over size using the appropriate CSS property (fontSize prop for standard sizes, style prop for custom sizes)
  • Modified FileDownload widget to pass size parameter to render_icon calls, making it consistent with the Button widget implementation

Reviewed changes

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

File Description
src/panel_material_ui/utils.js Refactored icon_font_size calculation logic to properly handle standard vs custom sizes, ensuring icon_size takes precedence over size
src/panel_material_ui/widgets/FileDownload.jsx Updated render_icon calls to pass size parameter instead of null, enabling proper fallback behavior when icon_size is not a standard size

Comment on lines +94 to +98
endIcon={end_icon && render_icon(end_icon, null, size, icon_size)}
fullWidth
loading={loading}
ref={ref}
startIcon={icon ? render_icon(icon, null, null, icon_size) : (auto || model.data != null) ? (
startIcon={icon ? render_icon(icon, null, size, icon_size) : (auto || model.data != null) ? (
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

There is no test coverage for FileDownload widget's icon_size behavior. Consider adding a test similar to test_fab_icon_size in tests/ui/widgets/test_fab.py to verify that icon_size correctly overrides the size parameter for FileDownload.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants