Skip to content

fix: show collateral score for open PRs and rename Merged column to Date#289

Closed
edwin-rivera-dev wants to merge 1 commit intoentrius:testfrom
edwin-rivera-dev:fix/repo-prs-table-open-score-and-date
Closed

fix: show collateral score for open PRs and rename Merged column to Date#289
edwin-rivera-dev wants to merge 1 commit intoentrius:testfrom
edwin-rivera-dev:fix/repo-prs-table-open-score-and-date

Conversation

@edwin-rivera-dev
Copy link
Copy Markdown
Contributor

Summary

Fixes #288 . Two small corrections to the Repository → Pull Requests table:

  1. Score column on OPEN PRs now shows the PR's collateral score (already on CommitLog as collateralScore) styled in the open-status color and prefixed with - to signal it's a penalty. Open PRs no longer render a uniform 0.0000 column. Merged and closed PRs are unchanged - still show score.
  2. The "Merged" header becomes "Date" and the cell now shows mergedAt for merged PRs and prCreatedAt otherwise. The column is no longer a sea of dashes on All / Open / Closed filters.

Why

  • Open PRs haven't been fully scored yet, so their score field is 0. Showing 0.0000 gave miners and reviewers no actionable information. The collateral score is what's actively being applied to the miner while the PR sits open — it's the meaningful number.
  • The Merged column was wasted whitespace for any PR state other than MERGED. Renaming to Date and backfilling with the creation date keeps the column useful across every filter.

What changed

  • src/components/repositories/RepositoryPRsTable.tsx:
    • Score cell now branches on prState: OPEN + non-zero collateralScore → display -X.XXXX in status.open color with a tooltip; otherwise display score.toFixed(4) in primary text color (current behavior).
    • Header cell renamed MergedDate.
    • Date cell now uses pr.mergedAt ?? pr.prCreatedAt.

No new data fetched, no new dependencies. CommitLog already exposes collateralScore and prCreatedAt.

Type of Change

  • Bug fix / UX correctness

Testing

  • npm run build
  • npm run lint:fix
  • Manual on any repository with a mix of PR states:
    • Score column: open PRs show -{collateral} in the open-status color with a tooltip; merged / closed rows show the normal score.
    • Open PRs with collateralScore = 0 (rare edge case) fall back to showing 0.0000 rather than -0.0000.
    • Date column: merged rows show merge date; open / closed rows show creation date; no more dashes under normal data.
    • Hovering a negative collateral cell surfaces the tooltip "Collateral score applied while this PR is open".
  • Mobile viewport: column width doesn't change meaningfully.

Checklist

  • No new dependencies
  • One file touched
  • No API changes
  • Behavior unchanged for MERGED rows

Video to upload

3.mp4

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

@anderdc can you please review my PR and let me know your feedback?

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

Closing — duplicate of #295 which addresses the same issue (#288) with overlapping changes to the same component.

@anderdc anderdc closed this Apr 15, 2026
@edwin-rivera-dev
Copy link
Copy Markdown
Contributor Author

Hi, @anderdc
I created #288 issue and also opened a PR - #289 but my PR become duplicated due to #295 .
Actually #295 was created after #289, so to be precise, #295 must be closed first.
Please review quickly and correctly. I appreciate.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

Closing — this fixes the same table that your #283 modifies. Please fold the collateral display + Merged→Date rename into #283 alongside the sortable columns, and fix the score comparator to use collateralScore for open PRs (same pattern as getEffectiveScore in #279). No reason for two PRs against the same file.

@anderdc anderdc closed this Apr 15, 2026
@edwin-rivera-dev
Copy link
Copy Markdown
Contributor Author

edwin-rivera-dev commented Apr 15, 2026

Hi, @anderdc
Yes, you are right, Could you reopen the PR again? Actually current PR mention about more adaptive term in the list.
They can contain changes in the same file but their features are different.
I pushed again without conflict. I want you to review again.

Closing — this fixes the same table that your #283 modifies. Please fold the collateral display + Merged→Date rename into #283 alongside the sortable columns, and fix the score comparator to use collateralScore for open PRs (same pattern as getEffectiveScore in #279). No reason for two PRs against the same file.

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

Hi @anderdc
Could you re-open the PR please?

@anderdc anderdc added the refactor Code restructuring without behavior change label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Pull Requests table: open PRs show "0" for Score, and Merged column is mostly empty

2 participants