When v0, Copilot, Cursor or other coding assistants suggest code changes, users need a clear way to review what's being changed in each file before accepting or rejecting those changes. Currently, there's no dedicated component in AI Elements to display file-level diffs with interactive approval.
This is how it looks in Cursor for example:
Hence, it would be great to either (1) one of our existing components to cater to this or (2) create a new component that displays file changes in a git-like diff format with interactive controls such as:
- File header showing filename, icon, and change statistics (+X -Y lines)
- Diff viewer with syntax highlighting and line-by-line changes
- Action buttons to accept, reject, or view more details
- Status indicator showing if changes are pending, accepted, or rejected
- Expandable/collapsible to manage multiple file changes
We could for example call it <File /> or <FileDiff />?
Related tickets: