Repository navigation
feat(code-review): group reviews and bot comments by PR - #25
Conversation
Add a PR history view keyed by the repo + PR pair. It shows every review run and every bot conversation on that PR in one timeline, with the review verdict, reviewed commit, duration, and links to GitHub and the agent session. - GET /pr-history?repo=owner/name&number=N returns both lists. - Route /apps/code-review/pr/<owner>/<repo>/<number>. - Open it from a review or PR task detail page, or look up a PR URL from the dashboard. - Long entries collapse to a preview; long histories render 20 at a time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🔁 This review has been superseded. See the latest review.
| `${apiBase}/pr-history?repo=${encodeURIComponent(pr.repo)}&number=${pr.number}`, | ||
| ); | ||
| if (!response.ok) throw new Error(`Failed to load PR history (HTTP ${response.status})`); | ||
| setPrHistory((await response.json()) as PRHistoryData); |
There was a problem hiding this comment.
Fixed in 69eb2ea. Each PR-history load now uses an AbortController. A new load, or leaving the route, aborts the previous request, and only the current request may set history, error, or loading state. A slow PR A response can no longer replace PR B's timeline or its Re-review URL.
| /** Every review run for one repo + PR pair, oldest first (the PR history view). */ | ||
| listPRReviewsForPR(repo: string, prNumber: number): PRReview[] { | ||
| return this.all<any>( | ||
| `SELECT ${this.prReviewSelectColumns()} FROM "${this.t("pr_reviews")}" WHERE repo = ? AND pr_number = ? ORDER BY started_at ASC`, |
There was a problem hiding this comment.
Fixed in 69eb2ea. Both per-PR queries now compare repo = ? COLLATE NOCASE, so existing rows stored as Owner/Repo match a lookup for owner/repo. I added a mixed-case test for both reviews and mention tasks.
…ensitively - Abort the previous PR-history request when a new one starts or the route leaves the page, so a slow response for one PR cannot replace another PR's timeline or Re-review target. - Match repository names with COLLATE NOCASE in both per-PR queries, since GitHub repo names are case-insensitive. Add mixed-case coverage. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| `${apiBase}/pr-history?repo=${encodeURIComponent(pr.repo)}&number=${pr.number}`, | ||
| ); | ||
| if (!response.ok) throw new Error(`Failed to load PR history (HTTP ${response.status})`); | ||
| setPrHistory((await response.json()) as PRHistoryData); |
There was a problem hiding this comment.
Fixed in 69eb2ea. Each PR-history load now uses an AbortController. A new load, or leaving the route, aborts the previous request, and only the current request may set history, error, or loading state. A slow PR A response can no longer replace PR B's timeline or its Re-review URL.
| /** Every review run for one repo + PR pair, oldest first (the PR history view). */ | ||
| listPRReviewsForPR(repo: string, prNumber: number): PRReview[] { | ||
| return this.all<any>( | ||
| `SELECT ${this.prReviewSelectColumns()} FROM "${this.t("pr_reviews")}" WHERE repo = ? AND pr_number = ? ORDER BY started_at ASC`, |
There was a problem hiding this comment.
Fixed in 69eb2ea. Both per-PR queries now compare repo = ? COLLATE NOCASE, so existing rows stored as Owner/Repo match a lookup for owner/repo. I added a mixed-case test for both reviews and mention tasks.
yunfanye
left a comment
There was a problem hiding this comment.
Code Review: ✅ APPROVE
Adds a focused, read-only PR history endpoint and a unified review/conversation timeline with navigation, filtering, and incremental rendering. Full changed files and relevant callers were reviewed. App typecheck, all 43 code-review tests, and the build passed; UI interactions were not independently browser-tested.
Verdict: APPROVE — The change fits the existing architecture, and no actionable defects were found.
No issues found. Code looks good!
Why
When a PR gets many review runs and bot conversations, they are spread across the activity feed. There is no way to read the full history of feedback for one PR.
What
A PR history view keyed by the repo + PR pair (
/apps/code-review/pr/<owner>/<repo>/<number>):Entry points: a PR history button on review and PR task detail pages, and a History button next to the dashboard's manual-review PR input.
Backend: one read-only route,
GET /pr-history?repo=&number=, built on two new queries filtered by repo and PR number. No schema change.Testing
pnpm typecheck,pnpm vitest run, andpnpm buildpass. A new repo test covers the per-PR filtering and ordering.🤖 Generated with Claude Code