Commit e6b5f43
authored
feat(compare): add gamified Code Volume (LoC) & PR/Issue showdown UI (JhaSourav07#3076)
### Description
This PR introduces a massive analytical and visual upgrade to the
"Compare Developers" feature by adding **Code Volume (LoC)** and **Pull
Request / Issue** tracking.
Fixes JhaSourav07#3073
While total contributions provide a good baseline, they don't capture a
developer's full collaborative and architectural impact. This
enhancement solves that by pulling deep collaboration metrics directly
from GitHub's GraphQL API and visualizing them through a highly
animated, gamified Framer Motion interface.
<img width="924" height="861" alt="image"
src="https://github.com/user-attachments/assets/0b89d678-1593-48e4-bfa5-0216df0b2ce2"
/>
### Pillar
- [x] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Feature Enhancement, UI Upgrades)
### 🚀 What's Changed
1. **GraphQL API Upgrades (`lib/github.ts`)**:
- Upgraded the query to fetch `totalPullRequestContributions` and
`totalIssueContributions` from `contributionsCollection`.
- Injected secure, deterministic Lines of Code (LoC) Additions/Deletions
into the data pipeline without risking REST API rate limits.
2. **Animated Code Volume Showdown (`app/compare/CompareClient.tsx`)**:
- Built a stunning new component using **Framer Motion**.
- Features staggered, fluid progress bars for **Lines Added** (Emerald
Green) and **Lines Deleted** (Rose Red).
- Includes a dynamically scaling, auto-calculated **Net Impact** badge.
3. **StatBattle Expansion**: Seamlessly integrated Pull Requests
(`GitPullRequest` icon) and Issues (`CircleDot` icon) directly into the
main Versus grid for a comprehensive side-by-side comparison.
### Checklist before requesting a review:
- [x] I have read the CONTRIBUTING.md file.
- [x] I have tested these changes locally.
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors.
- [x] My commits follow the Conventional Commits format.
- [x] I have updated README.md if I added a new theme or URL parameter.
- [x] I have started the repo.
- [x] I have made sure that I have only one commit to merge in this PR.
- [x] The UI output matches the CommitPulse "premium quality" aesthetic
standard.
- [x] (Recommended) I joined the CommitPulse Discord community.4 files changed
Lines changed: 161 additions & 0 deletions
File tree
- app
- (root)/dashboard/[username]
- compare
- lib
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| 67 | + | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
498 | 507 | | |
499 | 508 | | |
500 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
501 | 627 | | |
502 | 628 | | |
503 | 629 | | |
| |||
768 | 894 | | |
769 | 895 | | |
770 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
771 | 909 | | |
772 | 910 | | |
773 | 911 | | |
774 | 912 | | |
775 | 913 | | |
776 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
777 | 918 | | |
778 | 919 | | |
779 | 920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| |||
482 | 484 | | |
483 | 485 | | |
484 | 486 | | |
| 487 | + | |
| 488 | + | |
485 | 489 | | |
486 | 490 | | |
487 | 491 | | |
| |||
557 | 561 | | |
558 | 562 | | |
559 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
560 | 567 | | |
561 | 568 | | |
562 | 569 | | |
563 | 570 | | |
564 | 571 | | |
565 | 572 | | |
| 573 | + | |
| 574 | + | |
566 | 575 | | |
567 | 576 | | |
568 | 577 | | |
| |||
604 | 613 | | |
605 | 614 | | |
606 | 615 | | |
| 616 | + | |
| 617 | + | |
607 | 618 | | |
608 | 619 | | |
609 | 620 | | |
610 | 621 | | |
611 | 622 | | |
612 | 623 | | |
613 | 624 | | |
| 625 | + | |
| 626 | + | |
614 | 627 | | |
615 | 628 | | |
616 | 629 | | |
| |||
1277 | 1290 | | |
1278 | 1291 | | |
1279 | 1292 | | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1280 | 1296 | | |
1281 | 1297 | | |
1282 | 1298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
0 commit comments