Skip to content

feat(pr): show total lines of code changed in PR Analytics widget#2469

Open
anuragbraveboy-sudo wants to merge 1 commit into
Umbrella-io:mainfrom
anuragbraveboy-sudo:feat/pr-lines-changed
Open

feat(pr): show total lines of code changed in PR Analytics widget#2469
anuragbraveboy-sudo wants to merge 1 commit into
Umbrella-io:mainfrom
anuragbraveboy-sudo:feat/pr-lines-changed

Conversation

@anuragbraveboy-sudo

Copy link
Copy Markdown

Description

This PR resolves issue #2450 by adding a "Lines Changed" stat tile to the PR Analytics widget, displaying total additions and deletions across merged PRs in the last 30 days.

Closes #2450

Key Changes

  1. GraphQL API Query Optimization:

    • Extended /api/metrics/prs route to run parallel GraphQL search queries for reviews and authored PRs in a single HTTP request.
    • Aggregates and sums additions and deletions for the user's PRs merged in the last 30 days.
    • Added additions/deletions support for target account aggregation (targetAccountId === "combined") and returned 0 fallbacks for GitLab.
  2. Frontend Stat Tile:

    • Rendered a new "Lines Changed" stat card displaying additions and deletions with green (+) and red (-) coloring, matching GitHub's diff formatting style (e.g., +1,240 / -380).
    • Adapted the grid layout and loading skeletons to support 7 columns cleanly.
    • Configured filter matching so the tile appears on the "All" and "Merged" filters but is hidden on the "Open" filter.
  3. E2E Test Mocks:

    • Updated mock API responses in e2e/helpers/dashboard-mocks.js to return mock additions/deletions, ensuring layout rendering is covered under tests.

Verification

  • Run TypeScript compile check: npx tsc --noEmit (Passed).
  • Run Playwright E2E tests: npx playwright test e2e/dashboard-widgets.spec.js (3/3 tests passed successfully).

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels Jun 15, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:testing GSSoC type bonus: tests (+10 pts) type:design GSSoC type bonus: UI/design (+10 pts) type:performance GSSoC type bonus: performance (+15 pts) labels Jun 15, 2026
- Implement PR Analytics widget enhancement to show total lines of code changed (additions + deletions) (Umbrella-io#2450)

- Implement client-side caching (stale-while-revalidate) for dashboard API responses to reduce redundant fetches (Umbrella-io#2436)
@Priyanshu-byte-coder Priyanshu-byte-coder added the gssoc:approved GSSoC: PR approved for scoring label Jun 16, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with the current main branch. Please rebase or merge main into your branch to resolve the conflicts, then push the updated branch. Once conflicts are resolved, this PR will be merged.

git fetch origin main
git merge origin/main
# resolve conflicts
git push

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with main. Please rebase or resolve conflicts and push again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Show total lines of code changed (additions + deletions) in PR Analytics widget

2 participants