fix(miners): show real dates in PR list Date column (#1111)#1119
fix(miners): show real dates in PR list Date column (#1111)#1119Khaostica wants to merge 2 commits into
Conversation
The Pull Requests table on miner detail pages rendered the literal strings "Open" or "Closed" for non-merged PRs while the column header read "Date" and its sort comparator used a real timestamp — the display contradicted both the label and the ordering. This change always renders a date that corresponds to the PR's state (merged date / closed date / opened date), with a tooltip naming the milestone the date refers to (e.g. "Opened May 6, 2026"). Because /miners/:id/prs only returns mergedAt, the missing dates are sourced from two fallbacks: the mirror's /miners/:id/pulls endpoint (bulk, for repos the subnet tracks) and per-row GitHub REST for the visible page (lazy, cached forever in React Query). Unresolved rows still degrade to "—" rather than misreporting a state as a date. Closes entrius#1111
|
Hi @Khaostica, In my opinion, adding a new API just to fetch each PR’s timestamp in If the server provides these two properties, Hope this helps. |
Per review feedback on entrius#1111: layering mirror + GitHub fan-out fallbacks on top of /miners/:id/prs duplicates a data path the CommitLog type already commits to (closedAt, prCreatedAt) and introduces inconsistency with how other components consume miner data. Reverts useMinerPullDates and useGithubPrDates. Non-merged rows render "—" until the das endpoint includes prCreatedAt and closedAt. The cell renderer already consumes both fields, so once the backend ships them the rows light up with no further UI change. The Date column still correctly resolves merged > closed > opened with a milestone-naming tooltip and a sort comparator that uses the same date the cell displays — that part of the original fix stays.
|
Fair point, and I agree with you @andriypolanski. The mirror + GitHub fan-out was an attempt to ship something usable end-to-end given the current I've reverted the two hooks ( The UI-only parts of the original fix stay: the |
Summary
The Pull Requests table on miner detail pages rendered the literal strings
OpenorClosedin theDatecolumn for any PR that wasn't merged — contradicting both the column label and the sort comparator (which already ordered by a real timestamp).This PR:
getPrDateInfo(pr)helper that resolves the Date column to the milestone matching the PR state: merged →mergedAt, closed →closedAt, open →prCreatedAt.Merged May 7, 2026/Closed May 8, 2026/Opened May 6, 2026).—for any row whose resolvable date is still null.Note on the dash render
/miners/:id/prscurrently returns onlymergedAt, so non-merged rows fall back to—until the das endpoint includesprCreatedAtandclosedAt. Both fields are already declared on theCommitLogtype and consumed elsewhere in the codebase — tracking the backend request in #1120. Once those fields land on the wire, the cell renderer picks them up automatically with no further UI change.An earlier revision of this PR fanned out to the mirror and to GitHub REST to fill in the missing dates client-side. That was reverted per review feedback (this comment) — it duplicated a data path the type already commits to and added a rate-limit surface other components don't take on.
Related Issues
Closes #1111
Depends on #1120 (backend)
Type of Change
Screenshots
Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses