-
-
Notifications
You must be signed in to change notification settings - Fork 86
GET-44: icon update for badges #389
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
Conversation
✅ Deploy Preview for reagraph ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review - PR #389: Icon support for BadgesThank you for adding icon support to the Badge component! This is a nice enhancement that adds more flexibility to badge customization. Strengths
Issues FoundCritical Issues
Performance and Code Quality
Missing Elements
SecurityNo security concerns identified. SummaryOverall Assessment: Good feature addition with some fixable issues. Required Changes:
Recommended Changes:
Review generated with Claude Code |
Code ReviewThank you for this feature addition! The implementation adds icon support to badges, which is a nice enhancement. Here is my detailed feedback: Strengths
Code Quality Issues1. Missing Gap in Width Calculation (src/symbols/nodes/Badge.tsx:155-158)The width calculation adds iconSize but does not account for the gap between icon and text. Line 157 should conditionally add ICON_TEXT_GAP only when icon position is start or end, not for custom positions. Current: estimatedWidth += iconSize This will cause the badge to be slightly too narrow when using start or end positions, potentially causing text to overflow or touch the icon. 2. Inconsistent Position Calculation (src/symbols/nodes/Badge.tsx:213)Line 213 contains a magic number 0.5 that lacks context: This should either use a named constant explaining what 0.5 represents, or be removed if it is meant to be iconSize / 2 (which would make more sense for centering). 3. Incomplete Custom Position HandlingWhen using custom iconPosition as [x, y], the width calculation still includes the icon in the badge width (line 157), but the layout logic places the icon at custom coordinates. This could cause the badge to be unnecessarily wide or icons to extend beyond the background. Suggested fix: Only add icon width when iconPosition is not an array. Testing IssuesCritical: No tests were added for this feature. Per the PR checklist and CLAUDE.md, tests should be added for new features. The project uses Vitest for testing. Recommendations:
Style and ConventionsMinor: The PR includes newline removals from unrelated files (.husky/pre-commit and package.json). These changes should ideally be in a separate cleanup PR or reverted if unintentional. SecurityNo security concerns identified. The Image component from drei handles URL loading safely. PerformanceNo performance concerns. Proper memoization is used and layout calculations are O(1). Recommendations
PR Checklist Status
VerdictThe feature is well-implemented overall and follows project conventions nicely. However, it needs:
Once these are addressed, this will be ready to merge! Great work on the feature and documentation. |
Code Review - PR #389: Icon update for badgesThank you for this contribution! This is a well-structured feature addition that adds icon support to the Badge component. Here's my detailed review: ✅ Strengths
🐛 Potential Issues
⚡ Performance Considerations
🔒 Security Considerations✅ No security concerns. The 🧪 Test CoverageMissing: No unit tests were added for the new functionality. Consider adding tests for:
📝 Minor Nitpicks
📋 RecommendationsBefore merging:
Nice to have: SummaryThis is a solid feature implementation that follows the project's conventions well. The main issue is the width calculation bug that could cause visual clipping. Once the width calculation is fixed and the breaking change is clarified, this will be ready to merge. Overall assessment: Review generated with assistance from Claude Code following the project's CLAUDE.md guidelines |
PR Review: Icon Update for BadgesI've reviewed PR #389 and have the following feedback organized by category: ✅ Strengths
🔧 Issues & Recommendations1. Breaking Change - Removed
|
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number:
GET-44: badges and icons update
What is the new behavior?
Screen.Recording.2025-10-21.at.12.55.34.PM.mov
Does this PR introduce a breaking change?
Other information