Skip to content

fix(miner): repo standing counts match PR table active rows#1309

Open
carlh7777 wants to merge 3 commits into
entrius:testfrom
carlh7777:fix/repo-count
Open

fix(miner): repo standing counts match PR table active rows#1309
carlh7777 wants to merge 3 commits into
entrius:testfrom
carlh7777:fix/repo-count

Conversation

@carlh7777

@carlh7777 carlh7777 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

On the miner details page, per-repository standing cards display Merged and Closed PR counts from the API (totalMergedPrs, totalClosedPrs). These counts are calculated using each repository's configured scoring.pr_lookback_days window (default 30 days via gittensor's PR_LOOKBACK_DAYS, with repository-specific overrides supported).

The Pull Requests table previously used a fixed 35-day staleness window when determining whether merged PRs should appear active or dimmed. As a result, repositories with shorter lookback windows could display merged PRs as active in the table even though they were already excluded from standing counts, leading to inconsistencies between the table and repository standings.

This change aligns PR table staleness styling with repository-specific scoring windows by:

  • Resolving pr_lookback_days from repository configuration (/dash/repos)
  • Applying repository-specific lookback windows when determining stale merged PRs in MinerPRsTable
  • Displaying the effective lookback period on repository standing cards (PR activity · {n}d lookback)
  • Updating scoring window utilities to support configurable lookback periods instead of relying on a fixed 35-day threshold

This ensures repository standing counts and Pull Requests table highlighting are derived from the same scoring window logic.

Related Issues

Fixes #1308

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

Before

image

After

image

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jun 1, 2026
@anderdc

anderdc commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Fix conflicts.

@carlh7777

Copy link
Copy Markdown
Contributor Author

@anderdc resolved conflicts, could you review again?

@anderdc anderdc 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 core fix is right, but ExplorerUtils.ts changes the defaults of isOutsideScoringWindow and getScoringWindowStartIso from 35 to DEFAULT_PR_LOOKBACK_DAYS (30). Those two are still called with no argument from WatchlistPage (PR + issue staleness), IssuesList, and MinerOpenDiscoveryIssuesByRepo — including the getScoringWindowStartIso() since-filter at line 97 that controls which discovery issues get fetched. So this silently narrows the window by 5 days on surfaces unrelated to #1308. The PR-table fix already routes through the new isOutsidePrLookbackWindow / per-repo map, so these defaults don't need to change — keep both at 35.

@carlh7777

Copy link
Copy Markdown
Contributor Author

@anderdc, fixed. could you review again?

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug](miner): repo standing counts do not match highlighted PR table rows

2 participants