ValyroUI Русская версия

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

PropTypeDefault
original *stringThe current text.
modified *stringThe text with the proposed edits.
languagestringSyntax highlighting, as in CodeBlock: ts, tsx, css, json, python…
filenamestringShown in the header.
view'unified' | 'split'Controlled view; use with onViewChange.
defaultView'unified' | 'split''unified'Default unified.
onViewChange(view: DiffView) => voidCalled with the new view when it changes.
decisionsHunkDecisionsOne 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.
defaultDecisionsHunkDecisionsInitial decisions when uncontrolled.
onDecisionsChange(decisions: HunkDecisions) => voidCalled with the new decisions when it changes.
onResolve(text: string, decisions: HunkDecision[]) => voidCalled whenever the last undecided change gets a decision, with the resulting text.
contextnumber3Unchanged lines shown around each change; longer unchanged runs collapse. Default 3.
localestringBCP 47 locale for counts; defaults to the ThemeProvider's.
labelsPartial<DiffReviewLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Artifact Panel · Next: Voice Orb · All AI chat and agents