Skip to content

refactor(generator): replace ~80-line manual tower loops in generateAutoThemeVersusSVG with renderTowers(isAutoTheme=true)#5013

Merged
JhaSourav07 merged 9 commits into
JhaSourav07:mainfrom
ChetanSenta:refactor/auto-theme-versus-use-render-towers
Jun 12, 2026
Merged

refactor(generator): replace ~80-line manual tower loops in generateAutoThemeVersusSVG with renderTowers(isAutoTheme=true)#5013
JhaSourav07 merged 9 commits into
JhaSourav07:mainfrom
ChetanSenta:refactor/auto-theme-versus-use-render-towers

Conversation

@ChetanSenta

Copy link
Copy Markdown
Contributor

Description

Fixes #5003

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

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

generateAutoThemeVersusSVG had two manual for-loops (~40 lines each)
building tower SVG strings — duplicating the exact same logic already
in renderTowers(isAutoTheme=true). The static generateVersusSVG
correctly 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

File Change
lib/svg/generator.ts Deleted ~80 lines of manual tower loops from generateAutoThemeVersusSVG, replaced with 2 renderTowers() calls
lib/svg/generator.additional.test.ts Added 8 consistency tests verifying auto-theme versus tower output

Lines removed: ~80

Lines added: 3 (2 renderTowers calls + 1 comment)

Net: -77 lines of duplication

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally.
  • I have run npm run format and npm run lint locally and resolved all errors.
  • My commits follow the Conventional Commits format.
  • I have updated README.md if I added a new theme or URL parameter.
  • I have starred the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse premium quality aesthetic standard.
  • (Recommended) I joined the CommitPulse Discord server.

…ersusSVG with renderTowers(isAutoTheme=true)
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the type:refactor Code changes that neither fix a bug nor add a feature label Jun 9, 2026
@Aamod-Dev Aamod-Dev added level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. GSSoC 2026 mentor:Aamod007 labels Jun 11, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 Aamod-Dev added the level:beginner Small changes Usually isolated fixes or simple UI/text updates. label Jun 11, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@Aamod-Dev Aamod-Dev removed the level:beginner Small changes Usually isolated fixes or simple UI/text updates. label Jun 12, 2026
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Hey @ChetanSenta, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

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 passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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!

@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jun 12, 2026
@ChetanSenta

Copy link
Copy Markdown
Contributor Author

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

@ChetanSenta ChetanSenta requested a review from Aamod-Dev June 12, 2026 06:41

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing the CI pipeline! Approving.

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jun 12, 2026
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jun 12, 2026
@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 12, 2026
@JhaSourav07 JhaSourav07 merged commit f5f4253 into JhaSourav07:main Jun 12, 2026
5 of 6 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 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.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@JhaSourav07 JhaSourav07 added gssoc:approved PR has been reviewed and accepted for valid contribution points and removed gssoc:approved PR has been reviewed and accepted for valid contribution points labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points gssoc:needs-rebase GSSoC 2026 level:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:refactor Code changes that neither fix a bug nor add a feature

Projects

None yet

3 participants