refactor(generator): replace ~80-line manual tower loops in generateAutoThemeVersusSVG with renderTowers(isAutoTheme=true)#5013
Conversation
…ersusSVG with renderTowers(isAutoTheme=true)
|
Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
Aamod-Dev
left a comment
There was a problem hiding this comment.
Great refactoring! Replacing those 80 lines of manual tower generation loops with the streamlined 'renderTowers' utility significantly improves the codebase's readability and maintainability. Approving!
Aamod-Dev
left a comment
There was a problem hiding this comment.
Appreciate the contribution! I went through the implementation and it meets our expectations. The new additions are clean and integrate nicely with the existing codebase. This is good to go.
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for putting this together. The code looks clean and solves the issue effectively.
I am adding the quality:exceptional label because the implementation not only solves the core issue but goes beyond by effectively handling edge cases, tests, or reducing technical debt. Great work going above and beyond!
Looks solid. I'll go ahead and approve.
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I went through the changes and the overall approach looks good, but there are a few issues that should be addressed before this can be merged. Most of the concerns are related to correctness and maintainability.
- There are merge conflicts with the base branch. Please resolve them to ensure existing functionality isn't broken.
Once these issues are addressed, I'll be happy to take another look. Thanks again for the contribution.
|
🚨 Hey @ChetanSenta, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for the updates! I noticed that the CI pipeline (\Format · Lint · Typecheck · Test) is still failing for this PR. Please run the checks locally to identify and fix the issue. Thanks!
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for the contribution. The overall approach looks good, but the CI pipeline is currently failing. Please run the checks (like npm run format, npm run lint, and npm run test) locally to identify and fix the issues. Let me know once it's green!
ok |
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for fixing the CI pipeline! Approving.
|
🎉 Congratulations @ChetanSenta! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
Description
Fixes #5003
Pillar
Visual Preview
No visual change. Auto-theme versus badge output is geometrically and
visually identical before and after — verified by the new consistency tests.
What this PR does
generateAutoThemeVersusSVGhad two manual for-loops (~40 lines each)building tower SVG strings — duplicating the exact same logic already
in
renderTowers(isAutoTheme=true). The staticgenerateVersusSVGcorrectly calls
renderTowers()but the auto-theme variant bypassed it.This PR replaces both manual loops with 2 calls to renderTowers():
Before: ~80 lines of duplicated manual loops
After: 2 lines calling the existing shared helper
Changes
lib/svg/generator.tslib/svg/generator.additional.test.tsLines removed: ~80
Lines added: 3 (2 renderTowers calls + 1 comment)
Net: -77 lines of duplication
Checklist before requesting a review:
CONTRIBUTING.mdfile.npm run formatandnpm run lintlocally and resolved all errors.README.mdif I added a new theme or URL parameter.