Skip to content

bug: InsightsList incorrectly favors User 1 when metrics are tied #268

Open

Description

@O2sa

In src/features/comparison/components/insights-list.tsx lines 46-69:

const repoLeader = user1.repoScore >= user2.repoScore ? user1 : user2;
const prLeader = user1.prScore >= user2.prScore ? user1 : user2;
const contributionLeader = user1.contributionScore >= user2.contributionScore ? user1 : user2;

When both developers have equal scores (for example, both have 0 PR score or matching repo scores), the >= check automatically assigns user1 as the leader. As a result, user1 is credited with a strength in that category, and user2 is given a recommendation to improve.

Motivation

Displaying asymmetric insights when two scores are identical is incorrect and misleading.

Tasks

  • Check for score equality (user1.repoScore === user2.repoScore).
  • Only award category strengths when a developer strictly exceeds the other (>).
  • If tied, either do not award a strength or display a balanced tied note.
  • Update or add tests in src/features/comparison/tests/insights-list.test.tsx.

Files to Check

  • src/features/comparison/components/insights-list.tsx
  • src/features/comparison/tests/insights-list.test.tsx

Tip

🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨

Activity

  1. sarmad-jalil commented on Oct 25, 2026

    @sarmad-jalil

    Hi! I'd like to work on this issue. Could you please assign it to me? Thanks!

  2. github-actions commented on Oct 25, 2026

    @github-actions

    🎉 Issue assigned to @sarmad-jalil! Happy coding!

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions