Diff Review
Review AI edits hunk by hunk. Pro · AI chat and agents › Answers and artifacts
Review AI-proposed edits change by change: accept or reject each hunk, then take the resulting text.
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add diff-review
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { DiffReview } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
original * | string | The current text. | |
modified * | string | The text with the proposed edits. | |
language | string | Syntax highlighting, as in CodeBlock: ts, tsx, css, json, python… | |
filename | string | Shown in the header. | |
view | 'unified' | 'split' | Controlled view; use with onViewChange. | |
defaultView | 'unified' | 'split' | 'unified' | Default unified. |
onViewChange | (view: DiffView) => void | Called with the new view when it changes. | |
decisions | HunkDecisions | One entry per change, in order: accepted, rejected or null while undecided. Uncontrolled decisions reset when original or modified change; controlled ones are reset by the parent. | |
defaultDecisions | HunkDecisions | Initial decisions when uncontrolled. | |
onDecisionsChange | (decisions: HunkDecisions) => void | Called with the new decisions when it changes. | |
onResolve | (text: string, decisions: HunkDecision[]) => void | Called whenever the last undecided change gets a decision, with the resulting text. | |
context | number | 3 | Unchanged lines shown around each change; longer unchanged runs collapse. Default 3. |
locale | string | BCP 47 locale for counts; defaults to the ThemeProvider's. | |
labels | Partial<DiffReviewLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Sources — Sources and citations in an answer
- Answer Card — Perplexity-style answer with sources
- Artifact Panel — Artifact panel next to the chat
- AI Chat Window — AI chat window
- Chat Message — Messages with streaming output
- Message Branches — Message versions and a conversation branch tree
- Streaming Text — Smooth token streaming
- Markdown Preview — Rendered Markdown
- Response Feedback — Answer rating and a rubric for reviewers
- Prompt Composer — Prompt field with attachments
- Inline Suggestion — Inline autocomplete suggestion
- Model Selector — AI model picker
Previous: Artifact Panel · Next: Voice Orb · All AI chat and agents