Skip to content

feat(maintainer): add contributor summary panel to PR detail page - #812

Open
Antherix wants to merge 2 commits into
Coder-s-OG-s:mainfrom
Antherix:feat/contributor-summary-panel
Open

feat(maintainer): add contributor summary panel to PR detail page#812
Antherix wants to merge 2 commits into
Coder-s-OG-s:mainfrom
Antherix:feat/contributor-summary-panel

Conversation

@Antherix

Copy link
Copy Markdown

Summary

Adds a "Contributor" panel to the PR detail sidebar showing the
author's handle, level, and total-submitted-vs-merged PR counts
across the install — per the mockup in #494. Also fixes a
pre-existing migration numbering collision found while setting up
locally.

Type of Change

  • Bug fix
  • New feature
  • UI / UX improvement
  • Refactor
  • Documentation
  • Other (migration fix, see below)

Related Issue

Closes #494

What was changed?

  • Added getContributorSummary(userId, installationId) to
    src/app/actions/maintainer/contributors.ts — counts an author's
    total and merged PRs across every repo in the install.
  • Added a ContributorPanel component
    (src/app/(app)/maintainer/pr/[id]/contributor-panel.tsx), styled
    after the existing AuthorBadge, showing handle, level, and
    "X PRs · Y Merged".
  • Wired the panel into the PR detail sidebar, above the Merge
    Decision card.
  • Trust score is intentionally left out — it depends on the
    composite trust score work tracked in Composite trust score badge for PR authors #454.
  • Also renumbers supabase/migrations/0041_mentorship_chat.sql to
    0043_mentorship_chat.sql, fixing a duplicate migration version
    (two files were both stamped 0041), which broke make db-reset
    on a fresh checkout with a schema_migrations_pkey conflict. This
    is unrelated to the feature — happy to split it into its own PR
    if you'd prefer.

Screenshots

N/A — sidebar panel, no visual mockup captured yet. Can add one if useful.

Checklist

  • My code follows the project structure and conventions
  • I tested this locally (npm run dev)
  • No hardcoded secrets or credentials
  • I have updated documentation if needed

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@Antherix is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Ayush4958 Ayush4958 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.

@Antherix
I had requested some changes, fix them and ping reviewer for review again
thnks ..

.maybeSingle();

if (!profile) {
return ok(null);

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.

Fix Error Handling :- you need to check for if (error) on the Supabase queries and return err(error) rather than swallowing them as ok(null).

.in('repo_full_name', repos);

const rows = (authoredPrs ?? []) as unknown as PrStateRow[];
const totalPrs = rows.length;

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.

Fix Performance Query :- This logic should be refactored to use a Supabase database .count() query instead of fetching and filtering large arrays of raw PR objects in memory on the server.

@Ayush4958 Ayush4958 added the Needs author reply Author need to reply label Jul 26, 2026
@Antherix

Copy link
Copy Markdown
Author

@Ayush4958 please review pr

@Ayush4958 Ayush4958 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.

This PR logic is secure, highly optimized via database level counting, beautifully tested, & includes a critical migration fix.

One thing before merging, u had change the file name of supabase/migration
pls revert that and then It's good to go

@Antherix

Antherix commented Aug 2, 2026

Copy link
Copy Markdown
Author

Rebased onto latest main and reverted the migration rename, turns out 0041 got fixed a different way upstream in the meantime, and my old 0043 would've collided with the new 0043_activity_log_read_at.sql

@jakharmonika364 jakharmonika364 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.

The migration rename is still in the diff (0041_mentorship_chat.sql -> 0043_mentorship_chat.sql), but head is still 6d47793 - the same commit your CHANGES_REQUESTED review was against. The "reverted the migration rename" comment doesn't seem to have actually been pushed. As-is this would collide with 0043_activity_log_read_at.sql, which already merged via #802. Can you push the commit that drops the migration file from this PR? main already has 0041_mentorship_chat.sql correctly numbered, so it shouldn't need to move at all.

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

Labels

Needs author reply Author need to reply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR review: Contributor summary panel

3 participants