-
Notifications
You must be signed in to change notification settings - Fork 13
Ensure icon_size overrides standard size #556
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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 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_iconfunction to correctly prioritizeicon_sizeoversizeusing the appropriate CSS property (fontSize prop for standard sizes, style prop for custom sizes) - Modified FileDownload widget to pass
sizeparameter torender_iconcalls, 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 |
| 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) ? ( |
Copilot
AI
Jan 14, 2026
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.
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.
Fixes regression in icon sizing introduced in #555