-
Notifications
You must be signed in to change notification settings - Fork 75
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
refactor: extract icon scale adjustment logic into utility function #7935
Conversation
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.
Looking great! Just a few tweaks and we can get this moving forward. 🚀
packages/calcite-components/src/components/accordion-item/accordion-item.tsx
Outdated
Show resolved
Hide resolved
packages/calcite-components/src/utils/iconScaleAdjuster.spec.ts
Outdated
Show resolved
Hide resolved
I've gone ahead and updated the PR title to follow conventional commits (per our contributing guidelines). |
Hi @jcfranco Please check my new commits and let me know if everything is fine now. Thanks for your guidance. |
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.
Other than removing iconScaleAdjuster.spec.ts
and resolving merge conflicts, this LGTM.
Once the last changes are made, we can take it from there to get screenshot tests to run. Thanks again! 🚀
packages/calcite-components/src/utils/iconScaleAdjuster.spec.ts
Outdated
Show resolved
Hide resolved
Hi @jcfranco i am just checking if everything is ok on the latest changes. If I need to modify anything please let me know. Thanks |
@alhridoy It looks like the PR still shows merge conflicts. Once these are resolved, we can take it from there. Thanks again for helping out with this! |
I went ahead and adopted this PR (#7973) to get both E2E and screenshot tests running. Once checks are ✅, we should be good to install for the October release. |
@alhridoy The adopted one (containing your original commits), yes. |
…7973) # Adopted #7935 cc @alhridoy --- **Related Issue:** #7765 ## Summary This pull request extracts the logic for adjusting internal icon scales into a separate utility function. This function is now used across all components, making the code DRYer and easier to maintain. ## Changes - Created a new utility function `adjustIconScale` in `iconScaleAdjuster.ts`. - Replaced inline logic for adjusting icon scales with calls to `adjustIconScale` in all relevant components. ## Testing - All unit tests pass. - Manual testing in the browser confirms that icons still display correctly at all scales. This change stems from issue #7755 and is expected to make the codebase easier to maintain by reducing repetition of this logic. --------- Co-authored-by: Al-Iqram Elahee <hridoy@Al-Iqrams-MacBook-Pro.local>
Hi @jcfranco Great! You welcome. Thanks a lot for guidances. |
Related Issue: #7765
Summary
This pull request extracts the logic for adjusting internal icon scales into a separate utility function. This function is now used across all components, making the code DRYer and easier to maintain.
Changes
adjustIconScale
iniconScaleAdjuster.ts
.adjustIconScale
in all relevant components.Testing
This change stems from issue #7755 and is expected to make the codebase easier to maintain by reducing repetition of this logic.