Pull request reviewPro
The full review of a pull request: summary and risk, every comment by file with its severity, the lines it points at and a red and green suggestion, and Fix all to apply them in one commit.
On this page
ProA review streams in file by file: summary, risk, comments by severity with red and green suggestions. Apply one, resolve or dismiss, or Fix all in one commit.
Installation
Usage
import { PrReview } from "@/components/ui/chatcn/pro/pr-review"
<PrReview title={pr.title} number={pr.number} comments={comments} onApply={apply} onFixAll={fixAll} fix={fix} />The free PullRequestCard sums a pull request up in a chat; this is the surface you review it on. Comments sort most severe first inside each file. While phase is reviewing, comments stream in and a status line names the file being read; Fix all waits until the review is done.
Examples
States
ProFiltered to warnings with a failed Fix all, no issues found, a review that stopped with the fix and loading.
Props
| Prop | Type | Notes |
|---|---|---|
title, number, repo, branch, baseBranch, author, stats | The header | |
summary, highlights, risk | ReactNode, ReactNode[], { level, reason } | What changed and how risky it is |
comments | ReviewComment[] | severity (critical, warning, suggestion, nit), path, line, title, body, code, suggestion, status |
phase, progress | "reviewing" | "done" | "failed" | Streaming review and files read |
error, onRetry | Why the review stopped | |
filter, defaultFilter, onFilterChange | ReviewSeverity | "all" | |
onApply, onResolve, onDismiss | (id) => void | Per comment |
onFixAll, fix | (ids) => void, { phase, done, total, commit, error } | Fix all open comments that have a suggestion |
onFileSelect | (path, line) => void | Makes the line reference a link |
loading | boolean |
Keyboard
| Key | Action |
|---|---|
J K | Next and previous comment |
Tab | Apply suggestion, Resolve, Dismiss |
Accessibility
- Each comment is an article named by its title. Severity is a word with its own glyph; the hue only backs it up.
- Suggestions read Removed and Added line by line. Failures are alerts with the fix.
Motion
Only the reviewing label shimmers. Applied comments fold to their title; that change is not animated, so the list never slides under the pointer.