Skip to content

refactor: Deduplicate signal metrics mapping between Comparison and Profile views #247

Open

Description

@O2sa

Both ResultDashboard (src/features/comparison/components/result-dashboard.tsx) and UserProfileClient (src/features/developer/components/user-profile-client.tsx) define duplicate arrays mapping user signal fields (reposAnalyzed, pullRequestsAnalyzed, mergedExternalPRs, unmergedPRsIgnored, etc.) to translated labels.

Motivation

Duplicating metric lists creates maintenance overhead when new signal metrics are added to the scoring engine. Extracting a shared helper keeps metrics in sync.

Tasks

  • Create a shared helper function (e.g. getSignalMetricEntries(signals, t)) in src/features/developer or src/lib/.
  • Refactor ResultDashboard to consume the shared helper.
  • Refactor UserProfileClient to consume the shared helper.
  • Ensure all translation keys remain identical and typed.

Tip

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

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions