Diff Review
Ревью правок ИИ по фрагментам. Pro · ИИ: чат и агенты › Ответы и артефакты
Установка
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';
Пропсы
| 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. |
Похожие компоненты
- Sources — Источники и цитаты в ответе
- Answer Card — Ответ с источниками в стиле Perplexity
- Artifact Panel — Панель артефакта рядом с чатом
- AI Chat Window — Окно AI-чата
- Chat Message — Сообщения с потоковым выводом
- Message Branches — Версии сообщения и дерево веток диалога
- Streaming Text — Плавный вывод потока токенов
- Markdown Preview — Отображение Markdown
- Response Feedback — Оценка ответа и рубрика для асессоров
- Prompt Composer — Поле промпта с вложениями
- Inline Suggestion — Подсказка-автодополнение в поле ввода
- Model Selector — Выбор модели ИИ
Назад: Artifact Panel · Далее: Voice Orb · Весь раздел «ИИ: чат и агенты»