Skip to content

feat: add Issue Discovery mode toggle to leaderboard#246

Closed
edwin-rivera-dev wants to merge 3 commits intoentrius:testfrom
edwin-rivera-dev:feat/leaderboard-discovery-section
Closed

feat: add Issue Discovery mode toggle to leaderboard#246
edwin-rivera-dev wants to merge 3 commits intoentrius:testfrom
edwin-rivera-dev:feat/leaderboard-discovery-section

Conversation

@edwin-rivera-dev
Copy link
Copy Markdown
Contributor

@edwin-rivera-dev edwin-rivera-dev commented Apr 14, 2026

Summary

The leaderboard can now surface Issue Discovery rankings as a section inside the existing miner leaderboard, rather than requiring users to navigate to a parallel /discoveries page.

What changed

src/pages/TopMinersPage.tsx gains a mode toggle (Tabs component) with two values:

  • OSS Contributions (default) -existing behavior, sorted by totalScore
  • Issue Discovery - sorted by issueDiscoveryScore, uses issueCredibility, isIssueEligible, totalSolvedIssues/totalOpenIssues/totalClosedIssues

When the Discovery mode is active:

  • TopMinersTable receives the discovery-mapped dataset and activityLabel="Issues"
  • Row clicks route to /discoveries/details with a "Back to Discoveries" back label
  • LeaderboardSidebar renders with variant="discoveries"
  • Intro copy swaps to the discovery description

State is mirrored to ?mode=discovery via useSearchParams so the tab is deep-linkable and preserved on refresh / back-navigation.

Why this scope

  • Reuses TopMinersTable / LeaderboardSidebar without modification - the props already support both modes (the existing DiscoveriesPage is effectively the same page with different field mappings)
  • No new API calls; same useAllMiners() hook
  • No new route, no new shared helper - keeps the change contained to one file as requested in the issue
  • /discoveries and /discoveries/details routes are untouched for backward compatibility; deep links from elsewhere in the app keep working

Type of Change

  • Feature / enhancement

Testing

  • npm run build
  • npm run lint:fix
  • Manual on /top-miners:
    • Default view shows OSS Contributions, sorted by totalScore
    • Click "Issue Discovery" tab --> table re-sorts, USD/credibility/activity count reflect issue metrics, URL becomes ?mode=discovery
    • Click a row in Discovery mode --> lands on /discoveries/details?githubId=...
    • Back navigation returns to ?mode=discovery (not OSS)
    • Refresh preserves current mode
    • ?mode=oss or no param --> OSS mode; invalid values --> OSS mode
  • Mobile viewport: tab bar is horizontally scrollable / legible

Checklist

  • No changes to shared table / sidebar components
  • No new dependencies
  • Only src/pages/TopMinersPage.tsx touched
  • Existing /discoveries page behavior preserved

Follow-ups (out of scope for this PR)

  • Extract the OSS↔Discovery field mapping into a shared useLeaderboardMiners(mode) hook once DiscoveriesPage is consolidated
  • Decide whether /discoveries should redirect to /top-miners?mode=discovery or remain as a deep-linkable entry point

Updated UI Video

14.04.2026_17.55.21_REC.mp4

Closes #171

@edwin-rivera-dev
Copy link
Copy Markdown
Contributor Author

Hi @spider-yamet @anderdc
I picked this up in PR #246

Approach: added a tab toggle at the top of TopMinersPage (OSS Contributions | Issue Discovery), mirroring the mode to ?mode=discovery via useSearchParams so the section is deep-linkable and preserved across back-navigation. The Discovery mode reuses the existing TopMinersTable / LeaderboardSidebar without changes - it's essentially the same field mapping DiscoveriesPage already uses (issueDiscoveryScore, issueCredibility, isIssueEligible, totalSolvedIssues/totalOpenIssues/totalClosedIssues), dropped in as a second memoized dataset.

Scope kept tight: one file (src/pages/TopMinersPage.tsx), ~70 additions, no new hooks or helpers, no new routes, no changes to shared components. /discoveries remains functional so any external deep links keep working - deprecation can be a follow-up.

Acceptance criteria coverage:

  • ✅ Issue discovery appears as a section in the existing leaderboard area (as a tab)
  • ✅ Ranking uses existing issue discovery metrics from the miner dataset
  • ✅ Section distinguishes issue eligibility and issue-focused activity (via activityLabel="Issues" and the discovery sidebar variant)
  • ✅ Clicking a miner routes to the existing /discoveries/details view
  • ✅ No new standalone leaderboard page introduced

Happy to split this into smaller increments or to also fold the shared field mapping into a hook in the same PR if that fits your conventions better - just let me know.

@edwin-rivera-dev edwin-rivera-dev marked this pull request as draft April 14, 2026 20:46
@edwin-rivera-dev edwin-rivera-dev marked this pull request as ready for review April 14, 2026 20:46
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

conflicts

@anderdc anderdc closed this Apr 15, 2026
@anderdc anderdc added the feature Net-new functionality label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Net-new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an Issue Discovery section to the existing leaderboard view

2 participants