Add stale PR indicators with configurable thresholds#396
Conversation
|
@Mash4-4-4-4 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Changes Required
1. Interface concatenation — missing newline
+interface PullRequest {
+ ...
+}interface PRMetricsBase { // ← no newline between closing } and next interfaceAdd a blank line between the two interface declarations.
2. Indentation inconsistency throughout
Multiple code blocks are misaligned relative to the surrounding code:
items: Array<{block in the inline type (4-space instead of matching outer indent)const prs = data.items.map(...)block is indented as if inside the previousifbut sits at function scopereturn { open, merged, ... }block is unindented vs the function bodyconst [staleDays, setStaleDays]in PRMetrics.tsx placed at wrong indent levelconst isStaleandconst stalePRsappear at file scope instead of component scope
Run a formatter (Prettier) before submitting — the inconsistent indentation will cause lint failures.
3. Performance: 30 parallel GitHub API calls per dashboard load
getAverageFirstReviewHours does Promise.all(prs.slice(0, 30).map(fetchFirstReviewTimestamp)) — 30 concurrent API calls every time the PR Analytics card loads. For users with many PRs this is slow and risks hitting GitHub rate limits. The result should be wrapped in withMetricsCache (from PR #311) with a reasonable TTL.
4. Missing EOF newline in PRMetrics.tsx
File ends with } and no trailing newline.
5. Extra blank lines in fetchPRMetrics
async function fetchPRMetrics(token: string): Promise<PRMetricsBase> {
+
+
const searchRes = ...Remove the two extra blank lines at the start of the function.
The stale PR feature (threshold selector + stale list) is a solid addition — address the above and this can merge.
Summary
Added stale PR indicators in the PR Analytics section to help users quickly identify pull requests that have been open for too long.
Closes #257
Type of Change
Changes Made
How to Test
Steps for the reviewer to verify this works:
Screenshots (if UI change)
Checklist
npm run lintpasses locallynpm run type-check)